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