Closed Bug 1177927 Opened 7 years ago Closed 7 years ago
Simplify frame-list counting in ns
Print Engine to use Get Length()
While fixing bug 1177925, I noticed that nsPrintEngine walks a nsFrameList purely to count the number of frames in it. It should simply use nsFrameList::GetLength for this.
Summary: Simplify child-list counting in nsPrintEngine to use GetLength() → Simplify frame-list counting in nsPrintEngine to use GetLength()
Here's the patch. This just replaces a loop with a call to GetLength(). (I also removed "first" from the comment, because it's not actually "first"; it's rather the last thing that we do.)
Attachment #8626797 - Flags: review?(tnikkel)
Attachment #8626797 - Flags: review?(tnikkel) → review+
Comment on attachment 8626797 [details] [diff] [review] fix v1 >+ // count the total number of pages >+ aCount = aSeqFrame->PrincipalChildList()->GetLength(); Er, PrincipalChildList() returns a nsFrameList&, so that should be .GetLength(), not ->. (I could've sworn I built this locally earlier in the week, but I guess not.) Just pushed a followup to fix that.
You need to log in before you can comment on or make changes to this bug.