mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
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:
parent
7921394599
commit
d689758e0c
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user