Bug 1177927: Use nsFrameList::GetLength() instead of manual iteration to count pages in nsPrintEngine. r=tn

This commit is contained in:
Daniel Holbert 2015-06-27 03:07:30 -07:00
parent 5477c03e0c
commit 793c147e27

View File

@ -360,16 +360,10 @@ nsPrintEngine::GetSeqFrameAndCountPagesInternal(nsPrintObject* aPO,
return NS_ERROR_FAILURE;
}
// first count the total number of pages
aCount = 0;
nsIFrame* pageFrame = aSeqFrame->GetFirstPrincipalChild();
while (pageFrame != nullptr) {
aCount++;
pageFrame = pageFrame->GetNextSibling();
}
// count the total number of pages
aCount = aSeqFrame->PrincipalChildList()->GetLength();
return NS_OK;
}
//-----------------------------------------------------------------