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:
waqar%netscape.com 2000-10-30 15:22:46 +00:00
Родитель 199475237b
Коммит 9aad2ac07c
5 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

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