The problem here is the "edge" prefs are now preficed with the printer name,

and the nsPrintOptions know how to convert the printer name, so we need to add
a helper method to nsIPrintOptions.idl so the nsSimplePageSeq can get the properly named value.
Bug 140669 r=dcone sr=attinasi
This commit is contained in:
rods%netscape.com 2006-02-07 01:14:00 +00:00
parent 7921394599
commit d689758e0c
2 changed files with 24 additions and 0 deletions

View File

@ -78,6 +78,11 @@ interface nsIPrintOptions : nsISupports
*/
nsISimpleEnumerator availablePrinters ();
/**
* Get a prefixed integer pref
*/
PRInt32 getPrinterPrefInt(in nsIPrintSettings aPrintSettings, in wstring aPrefName);
/**
* display Printer Job Properties dialog
*/

View File

@ -969,6 +969,25 @@ static void GetAdjustedPrinterName(nsIPrintSettings* aPS, PRBool aUsePNP, nsStri
}
}
/* PRInt32 getPrinterPrefInt (in nsIPrintSettings aPrintSettings, in wstring aPrefName); */
NS_IMETHODIMP nsPrintOptions::GetPrinterPrefInt(nsIPrintSettings *aPrintSettings, const PRUnichar *aPrefName, PRInt32 *_retval)
{
nsString prtName;
// Get the Printer Name from the PtinerSettings
// to use as a prefix for Pref Names
GetAdjustedPrinterName(aPrintSettings, PR_TRUE, prtName);
nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID);
if (prefs) {
PRInt32 iVal;
if (NS_SUCCEEDED(prefs->GetIntPref(GetPrefName(NS_LossyConvertUCS2toASCII(aPrefName).get(), prtName), &iVal))) {
*_retval = iVal;
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
/** ---------------------------------------------------
* See documentation in nsPrintOptionsImpl.h
* @update 1/12/01 rods