mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 620158 - Crash while printing, r=mats, a=blocking
--HG-- extra : rebase_source : 9aab81626cf1d2e68f266a78ac4bbee780706067
This commit is contained in:
parent
84e289495a
commit
f0c80d0185
@ -44,6 +44,7 @@
|
|||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsIDocShellTreeItem.h"
|
#include "nsIDocShellTreeItem.h"
|
||||||
|
#include "nsIBaseWindow.h"
|
||||||
|
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
//-- nsPrintObject Class Impl
|
//-- nsPrintObject Class Impl
|
||||||
@ -51,7 +52,7 @@
|
|||||||
nsPrintObject::nsPrintObject() :
|
nsPrintObject::nsPrintObject() :
|
||||||
mContent(nsnull), mFrameType(eFrame), mParent(nsnull),
|
mContent(nsnull), mFrameType(eFrame), mParent(nsnull),
|
||||||
mHasBeenPrinted(PR_FALSE), mDontPrint(PR_TRUE), mPrintAsIs(PR_FALSE),
|
mHasBeenPrinted(PR_FALSE), mDontPrint(PR_TRUE), mPrintAsIs(PR_FALSE),
|
||||||
mSharedPresShell(PR_FALSE), mInvisible(PR_FALSE),
|
mSharedPresShell(PR_FALSE), mInvisible(PR_FALSE), mDidCreateDocShell(PR_FALSE),
|
||||||
mShrinkRatio(1.0), mZoomRatio(1.0)
|
mShrinkRatio(1.0), mZoomRatio(1.0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -65,6 +66,12 @@ nsPrintObject::~nsPrintObject()
|
|||||||
}
|
}
|
||||||
|
|
||||||
DestroyPresentation();
|
DestroyPresentation();
|
||||||
|
if (mDidCreateDocShell && mDocShell) {
|
||||||
|
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(mDocShell));
|
||||||
|
if (baseWin) {
|
||||||
|
baseWin->Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
mDocShell = nsnull;
|
mDocShell = nsnull;
|
||||||
mTreeOwner = nsnull; // mTreeOwner must be released after mDocShell;
|
mTreeOwner = nsnull; // mTreeOwner must be released after mDocShell;
|
||||||
}
|
}
|
||||||
@ -86,6 +93,7 @@ nsPrintObject::Init(nsIDocShell* aDocShell, nsIDOMDocument* aDoc,
|
|||||||
// Create a container docshell for printing.
|
// Create a container docshell for printing.
|
||||||
mDocShell = do_CreateInstance("@mozilla.org/docshell;1");
|
mDocShell = do_CreateInstance("@mozilla.org/docshell;1");
|
||||||
NS_ENSURE_TRUE(mDocShell, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(mDocShell, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
mDidCreateDocShell = PR_TRUE;
|
||||||
nsCOMPtr<nsIDocShellTreeItem> newItem = do_QueryInterface(mDocShell);
|
nsCOMPtr<nsIDocShellTreeItem> newItem = do_QueryInterface(mDocShell);
|
||||||
newItem->SetItemType(itemType);
|
newItem->SetItemType(itemType);
|
||||||
newItem->SetTreeOwner(mTreeOwner);
|
newItem->SetTreeOwner(mTreeOwner);
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
PRPackedBool mSharedPresShell;
|
PRPackedBool mSharedPresShell;
|
||||||
PRPackedBool mInvisible; // Indicates PO is set to not visible by CSS
|
PRPackedBool mInvisible; // Indicates PO is set to not visible by CSS
|
||||||
PRPackedBool mPrintPreview;
|
PRPackedBool mPrintPreview;
|
||||||
|
PRPackedBool mDidCreateDocShell;
|
||||||
float mShrinkRatio;
|
float mShrinkRatio;
|
||||||
float mZoomRatio;
|
float mZoomRatio;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user