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.


git-svn-id: svn://10.0.0.236/trunk@82003 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waqar%netscape.com
2000-10-30 15:22:46 +00:00
parent 033e35780c
commit c1d6bbe433
5 changed files with 8 additions and 7 deletions

View File

@@ -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;

View File

@@ -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;
}
/** ---------------------------------------------------

View File

@@ -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_));

View File

@@ -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;

View File

@@ -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;