Bug 1667265. Remove nsIPrintSettingsService.globalPrintSettings. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D91366
This commit is contained in:
Jonathan Watt 2020-09-30 12:25:02 +00:00
parent 6adbc97285
commit 1890bfffde
7 changed files with 9 additions and 26 deletions

View File

@ -39,7 +39,7 @@ function printpreview() {
}
}
let settings = Cc["@mozilla.org/gfx/printsettings-service;1"]
.getService(Ci.nsIPrintSettingsService).globalPrintSettings;
.getService(Ci.nsIPrintSettingsService).newPrintSettings;
settings.showPrintProgress = false;
gWbp.printPreview(settings, frameElts[0].contentWindow, listener);
}

View File

@ -40,7 +40,7 @@ function printpreview() {
}
let settings = Cc["@mozilla.org/gfx/printsettings-service;1"]
.getService(Ci.nsIPrintSettingsService).globalPrintSettings;
.getService(Ci.nsIPrintSettingsService).newPrintSettings;
settings.showPrintProgress = false;
gPrintPreviewWin = frameElts[0].contentWindow.printPreview(settings, listener);

View File

@ -69,7 +69,7 @@ function printpreview(options = {}) {
}
}
var settings = Cc["@mozilla.org/gfx/printsettings-service;1"]
.getService(Ci.nsIPrintSettingsService).globalPrintSettings;
.getService(Ci.nsIPrintSettingsService).newPrintSettings;
settings.showPrintProgress = false;
settings.printBGColors = true;
settings.headerStrLeft = "";

View File

@ -121,7 +121,7 @@ class PrintingChild extends ActorChild {
Ci.nsIPrintSettingsService
);
let printSettings = PSSVC.globalPrintSettings;
let printSettings = PSSVC.newPrintSettings;
if (!printSettings.printerName) {
printSettings.printerName = lastUsedPrinterName;
}

View File

@ -609,7 +609,7 @@ var PrintUtils = {
var PSSVC = Cc["@mozilla.org/gfx/printsettings-service;1"].getService(
Ci.nsIPrintSettingsService
);
printSettings = PSSVC.globalPrintSettings;
printSettings = PSSVC.newPrintSettings;
if (aPrinterName) {
printSettings.printerName = aPrinterName;
}

View File

@ -29,11 +29,6 @@ namespace embedding {
[scriptable, uuid(841387C8-72E6-484b-9296-BF6EEA80D58A)]
interface nsIPrintSettingsService : nsISupports
{
/**
* Legacy alias for newPrintSettings.
*/
readonly attribute nsIPrintSettings globalPrintSettings;
/**
* Returns the default print settings as used for printing.
*/
@ -42,16 +37,10 @@ interface nsIPrintSettingsService : nsISupports
/**
* Returns a new, unique PrintSettings object each time.
*
* For example, if each browser was to have its own unique
* PrintSettings, then each browser window would call this to
* create its own unique PrintSettings object.
*
* If each browse window was to use the same PrintSettings object
* then it should use "globalPrintSettings"
*
* Initializes the newPrintSettings from the unprefixed printer
* (Note: this may not happen if there is an OS specific implementation.)
*
* XXX This should really be a function called `createPrintSettings()`.
*/
readonly attribute nsIPrintSettings newPrintSettings;

View File

@ -821,11 +821,11 @@ nsresult nsPrintSettingsService::WritePrefs(nsIPrintSettings* aPS,
NS_IMETHODIMP
nsPrintSettingsService::GetDefaultPrintSettingsForPrinting(
nsIPrintSettings** aGlobalPrintSettings) {
nsresult rv = GetGlobalPrintSettings(aGlobalPrintSettings);
nsIPrintSettings** aPrintSettings) {
nsresult rv = GetNewPrintSettings(aPrintSettings);
NS_ENSURE_SUCCESS(rv, rv);
nsIPrintSettings* settings = *aGlobalPrintSettings;
nsIPrintSettings* settings = *aPrintSettings;
nsAutoString printerName;
settings->GetPrinterName(printerName);
@ -838,12 +838,6 @@ nsPrintSettingsService::GetDefaultPrintSettingsForPrinting(
return NS_OK;
}
NS_IMETHODIMP
nsPrintSettingsService::GetGlobalPrintSettings(
nsIPrintSettings** aGlobalPrintSettings) {
return GetNewPrintSettings(aGlobalPrintSettings);
}
NS_IMETHODIMP
nsPrintSettingsService::GetNewPrintSettings(
nsIPrintSettings** aNewPrintSettings) {