From ef8eadc5320d8851d8a301ac49930c1c1e04fb91 Mon Sep 17 00:00:00 2001 From: "ginn.chen%sun.com" Date: Tue, 7 Feb 2006 01:15:11 +0000 Subject: [PATCH] Bug 270079 Mozilla can not print the URL in the header and footer. patch maker:leon.sha@sun.com r=roc sr=roc --- widget/src/xpwidgets/nsPrintOptionsImpl.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/widget/src/xpwidgets/nsPrintOptionsImpl.cpp b/widget/src/xpwidgets/nsPrintOptionsImpl.cpp index 848bdf5d4be..7fa0077b396 100644 --- a/widget/src/xpwidgets/nsPrintOptionsImpl.cpp +++ b/widget/src/xpwidgets/nsPrintOptionsImpl.cpp @@ -950,13 +950,12 @@ NS_IMETHODIMP nsPrintOptions::CreatePrintSettings(nsIPrintSettings **_retval) /* readonly attribute nsIPrintSettings globalPrintSettings; */ NS_IMETHODIMP nsPrintOptions::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings) { - if (!mGlobalPrintSettings) { - CreatePrintSettings(getter_AddRefs(mGlobalPrintSettings)); - NS_ASSERTION(mGlobalPrintSettings, "Can't be NULL!"); - } + nsresult rv; + rv = CreatePrintSettings(getter_AddRefs(mGlobalPrintSettings)); + NS_ASSERTION(NS_FAILED(rv) || mGlobalPrintSettings, "Can't be NULL!"); // If this still NULL, we have some very big problems going on - if (!mGlobalPrintSettings) { + if (NS_FAILED(rv) || !mGlobalPrintSettings) { return NS_ERROR_FAILURE; }