Bug 671970 - Crash [@ nsPrintEngine::ReflowDocList, r=roc

This commit is contained in:
Olli Pettay 2011-07-18 14:02:02 +03:00
Родитель 3a94e08884
Коммит 5680cf75b1
1 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -1829,13 +1829,11 @@ nsPrintEngine::ReflowDocList(nsPrintObject* aPO, PRBool aSetPixelScale)
// Check to see if the subdocument's element has been hidden by the parent document
if (aPO->mParent && aPO->mParent->mPresShell) {
nsIFrame * frame = aPO->mContent->GetPrimaryFrame();
if (frame) {
if (!frame->GetStyleVisibility()->IsVisible()) {
aPO->mDontPrint = PR_TRUE;
aPO->mInvisible = PR_TRUE;
return NS_OK;
}
nsIFrame* frame = aPO->mContent ? aPO->mContent->GetPrimaryFrame() : nsnull;
if (!frame || !frame->GetStyleVisibility()->IsVisible()) {
aPO->mDontPrint = PR_TRUE;
aPO->mInvisible = PR_TRUE;
return NS_OK;
}
}
@ -1885,7 +1883,7 @@ nsPrintEngine::ReflowPrintObject(nsPrintObject * aPO)
nsIView* parentView = nsnull;
if (aPO->mParent && aPO->mParent->IsPrintable()) {
nsIFrame* frame = aPO->mContent->GetPrimaryFrame();
nsIFrame* frame = aPO->mContent ? aPO->mContent->GetPrimaryFrame() : nsnull;
// Without a frame, this document can't be displayed; therefore, there is no
// point to reflowing it
if (!frame) {