Makes sure the prefs aren't set if the pref values don't exist

Bug 124139 r=rods sr=attinasi
This commit is contained in:
rods%netscape.com 2002-02-19 11:59:27 +00:00
Родитель f9413bd619
Коммит c852f59012
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -496,12 +496,16 @@ nsPrintOptions::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS)
ReadInchesToTwipsPref(prefs, kMarginRight, margin.right);
aPS->SetMarginInTwips(margin);
// Note: Following prefs are not required to be in a pref
// each has a proper default defined here.
// The following two are special in that they set a bit field
// which is initialized in the constructor.
PRBool b;
prefs->GetBoolPref(kPrintEvenPages, &b);
aPS->SetPrintOptions(kOptPrintEvenPages, b);
if (NS_SUCCEEDED(prefs->GetBoolPref(kPrintEvenPages, &b)))
aPS->SetPrintOptions(kOptPrintEvenPages, b);
prefs->GetBoolPref(kPrintOddPages, &b);
aPS->SetPrintOptions(kOptPrintOddPages, b);
if (NS_SUCCEEDED(prefs->GetBoolPref(kPrintOddPages, &b)))
aPS->SetPrintOptions(kOptPrintOddPages, b);
nsString str;
str.SetLength(0);