mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1050412 part 2: Assert about frame type before static_casting, and drop useless null-check. r=tn
This commit is contained in:
parent
405e80dc03
commit
39bd7337db
@ -255,10 +255,11 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
||||
// Set Page Number Info
|
||||
int32_t pageNum = 1;
|
||||
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
|
||||
nsPageFrame * pf = static_cast<nsPageFrame*>(e.get());
|
||||
if (pf != nullptr) {
|
||||
pf->SetPageNumInfo(pageNum, pageTot);
|
||||
}
|
||||
MOZ_ASSERT(e.get()->GetType() == nsGkAtoms::pageFrame,
|
||||
"only expecting nsPageFrame children. Other children will make "
|
||||
"this static_cast bogus & probably violate other assumptions");
|
||||
nsPageFrame* pf = static_cast<nsPageFrame*>(e.get());
|
||||
pf->SetPageNumInfo(pageNum, pageTot);
|
||||
pageNum++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user