diff --git a/layout/printing/nsPrintData.cpp b/layout/printing/nsPrintData.cpp index 405ea56618b9..9d0872d91b6b 100644 --- a/layout/printing/nsPrintData.cpp +++ b/layout/printing/nsPrintData.cpp @@ -43,12 +43,10 @@ nsPrintData::~nsPrintData() { if (mPrintDC) { PR_PL(("****************** End Document ************************\n")); PR_PL(("\n")); - bool isCancelled = false; - mPrintSettings->GetIsCancelled(&isCancelled); nsresult rv = NS_OK; if (mType == eIsPrinting && mPrintDC->IsCurrentlyPrintingDocument()) { - if (!isCancelled && !mIsAborted) { + if (!mIsAborted) { rv = mPrintDC->EndDocument(); } else { rv = mPrintDC->AbortDocument(); diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index 492560fb58ef..4643a99b26e3 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -540,7 +540,6 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview, MOZ_TRY(EnsureSettingsHasPrinterNameSet(printData->mPrintSettings)); - printData->mPrintSettings->SetIsCancelled(false); printData->mPrintSettings->GetShrinkToFit(&printData->mShrinkToFit); // Create a print session and let the print settings know about it. @@ -1950,11 +1949,6 @@ bool nsPrintJob::PrePrintSheet() { // FirePrintingErrorEvent(). RefPtr printData = mPrt; - // Check setting to see if someone request it be cancelled - bool isCancelled = false; - printData->mPrintSettings->GetIsCancelled(&isCancelled); - if (isCancelled) return true; - // Ask mPageSeqFrame if the sheet is ready to be printed. // If the sheet doesn't get printed at all, the |done| will be |true|. bool done = false; @@ -2002,10 +1996,7 @@ bool nsPrintJob::PrintSheet(nsPrintObject* aPO, bool& aInRange) { PR_PL(("------ In DV::PrintSheet PO: %p (%s)\n", aPO, gFrameTypesStr[aPO->mFrameType])); - // Check setting to see if someone request it be cancelled - bool isCancelled = false; - printData->mPrintSettings->GetIsCancelled(&isCancelled); - if (isCancelled || printData->mIsAborted) { + if (printData->mIsAborted) { return true; } diff --git a/widget/cocoa/nsPrintSettingsX.mm b/widget/cocoa/nsPrintSettingsX.mm index f6c5f9184fd5..5272bc0f202f 100644 --- a/widget/cocoa/nsPrintSettingsX.mm +++ b/widget/cocoa/nsPrintSettingsX.mm @@ -25,15 +25,6 @@ nsPrintSettingsX::nsPrintSettingsX() { mDestination = kPMDestinationInvalid; - /* - * Don't save print settings after the user cancels out of the - * print dialog. For saving print settings after a cancellation - * to work properly, in addition to changing |mSaveOnCancel|, - * the print dialog implementation must be updated to save changed - * settings and serialize them back to the child process. - */ - mSaveOnCancel = false; - NS_OBJC_END_TRY_IGNORE_BLOCK; } diff --git a/widget/nsIPrintSettings.idl b/widget/nsIPrintSettings.idl index f3fd57ca725e..8440db3a0438 100644 --- a/widget/nsIPrintSettings.idl +++ b/widget/nsIPrintSettings.idl @@ -275,8 +275,6 @@ interface nsIPrintSettings : nsISupports attribute AString footerStrCenter; attribute AString footerStrRight; - attribute boolean isCancelled; /* indicates whether the print job has been cancelled */ - readonly attribute boolean saveOnCancel; /* indicates whether the print settings should be saved after a cancel */ attribute boolean printSilent; /* print without putting up the dialog */ [infallible] attribute boolean shrinkToFit; /* shrinks content to fit on page */ diff --git a/widget/nsPrintSettingsImpl.cpp b/widget/nsPrintSettingsImpl.cpp index c7d881da7d73..17ce9896bb40 100644 --- a/widget/nsPrintSettingsImpl.cpp +++ b/widget/nsPrintSettingsImpl.cpp @@ -577,21 +577,6 @@ NS_IMETHODIMP nsPrintSettings::SetPaperId(const nsAString& aPaperId) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetIsCancelled(bool* aIsCancelled) { - NS_ENSURE_ARG_POINTER(aIsCancelled); - *aIsCancelled = mIsCancelled; - return NS_OK; -} -NS_IMETHODIMP nsPrintSettings::SetIsCancelled(bool aIsCancelled) { - mIsCancelled = aIsCancelled; - return NS_OK; -} - -NS_IMETHODIMP nsPrintSettings::GetSaveOnCancel(bool* aSaveOnCancel) { - *aSaveOnCancel = mSaveOnCancel; - return NS_OK; -} - NS_IMETHODIMP nsPrintSettings::GetPaperWidth(double* aPaperWidth) { NS_ENSURE_ARG_POINTER(aPaperWidth); *aPaperWidth = mPaperWidth; @@ -912,8 +897,6 @@ nsPrintSettings& nsPrintSettings::operator=(const nsPrintSettings& rhs) { mPrintBGImages = rhs.mPrintBGImages; mTitle = rhs.mTitle; mURL = rhs.mURL; - mIsCancelled = rhs.mIsCancelled; - mSaveOnCancel = rhs.mSaveOnCancel; mPrintSilent = rhs.mPrintSilent; mShrinkToFit = rhs.mShrinkToFit; mShowMarginGuides = rhs.mShowMarginGuides; diff --git a/widget/nsPrintSettingsImpl.h b/widget/nsPrintSettingsImpl.h index ddb918c49fe8..5d0bde6b82a3 100644 --- a/widget/nsPrintSettingsImpl.h +++ b/widget/nsPrintSettingsImpl.h @@ -97,8 +97,6 @@ class nsPrintSettings : public nsIPrintSettings { bool mPrintBGColors = false; bool mPrintBGImages = false; - bool mIsCancelled = false; - bool mSaveOnCancel = true; bool mPrintSilent = false; bool mShrinkToFit = true; bool mShowMarginGuides = false; diff --git a/widget/nsPrintSettingsService.cpp b/widget/nsPrintSettingsService.cpp index d6360d612892..7efcfb65438c 100644 --- a/widget/nsPrintSettingsService.cpp +++ b/widget/nsPrintSettingsService.cpp @@ -135,7 +135,6 @@ nsPrintSettingsService::SerializeToPrintData(nsIPrintSettings* aSettings, aSettings->GetFooterStrCenter(data->footerStrCenter()); aSettings->GetFooterStrRight(data->footerStrRight()); - aSettings->GetIsCancelled(&data->isCancelled()); aSettings->GetPrintSilent(&data->printSilent()); aSettings->GetShrinkToFit(&data->shrinkToFit()); @@ -224,7 +223,6 @@ nsPrintSettingsService::DeserializeToPrintSettings(const PrintData& data, settings->SetFooterStrCenter(data.footerStrCenter()); settings->SetFooterStrRight(data.footerStrRight()); - settings->SetIsCancelled(data.isCancelled()); settings->SetPrintSilent(data.printSilent()); settings->SetShrinkToFit(data.shrinkToFit()); diff --git a/widget/windows/nsPrintDialogUtil.cpp b/widget/windows/nsPrintDialogUtil.cpp index 4bcce56760c3..7b487a053f55 100644 --- a/widget/windows/nsPrintDialogUtil.cpp +++ b/widget/windows/nsPrintDialogUtil.cpp @@ -279,10 +279,7 @@ static nsresult ShowNativePrintDialog(HWND aHWnd, result = ::PrintDlgExW(&prntdlg); } - auto cancelOnExit = mozilla::MakeScopeExit([&] { - ::SetFocus(aHWnd); - aPrintSettings->SetIsCancelled(true); - }); + auto cancelOnExit = mozilla::MakeScopeExit([&] { ::SetFocus(aHWnd); }); if (NS_WARN_IF(!SUCCEEDED(result))) { #ifdef DEBUG