Bug 1669375 part 2: Remove code that partially implemented the "print only even/odd pages" feature. r=jwatt

This code looked like it might work, but it seems to have only ever been backed
by per-printer about:config prefs.  I believe we only ever exposed UI for this
feature on Linux, via the native GTK dialog; and even there, the UI doesn't
actually seem to have done anything -- it was never wired up to the actual
implementation of even/odd page-skipping.

Differential Revision: https://phabricator.services.mozilla.com/D92528
This commit is contained in:
Daniel Holbert 2020-10-06 15:33:29 +00:00
Родитель 2b7e596021
Коммит 63230729cd
5 изменённых файлов: 2 добавлений и 45 удалений

Просмотреть файл

@ -466,11 +466,6 @@ static void GetPrintCanvasElementsInFrame(
void nsPageSequenceFrame::DetermineWhetherToPrintPage() {
// See whether we should print this page
mPrintThisPage = true;
bool printEvenPages, printOddPages;
mPageData->mPrintSettings->GetPrintOptions(nsIPrintSettings::kPrintEvenPages,
&printEvenPages);
mPageData->mPrintSettings->GetPrintOptions(nsIPrintSettings::kPrintOddPages,
&printOddPages);
// If printing a range of pages check whether the page number is in the
// range of pages to print
@ -499,17 +494,6 @@ void nsPageSequenceFrame::DetermineWhetherToPrintPage() {
}
}
}
// Check for printing of odd and even pages
if (mPageNum & 0x1) {
if (!printOddPages) {
mPrintThisPage = false; // don't print odd numbered page
}
} else {
if (!printEvenPages) {
mPrintThisPage = false; // don't print even numbered page
}
}
}
nsIFrame* nsPageSequenceFrame::GetCurrentPageFrame() {

Просмотреть файл

@ -516,7 +516,6 @@ function onAccept() {
gPrintSettingsInterface.kInitSaveInColor |
gPrintSettingsInterface.kInitSaveReversed |
gPrintSettingsInterface.kInitSaveOrientation |
gPrintSettingsInterface.kInitSaveOddEvenPages |
gPrintSettingsInterface.kInitSaveShrinkToFit |
gPrintSettingsInterface.kInitSaveScaling;

Просмотреть файл

@ -29,7 +29,7 @@ interface nsIPrintSettings : nsISupports
/**
* PrintSettings to be Saved Navigation Constants
*/
const unsigned long kInitSaveOddEvenPages = 0x00000001;
/* Flag 0x00000001 is unused */
const unsigned long kInitSaveHeaderLeft = 0x00000002;
const unsigned long kInitSaveHeaderCenter = 0x00000004;
const unsigned long kInitSaveHeaderRight = 0x00000008;
@ -63,9 +63,7 @@ interface nsIPrintSettings : nsISupports
const unsigned long kInitSaveAll = 0xFFFFFFFF;
/* Print Option Flags for Bit Field*/
const long kPrintOddPages = 0x00000001;
const long kPrintEvenPages = 0x00000002;
const long kEnableSelectionRB = 0x00000004;
const long kEnableSelectionRB = 0x00000001;
/* Print Range Enums */
const long kRangeAllPages = 0;

Просмотреть файл

@ -51,8 +51,6 @@ nsPrintSettings::nsPrintSettings()
mEdge.SizeTo(0, 0, 0, 0);
mUnwriteableMargin.SizeTo(0, 0, 0, 0);
mPrintOptions = kPrintOddPages | kPrintEvenPages;
mHeaderStrs[0].AssignLiteral("&T");
mHeaderStrs[2].AssignLiteral("&U");

Просмотреть файл

@ -48,8 +48,6 @@ static const char kUnwriteableMarginBottom[] =
static const char kUnwriteableMarginRight[] = "print_unwriteable_margin_right";
// Prefs for Print Options
static const char kPrintEvenPages[] = "print_evenpages";
static const char kPrintOddPages[] = "print_oddpages";
static const char kPrintHeaderStrLeft[] = "print_headerleft";
static const char kPrintHeaderStrCenter[] = "print_headercenter";
static const char kPrintHeaderStrRight[] = "print_headerright";
@ -436,15 +434,6 @@ nsresult nsPrintSettingsService::ReadPrefs(nsIPrintSettings* aPS,
}
}
if (aFlags & nsIPrintSettings::kInitSaveOddEvenPages) {
if (GETBOOLPREF(kPrintEvenPages, &b)) {
aPS->SetPrintOptions(nsIPrintSettings::kPrintEvenPages, b);
}
if (GETBOOLPREF(kPrintOddPages, &b)) {
aPS->SetPrintOptions(nsIPrintSettings::kPrintOddPages, b);
}
}
if (aFlags & nsIPrintSettings::kInitSaveHeaderLeft) {
if (GETSTRPREF(kPrintHeaderStrLeft, str)) {
aPS->SetHeaderStrLeft(str);
@ -642,17 +631,6 @@ nsresult nsPrintSettingsService::WritePrefs(nsIPrintSettings* aPS,
int32_t iVal;
double dbl;
if (aFlags & nsIPrintSettings::kInitSaveOddEvenPages) {
if (NS_SUCCEEDED(
aPS->GetPrintOptions(nsIPrintSettings::kPrintEvenPages, &b))) {
Preferences::SetBool(GetPrefName(kPrintEvenPages, aPrinterName), b);
}
if (NS_SUCCEEDED(
aPS->GetPrintOptions(nsIPrintSettings::kPrintOddPages, &b))) {
Preferences::SetBool(GetPrefName(kPrintOddPages, aPrinterName), b);
}
}
if (aFlags & nsIPrintSettings::kInitSaveHeaderLeft) {
if (NS_SUCCEEDED(aPS->GetHeaderStrLeft(uStr))) {
Preferences::SetString(GetPrefName(kPrintHeaderStrLeft, aPrinterName),