Bug 1692845 - Restore read from global print settings for a few settings, including print_bgcolor and print_bgimages. r=bobowen

These were lost in bug 1667953, but I don't think print_bgimages /
print_bgcolor should be printer-specific only.

Differential Revision: https://phabricator.services.mozilla.com/D105465
This commit is contained in:
Emilio Cobos Álvarez 2021-02-23 10:52:53 +00:00
parent 3ae296b53c
commit 95e40970cd
3 changed files with 13 additions and 17 deletions

View File

@ -63,12 +63,7 @@ nsresult nsPrintSettingsServiceX::_CreatePrintSettings(nsIPrintSettings** _retva
return rv;
}
auto globalPrintSettings =
nsIPrintSettings::kInitSaveShrinkToFit | nsIPrintSettings::kInitSaveHeaderLeft |
nsIPrintSettings::kInitSaveHeaderCenter | nsIPrintSettings::kInitSaveHeaderRight |
nsIPrintSettings::kInitSaveFooterLeft | nsIPrintSettings::kInitSaveFooterCenter |
nsIPrintSettings::kInitSaveFooterRight | nsIPrintSettings::kInitSaveEdges |
nsIPrintSettings::kInitSaveReversed | nsIPrintSettings::kInitSaveInColor;
auto globalPrintSettings = nsIPrintSettings::kGlobalSettings;
// XXX Why is Mac special? Why are we copying global print settings here?
// nsPrintSettingsService::InitPrintSettingsFromPrefs already gets the few

View File

@ -61,6 +61,14 @@ interface nsIPrintSettings : nsISupports
const unsigned long kInitSaveAll = 0xFFFFFFFF;
// These settings should be read from global prefs. Other settings should be
// read only from printer-specific prefs.
const unsigned long kGlobalSettings =
kInitSaveHeaderLeft | kInitSaveHeaderCenter | kInitSaveHeaderRight |
kInitSaveFooterLeft | kInitSaveFooterCenter | kInitSaveFooterRight |
kInitSaveEdges | kInitSaveReversed | kInitSaveInColor |
kInitSaveBGColors | kInitSaveBGImages | kInitSaveShrinkToFit;
/* Justification Enums */
const long kJustLeft = 0;
const long kJustCenter = 1;

View File

@ -840,20 +840,13 @@ nsPrintSettingsService::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS,
bool isInitialized;
aPS->GetIsInitializedFromPrefs(&isInitialized);
if (isInitialized) return NS_OK;
if (isInitialized) {
return NS_OK;
}
auto globalPrintSettings = aFlags;
#ifndef MOZ_WIDGET_ANDROID
globalPrintSettings &= nsIPrintSettings::kInitSaveShrinkToFit |
nsIPrintSettings::kInitSaveHeaderLeft |
nsIPrintSettings::kInitSaveHeaderCenter |
nsIPrintSettings::kInitSaveHeaderRight |
nsIPrintSettings::kInitSaveFooterLeft |
nsIPrintSettings::kInitSaveFooterCenter |
nsIPrintSettings::kInitSaveFooterRight |
nsIPrintSettings::kInitSaveEdges |
nsIPrintSettings::kInitSaveReversed |
nsIPrintSettings::kInitSaveInColor;
globalPrintSettings &= nsIPrintSettings::kGlobalSettings;
#endif
nsAutoString prtName;