mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Initialize members. Return early in EndDocument() if mPrintJob is null - it means the print operation was aborted earlier. b=415327 r+sr=roc
This commit is contained in:
parent
7e75351acb
commit
dd72b252c2
@ -385,10 +385,12 @@ nsTArray<nsString>* GlobalPrinters::mGlobalPrinterList = nsnull;
|
||||
//---------------
|
||||
|
||||
nsDeviceContextSpecGTK::nsDeviceContextSpecGTK()
|
||||
: mPrintJob(NULL)
|
||||
, mGtkPrinter(NULL)
|
||||
, mGtkPrintSettings(NULL)
|
||||
, mGtkPageSetup(NULL)
|
||||
{
|
||||
DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::nsDeviceContextSpecGTK()\n"));
|
||||
mGtkPageSetup = nsnull;
|
||||
mGtkPrintSettings = nsnull;
|
||||
}
|
||||
|
||||
nsDeviceContextSpecGTK::~nsDeviceContextSpecGTK()
|
||||
@ -718,6 +720,9 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::BeginDocument(PRUnichar * aTitle, PRUnicha
|
||||
NS_IMETHODIMP nsDeviceContextSpecGTK::EndDocument()
|
||||
{
|
||||
if (mToPrinter) {
|
||||
if (!mPrintJob)
|
||||
return NS_OK; // The operation was aborted.
|
||||
|
||||
if (!gtk_print_job_set_source_file(mPrintJob, mSpoolName.get(), nsnull))
|
||||
return NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user