mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset d053fdf3b609 (bug 1088070)
This commit is contained in:
parent
f6512f020c
commit
872e72c5b1
@ -168,6 +168,28 @@ var PrintUtils = {
|
||||
|
||||
let mm = aBrowser.messageManager;
|
||||
|
||||
mm.addMessageListener("Printing:Print:Done", function onPrintingDone(msg) {
|
||||
mm.removeMessageListener("Printing:Print:Done", onPrintingDone);
|
||||
let rv = msg.data.rv;
|
||||
let printSettings = msg.objects.printSettings;
|
||||
if (rv != Components.results.NS_OK &&
|
||||
rv != Components.results.NS_ERROR_ABORT) {
|
||||
Cu.reportError(`In Printing:Print:Done handler, got unexpected rv
|
||||
${rv}.`);
|
||||
}
|
||||
|
||||
if (gPrintSettingsAreGlobal && gSavePrintSettings) {
|
||||
let PSSVC =
|
||||
Components.classes["@mozilla.org/gfx/printsettings-service;1"]
|
||||
.getService(Components.interfaces.nsIPrintSettingsService);
|
||||
|
||||
PSSVC.savePrintSettingsToPrefs(printSettings, true,
|
||||
printSettings.kInitSaveAll);
|
||||
PSSVC.savePrintSettingsToPrefs(printSettings, false,
|
||||
printSettings.kInitSavePrinterName);
|
||||
}
|
||||
});
|
||||
|
||||
mm.sendAsyncMessage("Printing:Print", null, {
|
||||
contentWindow: aWindow,
|
||||
});
|
||||
|
@ -378,11 +378,6 @@ let Printing = {
|
||||
this.MESSAGES.forEach(msgName => addMessageListener(msgName, this));
|
||||
},
|
||||
|
||||
get shouldSavePrintSettings() {
|
||||
return Services.prefs.getBoolPref("print.use_global_printsettings", false) &&
|
||||
Services.prefs.getBoolPref("print.save_print_settings", false);
|
||||
},
|
||||
|
||||
receiveMessage(message) {
|
||||
let objects = message.objects;
|
||||
let data = message.data;
|
||||
@ -479,21 +474,9 @@ let Printing = {
|
||||
} catch(e) {
|
||||
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
|
||||
// causing an exception to be thrown which we catch here.
|
||||
if (e.result != Cr.NS_ERROR_ABORT) {
|
||||
Cu.reportError(`In Printing:Print:Done handler, got unexpected rv
|
||||
${e.result}.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shouldSavePrintSettings) {
|
||||
let PSSVC = Cc["@mozilla.org/gfx/printsettings-service;1"]
|
||||
.getService(Ci.nsIPrintSettingsService);
|
||||
|
||||
PSSVC.savePrintSettingsToPrefs(printSettings, true,
|
||||
printSettings.kInitSaveAll);
|
||||
PSSVC.savePrintSettingsToPrefs(printSettings, false,
|
||||
printSettings.kInitSavePrinterName);
|
||||
rv = e.result;
|
||||
}
|
||||
sendAsyncMessage("Printing:Print:Done", { rv }, { printSettings });
|
||||
},
|
||||
|
||||
updatePageCount() {
|
||||
|
Loading…
Reference in New Issue
Block a user