[FIX]crash when print range pages 2->2 of local file to printer

VERIFIED FIXED in mozilla0.9.1

Status

()

Core
Printing: Output
--
critical
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Kathleen Brade, Assigned: rods (gone))

Tracking

({crash, regression})

Trunk
mozilla0.9.1
x86
Windows NT
crash, regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: Fix in Hand, have r=, need sr=, and a=)

(Reporter)

Description

17 years ago
Using a mozilla build from this morning, I am unable to print page 2->2 of a 
local file.  I crash in nsPageFrame.cpp in nsPageFrame::Paint() on this line:
    mPrintOptions->GetMarginInTwips(mMargin);
because mPrintOptions' raw ptr is null.

I am able to print page 1->1 of the same file.

I also noticed that I could *not* print page 2->2 of Sample 4 in the debug menu 
but I could print page 2->2 of Sample 5.

Comment 1

17 years ago
I looked at this, along with Rod and we determined a few things.
1.)  This is a regression.  We could get sample 0 to break, printing 2 of 2, 
this was the test case Rod used to test with. 
2.)  This crashes becauses an nsPageFrame is not set up correctly.  The reason 
is because the correct nsPageFrame is set up, but the ViewManager prints the 
wrong nsPageFrame that did not get set up for printing.
3.)  This problem can be fixed if the view of the pages not printed are either 
hidden or there hieght is set to 0.   

Comment 2

17 years ago
Give back to me if you want me to finish this out.
Assignee: dcone → rods
(Assignee)

Comment 3

17 years ago
Patch:

Index: nsSimplePageSequence.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsSimplePageSequence.cpp,v
retrieving revision 3.42
diff -u -r3.42 nsSimplePageSequence.cpp
--- nsSimplePageSequence.cpp	2001/04/25 14:26:28	3.42
+++ nsSimplePageSequence.cpp	2001/05/29 21:50:17
@@ -570,7 +570,8 @@
       if (pageNum < mFromPageNum || pageNum > mToPageNum) {
         // XXX Doesn't seem like we need to do this
         // because we ask only the pages we want to print
-        //view->SetVisibility(nsViewVisibility_kHide);
+        view->SetVisibility(nsViewVisibility_kHide);
+        view->SetChildClip(0,0,0,0);
       } else {
         nsRect rect;
         page->GetRect(rect);
Status: NEW → ASSIGNED
Keywords: crash
Summary: crash when print range pages 2->2 of local file to printer → [FIX]crash when print range pages 2->2 of local file to printer
Whiteboard: Fix in Hand
Target Milestone: --- → mozilla0.9.1
you also need to add the following to make the SetChildClip have an affect.

view->SetViewFlags(NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN);

Provided you add the following line:

r=kmcclusk@netscape.com

Comment 5

17 years ago
who is a good super reviewer for this?
Whiteboard: Fix in Hand → Fix in Hand, have r=, need sr=, and a=
(Assignee)

Comment 6

17 years ago
I asked attinasi, but maybe hyatt....I also send it to him. This is an important 
oone to get in.
(Assignee)

Updated

17 years ago
Keywords: regression
(Assignee)

Comment 7

17 years ago
Final patch with updated comments and Kevin's suggestion:

Index: nsSimplePageSequence.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsSimplePageSequence.cpp,v
retrieving revision 3.42
diff -u -r3.42 nsSimplePageSequence.cpp
--- nsSimplePageSequence.cpp    2001/04/25 14:26:28     3.42
+++ nsSimplePageSequence.cpp    2001/05/30 13:03:21
@@ -568,9 +568,13 @@
       page->GetView(aPresContext, &view);
       NS_ASSERTION(nsnull != view, "no page view");
       if (pageNum < mFromPageNum || pageNum > mToPageNum) {
-        // XXX Doesn't seem like we need to do this
-        // because we ask only the pages we want to print
-        //view->SetVisibility(nsViewVisibility_kHide);
+        // Hide the pages that won't be printed to the Viewmanager
+        // doesn't put them in the display list. Also, makde
+        // sure the child views don't get asked to print
+        // but my guess is that there won't be any
+        view->SetVisibility(nsViewVisibility_kHide);
+        view->SetChildClip(0,0,0,0);
+        view->SetViewFlags(NS_VIEW_PUBLIC_FLAG_CLIPCHILDREN);
       } else {
         nsRect rect;
         page->GetRect(rect);

Comment 8

17 years ago
sr=attinasi
a=dbaron for 0.9.1
(Assignee)

Comment 10

17 years ago
fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 11

17 years ago
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.