PRInt32 iVal = kPaperSizeInches; prefs->GetIntPref(kPrintPaperSizeUnit,  &iVal); mPaperSizeUnit = PRInt16(iVal); iVal = kPaperSizeDefined; prefs->GetIntPref(kPrintPaperSizeType,  &iVal); mPaperSizeType = PRInt16(iVal); iVal = 0; prefs->GetIntPref(kPrintPaperData,  &iVal); mPaperData = PRInt16(iVal); ReadPrefDouble(prefs, kPrintPaperWidth,  mPaperWidth); ReadPrefDouble(prefs, kPrintPaperHeight,  mPaperHeight);
prefs->GetIntPref(kPrintPaperSize,   &mPaperSize);
nsPrintOptions::ReadPrefs(){  nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID);  if (prefs) {    ReadInchesToTwipsPref(prefs, kMarginTop,    mMargin.top);    ReadInchesToTwipsPref(prefs, kMarginLeft,   mMargin.left);    ReadInchesToTwipsPref(prefs, kMarginBottom, mMargin.bottom);    ReadInchesToTwipsPref(prefs, kMarginRight,  mMargin.right);    ReadBitFieldPref(prefs, kPrintEvenPages,  kOptPrintEvenPages);    ReadBitFieldPref(prefs, kPrintOddPages,   kOptPrintOddPages);    ReadPrefString(prefs, kPrintHeaderStr1, mHeaderStrs[0]);    ReadPrefString(prefs, kPrintHeaderStr2, mHeaderStrs[1]);    ReadPrefString(prefs, kPrintHeaderStr3, mHeaderStrs[2]);    ReadPrefString(prefs, kPrintFooterStr1, mFooterStrs[0]);    ReadPrefString(prefs, kPrintFooterStr2, mFooterStrs[1]);    ReadPrefString(prefs, kPrintFooterStr3, mFooterStrs[2]);    // Read Additional XP Prefs    prefs->GetIntPref(kPrintPaperSize,   &mPaperSize); // this has been deprecated    prefs->GetBoolPref(kPrintReversed,   &mPrintReversed);    prefs->GetBoolPref(kPrintColor,      &mPrintInColor);    PRInt32 iVal = kPaperSizeInches;    prefs->GetIntPref(kPrintPaperSizeUnit,  &iVal);    mPaperSizeUnit = PRInt16(iVal);    iVal = kPaperSizeDefined;    prefs->GetIntPref(kPrintPaperSizeType,  &iVal);    mPaperSizeType = PRInt16(iVal);    iVal = 0;    prefs->GetIntPref(kPrintPaperData,  &iVal);    mPaperData = PRInt16(iVal);    ReadPrefDouble(prefs, kPrintPaperWidth,  mPaperWidth);    ReadPrefDouble(prefs, kPrintPaperHeight,  mPaperHeight);    prefs->GetIntPref(kPrintOrientation, &mOrientation);    ReadPrefString(prefs, kPrintCommand, mPrintCommand);    ReadPrefString(prefs, kPrinter, mPrinter);    prefs->GetBoolPref(kPrintFile,       &mPrintToFile);    ReadPrefString(prefs, kPrintToFile,  mToFileName);    prefs->GetIntPref(kPrintPageDelay,   &mPrintPageDelay);    return NS_OK;  }  return NS_ERROR_FAILURE;}