diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index 59a576257a66..2deb0d3d1967 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -952,7 +952,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, // now complete printing the rest of the document // if it doesn't contain any framesets if (!doesContainFrameSet) { - aDContext->BeginDocument(); + NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height); nsCOMPtr cx; diff --git a/gfx/src/ps/nsDeviceContextPS.cpp b/gfx/src/ps/nsDeviceContextPS.cpp index e641cadf4f18..078cfedbe3c1 100644 --- a/gfx/src/ps/nsDeviceContextPS.cpp +++ b/gfx/src/ps/nsDeviceContextPS.cpp @@ -307,16 +307,16 @@ NS_IMETHODIMP nsDeviceContextPS::GetDeviceContextFor(nsIDeviceContextSpec *aDevi NS_IMETHODIMP nsDeviceContextPS::BeginDocument(void) { nsIDeviceContextSpecPS *psSpec; - nsresult res; + nsresult res = NS_OK; if ( nsnull != mSpec ) { mPSObj = new nsPostScriptObj(); res = mSpec->QueryInterface(kIDeviceContextSpecPSIID, (void **) &psSpec); if ( res == NS_OK ) { - mPSObj->Init(psSpec); + res = mPSObj->Init(psSpec); } } - return NS_OK; + return res; } /** --------------------------------------------------- diff --git a/gfx/src/ps/nsPostScriptObj.cpp b/gfx/src/ps/nsPostScriptObj.cpp index 899e4fd87f86..b059cbb2f0f9 100644 --- a/gfx/src/ps/nsPostScriptObj.cpp +++ b/gfx/src/ps/nsPostScriptObj.cpp @@ -223,6 +223,7 @@ printf( "top %f bottom %f left %f right %f\n", top, bottom, left, right ); #ifndef VMS aSpec->GetCommand( &buf ); #ifdef XP_OS2_VACPP + mPrintSetup->out = NULL; // popen not defined OS2TODO #else mPrintSetup->out = popen( buf, "w" ); @@ -245,7 +246,7 @@ printf( "top %f bottom %f left %f right %f\n", top, bottom, left, right ); /* make sure the open worked */ - if ( mPrintSetup->out < 0 ) + if ( mPrintSetup->out == NULL ) return NS_ERROR_FAILURE; mPrintContext = new PSContext(); memset(mPrintContext, 0, sizeof(struct PSContext_)); diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 59a576257a66..2deb0d3d1967 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -952,7 +952,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, // now complete printing the rest of the document // if it doesn't contain any framesets if (!doesContainFrameSet) { - aDContext->BeginDocument(); + NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height); nsCOMPtr cx; diff --git a/layout/base/src/nsDocumentViewer.cpp b/layout/base/src/nsDocumentViewer.cpp index 59a576257a66..2deb0d3d1967 100644 --- a/layout/base/src/nsDocumentViewer.cpp +++ b/layout/base/src/nsDocumentViewer.cpp @@ -952,7 +952,7 @@ DocumentViewerImpl::PrintContent(nsIWebShell * aParent, // now complete printing the rest of the document // if it doesn't contain any framesets if (!doesContainFrameSet) { - aDContext->BeginDocument(); + NS_ENSURE_SUCCESS( aDContext->BeginDocument(), NS_ERROR_FAILURE ); aDContext->GetDeviceSurfaceDimensions(width, height); nsCOMPtr cx;