From 8d542d93ce47cf78eee3e2744b178e1521e18ceb Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Sun, 27 Feb 2022 21:12:08 +0000 Subject: [PATCH] Bug 1756445 - Stop saving print settings in platform code after printing. r=bobowen Differential Revision: https://phabricator.services.mozilla.com/D139291 --- layout/printing/nsPrintJob.cpp | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index 9c6e4b8ee579..3afe9283dcd4 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -632,36 +632,7 @@ nsresult nsPrintJob::Print(Document* aSourceDoc, ? mPrtPreview->mPrintObject->mDocument.get() : aSourceDoc; - nsresult rv = CommonPrint(false, aPrintSettings, aWebProgressListener, doc); - - if (!aPrintSettings) { - // This is temporary until after bug 1602410 lands. - return rv; - } - - // Save the print settings if the user picked them. - // We should probably do this immediately after the user confirms their - // selection (that is, move this to nsPrintingPromptService::ShowPrintDialog, - // just after the nsIPrintDialogService::Show call returns). - bool printSilently; - aPrintSettings->GetPrintSilent(&printSilently); - if (!printSilently) { // user picked settings - bool saveOnCancel; - aPrintSettings->GetSaveOnCancel(&saveOnCancel); - if ((rv != NS_ERROR_ABORT || saveOnCancel) && - Preferences::GetBool("print.save_print_settings", false)) { - nsCOMPtr printSettingsService = - do_GetService("@mozilla.org/gfx/printsettings-service;1"); - printSettingsService->SavePrintSettingsToPrefs( - aPrintSettings, true, - nsIPrintSettings::kInitSaveAll & - ~nsIPrintSettings::kInitSaveToFileName); - printSettingsService->SavePrintSettingsToPrefs( - aPrintSettings, false, nsIPrintSettings::kInitSavePrinterName); - } - } - - return rv; + return CommonPrint(false, aPrintSettings, aWebProgressListener, doc); } nsresult nsPrintJob::PrintPreview(Document* aSourceDoc,