Bug 1189846 Part 4: Remove getPrinterPrefInt from nsIPrintOptions. r=jimm

MozReview-Commit-ID: 4pJAfte1OUs
This commit is contained in:
Bob Owen 2016-05-16 10:40:54 +01:00
parent 757e385a15
commit f5d114afd4
2 changed files with 2 additions and 31 deletions

View File

@ -24,12 +24,6 @@ interface nsIPrintOptions : nsISupports
*/
void ShowPrintSetupDialog(in nsIPrintSettings aThePrintSettings);
/**
* Get a prefixed integer pref
*/
int32_t getPrinterPrefInt(in nsIPrintSettings aPrintSettings, in wstring
aPrefName);
/**
* display Printer Job Properties dialog
*/

View File

@ -1099,6 +1099,7 @@ nsPrintOptions::InitPrintSettingsFromPrinter(const char16_t *aPrinterName,
return rv;
}
#ifndef MOZ_X11
/** ---------------------------------------------------
* Helper function - Returns either the name or sets the length to zero
*/
@ -1138,31 +1139,7 @@ GetAdjustedPrinterName(nsIPrintSettings* aPS, bool aUsePNP,
}
return NS_OK;
}
NS_IMETHODIMP
nsPrintOptions::GetPrinterPrefInt(nsIPrintSettings *aPrintSettings,
const char16_t *aPrefName, int32_t *_retval)
{
NS_ENSURE_ARG_POINTER(aPrintSettings);
NS_ENSURE_ARG_POINTER(aPrefName);
nsAutoString prtName;
// Get the Printer Name from the PrintSettings
// to use as a prefix for Pref Names
GetAdjustedPrinterName(aPrintSettings, true, prtName);
const char* prefName =
GetPrefName(NS_LossyConvertUTF16toASCII(aPrefName).get(), prtName);
NS_ENSURE_TRUE(prefName, NS_ERROR_FAILURE);
int32_t iVal;
nsresult rv = Preferences::GetInt(prefName, &iVal);
NS_ENSURE_SUCCESS(rv, rv);
*_retval = iVal;
return rv;
}
#endif
NS_IMETHODIMP
nsPrintOptions::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS,