bug 147419 remove ununsed nsIPrintSettings::printCommand and print_command prefs r=roc

These was used only to write to and read from each other.

--HG--
extra : rebase_source : ef49678652f829fe23611fb2294a22c3ffd91cf1
This commit is contained in:
Karl Tomlinson 2015-06-10 18:10:28 +12:00
parent 90d1a6fe7b
commit a19a1f0d0c
11 changed files with 2 additions and 108 deletions

View File

@ -60,7 +60,6 @@ struct PrintData {
bool printReversed;
bool printInColor;
int32_t orientation;
nsString printCommand;
int32_t numCopies;
nsString printerName;
bool printToFile;

View File

@ -3513,7 +3513,6 @@ pref("helpers.global_mime_types_file", "/etc/mime.types");
pref("helpers.global_mailcap_file", "/etc/mailcap");
pref("helpers.private_mime_types_file", "~/.mime.types");
pref("helpers.private_mailcap_file", "~/.mailcap");
pref("print.print_command", "lpr ${MOZ_PRINTER_NAME:+-P\"$MOZ_PRINTER_NAME\"}");
pref("print.printer_list", ""); // list of printers, separated by spaces
pref("print.print_reversed", false);
pref("print.print_color", true);
@ -3535,7 +3534,6 @@ pref("layout.css.scroll-snap.enabled", false);
// pref("print.postscript.enabled", true);
pref("print.postscript.paper_size", "letter");
pref("print.postscript.orientation", "portrait");
pref("print.postscript.print_command", "lpr ${MOZ_PRINTER_NAME:+-P\"$MOZ_PRINTER_NAME\"}");
// Setting default_level_parent to true makes the default level for popup
// windows "top" instead of "parent". On GTK2 platform, this is implemented
@ -3586,7 +3584,6 @@ pref("helpers.global_mime_types_file", "/etc/mime.types");
pref("helpers.global_mailcap_file", "/etc/mailcap");
pref("helpers.private_mime_types_file", "~/.mime.types");
pref("helpers.private_mailcap_file", "~/.mailcap");
pref("print.print_command", "lpr ${MOZ_PRINTER_NAME:+-P\"$MOZ_PRINTER_NAME\"}");
pref("print.printer_list", ""); // list of printers, separated by spaces
pref("print.print_reversed", false);
pref("print.print_color", true);
@ -3722,7 +3719,6 @@ pref("font.name.monospace.zh-TW", "monospace");
// pref("print.postscript.enabled", true);
pref("print.postscript.paper_size", "letter");
pref("print.postscript.orientation", "portrait");
pref("print.postscript.print_command", "lpr ${MOZ_PRINTER_NAME:+-P\"$MOZ_PRINTER_NAME\"}");
// On GTK2 platform, we should use topmost window level for the default window
// level of <panel> element of XUL. GTK2 has only two window types. One is
@ -3944,14 +3940,6 @@ pref("font.name.monospace.x-unicode", "dt-interface user-ucs2.cjk_japan-0");
# AIX
#endif
#ifdef SOLARIS
pref("print.postscript.print_command", "lp -c -s ${MOZ_PRINTER_NAME:+-d\"$MOZ_PRINTER_NAME\"}");
pref("print.print_command", "lp -c -s ${MOZ_PRINTER_NAME:+-d\"$MOZ_PRINTER_NAME\"}");
# Solaris
#endif
// Login Manager prefs
pref("signon.rememberSignons", true);
pref("signon.autofillForms", true);

View File

@ -377,7 +377,6 @@ function onAccept()
gPrintSetInterface.kInitSaveInColor |
gPrintSetInterface.kInitSaveResolutionName |
gPrintSetInterface.kInitSaveDownloadFonts |
gPrintSetInterface.kInitSavePrintCommand |
gPrintSetInterface.kInitSaveShrinkToFit |
gPrintSetInterface.kInitSaveScaling;
printService.savePrintSettingsToPrefs(gPrintSettings, true, flags);

View File

@ -14,7 +14,6 @@ var gResolutionArray;
var gColorSpaceArray;
var gPrefs;
var default_command = "lpr";
var gPrintSetInterface = Components.interfaces.nsIPrintSettings;
var doDebug = true;
@ -77,10 +76,6 @@ function initDialog()
dialog.jobTitleGroup = document.getElementById("jobTitleGroup");
dialog.jobTitleInput = document.getElementById("jobTitleInput");
dialog.cmdLabel = document.getElementById("cmdLabel");
dialog.cmdGroup = document.getElementById("cmdGroup");
dialog.cmdInput = document.getElementById("cmdInput");
dialog.colorspaceList = document.getElementById("colorspaceList");
dialog.colorspaceGroup = document.getElementById("colorspaceGroup");
@ -589,7 +584,6 @@ function loadDialog()
var print_colorspace = "";
var print_color = true;
var print_downloadfonts = true;
var print_command = default_command;
var print_jobtitle = "";
gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
@ -605,7 +599,6 @@ function loadDialog()
print_colorspace = gPrintSettings.colorspace;
print_color = gPrintSettings.printInColor;
print_downloadfonts = gPrintSettings.downloadFonts;
print_command = gPrintSettings.printCommand;
print_jobtitle = gPrintSettings.title;
}
@ -620,7 +613,6 @@ function loadDialog()
dump("colorspace "+print_colorspace+"\n");
dump("print_color "+print_color+"\n");
dump("print_downloadfonts "+print_downloadfonts+"\n");
dump("print_command "+print_command+"\n");
dump("print_jobtitle "+print_jobtitle+"\n");
}
@ -709,16 +701,6 @@ function loadDialog()
else
dialog.jobTitleGroup.setAttribute("hidden","true");
// spooler command
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".can_change_spoolercommand"))
dialog.cmdInput.removeAttribute("disabled");
else
dialog.cmdInput.setAttribute("disabled","true");
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".supports_spoolercommand_change"))
dialog.cmdGroup.removeAttribute("hidden");
else
dialog.cmdGroup.setAttribute("hidden","true");
// paper size
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".can_change_paper_size"))
dialog.paperList.removeAttribute("disabled");
@ -780,10 +762,6 @@ function loadDialog()
dialog.fontsGroup.setAttribute("hidden","true");
}
if (print_command == "") {
print_command = default_command;
}
if (print_color) {
dialog.colorRadioGroup.selectedItem = dialog.colorRadio;
} else {
@ -792,7 +770,6 @@ function loadDialog()
dialog.downloadFonts.checked = print_downloadfonts;
dialog.cmdInput.value = print_command;
dialog.jobTitleInput.value = print_jobtitle;
dialog.topInput.value = gPrintSettings.edgeTop.toFixed(2);
@ -862,7 +839,6 @@ function onAccept()
// save these out so they can be picked up by the device spec
gPrintSettings.printInColor = dialog.colorRadio.selected;
gPrintSettings.downloadFonts = dialog.downloadFonts.checked;
gPrintSettings.printCommand = dialog.cmdInput.value;
gPrintSettings.title = dialog.jobTitleInput.value;
gPrintSettings.edgeTop = dialog.topInput.value;
@ -883,7 +859,6 @@ function onAccept()
dump("printInColor "+gPrintSettings.printInColor+"\n");
dump("downloadFonts "+gPrintSettings.downloadFonts+"\n");
dump("printCommand '"+gPrintSettings.printCommand+"'\n");
}
} else {
dump("************ onAccept gPrintSettings: "+gPrintSettings+"\n");

View File

@ -83,14 +83,6 @@
</menulist>
</row>
<row id="cmdGroup">
<label id="cmdLabel"
value="&cmdInput.label;"
accesskey="&cmdInput.accesskey;"
control="cmdInput"/>
<textbox id="cmdInput" flex="1"/>
</row>
<row id="colorGroup">
<hbox align="center" pack="end">
<label control="colorRadioGroup" value="&colorGroup.label;"/>

View File

@ -15,9 +15,6 @@
<!ENTITY resolutionInput.label "Resolution/Quality:">
<!ENTITY resolutionInput.accesskey "e">
<!ENTITY cmdInput.label "Print Command:">
<!ENTITY cmdInput.accesskey "o">
<!ENTITY jobTitleInput.label "Job Title:">
<!ENTITY jobTitleInput.accesskey "J">

View File

@ -578,19 +578,6 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const char16_
DO_PR_DEBUG_LOG(("Unknown paper size '%s' given.\n", papername.get()));
}
}
bool hasSpoolerCmd = (nsPSPrinterList::kTypePS ==
nsPSPrinterList::GetPrinterType(fullPrinterName));
if (hasSpoolerCmd) {
nsAutoCString command;
if (NS_SUCCEEDED(CopyPrinterCharPref("postscript",
printerName, "print_command", command))) {
DO_PR_DEBUG_LOG(("setting default print command to '%s'\n",
command.get()));
aPrintSettings->SetPrintCommand(NS_ConvertUTF8toUTF16(command).get());
}
}
return NS_OK;
}

View File

@ -22,7 +22,7 @@ interface nsIPrintSession;
/**
* Simplified graphics interface for JS rendering.
*/
[scriptable, uuid(11b86b46-12c9-4e63-8023-129dd239ace7)]
[scriptable, uuid(ec3d43bb-3fe0-4f9a-9502-eebcc511555b)]
interface nsIPrintSettings : nsISupports
{
@ -49,7 +49,7 @@ interface nsIPrintSettings : nsISupports
const unsigned long kInitSaveReversed = 0x00010000;
const unsigned long kInitSaveInColor = 0x00020000;
const unsigned long kInitSaveOrientation = 0x00040000;
const unsigned long kInitSavePrintCommand = 0x00080000;
const unsigned long kInitSavePrinterName = 0x00100000;
const unsigned long kInitSavePrintToFile = 0x00200000;
const unsigned long kInitSaveToFileName = 0x00400000;
@ -243,7 +243,6 @@ interface nsIPrintSettings : nsISupports
attribute boolean printReversed;
attribute boolean printInColor; /* a false means grayscale */
attribute long orientation; /* see orientation consts */
attribute wstring printCommand;
attribute long numCopies;
attribute wstring printerName; /* name of destination printer */

View File

@ -69,7 +69,6 @@ static const char kPrintColorspace[] = "print_colorspace";
static const char kPrintResolutionName[]= "print_resolution_name";
static const char kPrintDownloadFonts[] = "print_downloadfonts";
static const char kPrintOrientation[] = "print_orientation";
static const char kPrintCommand[] = "print_command";
static const char kPrinterName[] = "print_printer";
static const char kPrintToFile[] = "print_to_file";
static const char kPrintToFileName[] = "print_to_filename";
@ -199,10 +198,6 @@ nsPrintOptions::SerializeToPrintData(nsIPrintSettings* aSettings,
aSettings->GetPrintInColor(&data->printInColor());
aSettings->GetOrientation(&data->orientation());
nsXPIDLString printCommand;
aSettings->GetPrintCommand(getter_Copies(printCommand));
data->printCommand() = printCommand;
aSettings->GetNumCopies(&data->numCopies());
nsXPIDLString printerName;
@ -319,8 +314,6 @@ nsPrintOptions::DeserializeToPrintSettings(const PrintData& data,
settings->SetPrintInColor(data.printInColor());
settings->SetOrientation(data.orientation());
settings->SetPrintCommand(data.printCommand().get());
settings->SetNumCopies(data.numCopies());
settings->SetPrinterName(data.printerName().get());
@ -699,13 +692,6 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
}
}
if (aFlags & nsIPrintSettings::kInitSavePrintCommand) {
if (GETSTRPREF(kPrintCommand, &str)) {
aPS->SetPrintCommand(str.get());
DUMP_STR(kReadStr, kPrintCommand, str.get());
}
}
if (aFlags & nsIPrintSettings::kInitSavePrintToFile) {
if (GETBOOLPREF(kPrintToFile, &b)) {
aPS->SetPrintToFile(b);
@ -1000,13 +986,6 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
}
}
if (aFlags & nsIPrintSettings::kInitSavePrintCommand) {
if (NS_SUCCEEDED(aPS->GetPrintCommand(&uStr))) {
DUMP_STR(kWriteStr, kPrintCommand, uStr);
Preferences::SetString(GetPrefName(kPrintCommand, aPrinterName), uStr);
}
}
// Only the general version of this pref is saved
if ((aFlags & nsIPrintSettings::kInitSavePrinterName)
&& aPrinterName.IsEmpty()) {
@ -1511,7 +1490,6 @@ Tester::Tester()
ps->SetPrintReversed(true);
ps->SetPrintInColor(true);
ps->SetOrientation(nsIPrintSettings::kLandscapeOrientation);
ps->SetPrintCommand(NS_ConvertUTF8toUTF16("Command").get());
ps->SetNumCopies(2);
ps->SetPrinterName(NS_ConvertUTF8toUTF16("Printer Name").get());
ps->SetPrintToFile(true);
@ -1543,7 +1521,6 @@ Tester::Tester()
{kPrintResolutionName, nsIPrintSettings::kInitSaveResolutionName},
{kPrintDownloadFonts, nsIPrintSettings::kInitSaveDownloadFonts},
{kPrintOrientation, nsIPrintSettings::kInitSaveOrientation},
{kPrintCommand, nsIPrintSettings::kInitSavePrintCommand},
{kPrinterName, nsIPrintSettings::kInitSavePrinterName},
{kPrintToFile, nsIPrintSettings::kInitSavePrintToFile},
{kPrintToFileName, nsIPrintSettings::kInitSaveToFileName},

View File

@ -293,23 +293,6 @@ NS_IMETHODIMP nsPrintSettings::SetNumCopies(int32_t aNumCopies)
return NS_OK;
}
/* attribute wstring printCommand; */
NS_IMETHODIMP nsPrintSettings::GetPrintCommand(char16_t * *aPrintCommand)
{
//NS_ENSURE_ARG_POINTER(aPrintCommand);
*aPrintCommand = ToNewUnicode(mPrintCommand);
return NS_OK;
}
NS_IMETHODIMP nsPrintSettings::SetPrintCommand(const char16_t * aPrintCommand)
{
if (aPrintCommand) {
mPrintCommand = aPrintCommand;
} else {
mPrintCommand.SetLength(0);
}
return NS_OK;
}
/* attribute boolean printToFile; */
NS_IMETHODIMP nsPrintSettings::GetPrintToFile(bool *aPrintToFile)
{
@ -1183,7 +1166,6 @@ nsPrintSettings& nsPrintSettings::operator=(const nsPrintSettings& rhs)
mPrintReversed = rhs.mPrintReversed;
mPrintInColor = rhs.mPrintInColor;
mOrientation = rhs.mOrientation;
mPrintCommand = rhs.mPrintCommand;
mNumCopies = rhs.mNumCopies;
mPrinter = rhs.mPrinter;
mPrintToFile = rhs.mPrintToFile;

View File

@ -96,7 +96,6 @@ protected:
int32_t mResolution;
int32_t mDuplex;
bool mDownloadFonts;
nsString mPrintCommand;
int32_t mNumCopies;
nsXPIDLString mPrinter;
bool mPrintToFile;