mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
#=34706
r=dcone@netscape.com a=buster@netscape.com d=Fixes a crash on linux when printing to a file in a directory where I dont have permission to or printing to a directory or to a non existing printer.
This commit is contained in:
parent
199475237b
commit
9aad2ac07c
@ -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<nsIPresContext> cx;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------
|
||||
|
@ -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_));
|
||||
|
@ -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<nsIPresContext> cx;
|
||||
|
@ -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<nsIPresContext> cx;
|
||||
|
Loading…
Reference in New Issue
Block a user