Bug 1189846 Part 4: Remove getPrinterPrefInt from nsIPrintOptions. r=jimm
authorBob Owen <bobowencode@gmail.com>
Mon, 16 May 2016 10:40:54 +0100
changeset 297520 7a7eb2ca6358b17af9ee36a15840e158db2f8e57
parent 297519 e673d44f5aa6f68a2b65382f0bfcbfc9a489e04a
child 297521 7ad6e2df19e42db3999255db29237762c19dbc19
push id30262
push userkwierso@gmail.com
push dateMon, 16 May 2016 21:19:59 +0000
treeherdermozilla-central@a884b96685aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1189846
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189846 Part 4: Remove getPrinterPrefInt from nsIPrintOptions. r=jimm MozReview-Commit-ID: 4pJAfte1OUs
widget/nsIPrintOptions.idl
widget/nsPrintOptionsImpl.cpp
--- a/widget/nsIPrintOptions.idl
+++ b/widget/nsIPrintOptions.idl
@@ -20,22 +20,16 @@ interface nsIStringEnumerator;
 interface nsIPrintOptions : nsISupports
 {
   /**
    * Show Native Print Options dialog, this may not be supported on all platforms
    */
   void ShowPrintSetupDialog(in nsIPrintSettings aThePrintSettings);
 
   /**
-   * Get a prefixed integer pref 
-   */
-  int32_t getPrinterPrefInt(in nsIPrintSettings aPrintSettings, in wstring
-                            aPrefName);
-
-  /**
    * display Printer Job Properties dialog
    */
   void displayJobProperties (in wstring aPrinter, in nsIPrintSettings
                              aPrintSettings, out boolean aDisplayed);
 
   /**
    * Native data constants
    */
--- a/widget/nsPrintOptionsImpl.cpp
+++ b/widget/nsPrintOptionsImpl.cpp
@@ -1094,16 +1094,17 @@ nsPrintOptions::InitPrintSettingsFromPri
 
   rv = prtEnum->InitPrintSettingsFromPrinter(aPrinterName, aPrintSettings);
   NS_ENSURE_SUCCESS(rv, rv);
 
   aPrintSettings->SetIsInitializedFromPrinter(true);
   return rv;
 }
 
+#ifndef MOZ_X11
 /** ---------------------------------------------------
  *  Helper function - Returns either the name or sets the length to zero
  */
 static nsresult 
 GetAdjustedPrinterName(nsIPrintSettings* aPS, bool aUsePNP,
                        nsAString& aPrinterName)
 {
   NS_ENSURE_ARG_POINTER(aPS);
@@ -1133,41 +1134,17 @@ GetAdjustedPrinterName(nsIPrintSettings*
     int32_t i = 0;
     while ((i = aPrinterName.FindChar(uChar, i)) != kNotFound) {
       aPrinterName.Replace(i, 1, replSubstr);
       i++;
     }
   }
   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,
                                            bool aUsePNP, uint32_t aFlags)
 {
   NS_ENSURE_ARG_POINTER(aPS);
 
   bool isInitialized;