зеркало из https://github.com/mozilla/pjs.git
Back out patch for bug 315687, due to reftest failures on win32.
This commit is contained in:
Родитель
45dd411a17
Коммит
72e34604e6
|
@ -60,6 +60,7 @@ nsPrintSettings::nsPrintSettings() :
|
|||
mPrintOptions(0L),
|
||||
mPrintReversed(PR_FALSE),
|
||||
mPrintInColor(PR_TRUE),
|
||||
mPaperSize(kLetterPaperSize),
|
||||
mOrientation(kPortraitOrientation),
|
||||
mPrintToFile(PR_FALSE),
|
||||
mPrintFrameType(kFramesAsIs),
|
||||
|
@ -143,6 +144,19 @@ NS_IMETHODIMP nsPrintSettings::SetPrintInColor(PRBool aPrintInColor)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short paperSize; */
|
||||
NS_IMETHODIMP nsPrintSettings::GetPaperSize(PRInt32 *aPaperSize)
|
||||
{
|
||||
//NS_ENSURE_ARG_POINTER(aPaperSize);
|
||||
*aPaperSize = mPaperSize;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsPrintSettings::SetPaperSize(PRInt32 aPaperSize)
|
||||
{
|
||||
mPaperSize = aPaperSize;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short orientation; */
|
||||
NS_IMETHODIMP nsPrintSettings::GetOrientation(PRInt32 *aOrientation)
|
||||
{
|
||||
|
|
|
@ -92,6 +92,7 @@ protected:
|
|||
|
||||
PRBool mPrintReversed;
|
||||
PRBool mPrintInColor; // a false means grayscale
|
||||
PRInt32 mPaperSize; // see page size consts
|
||||
PRInt32 mOrientation; // see orientation consts
|
||||
nsString mPrintCommand;
|
||||
PRBool mPrintToFile;
|
||||
|
|
|
@ -406,7 +406,11 @@ function onAccept()
|
|||
saveToPrefs = gPrefs.getBoolPref("print.save_print_settings");
|
||||
|
||||
if (saveToPrefs && printService != null) {
|
||||
var flags = gPrintSetInterface.kInitSavePaperSize |
|
||||
var flags = gPrintSetInterface.kInitSavePaperSizeType |
|
||||
gPrintSetInterface.kInitSavePaperSizeUnit |
|
||||
gPrintSetInterface.kInitSavePaperWidth |
|
||||
gPrintSetInterface.kInitSavePaperHeight |
|
||||
gPrintSetInterface.kInitSavePaperName |
|
||||
gPrintSetInterface.kInitSaveColorSpace |
|
||||
gPrintSetInterface.kInitSaveInColor |
|
||||
gPrintSetInterface.kInitSaveResolutionName |
|
||||
|
|
|
@ -201,6 +201,7 @@ function createPaperArrayFromDefaults()
|
|||
obj.width = paperWidths[i];
|
||||
obj.height = paperHeights[i];
|
||||
obj.inches = paperInches[i];
|
||||
obj.paperSize = paperEnums[i]; // deprecated
|
||||
|
||||
/* Calculate the width/height in millimeters */
|
||||
if (paperInches[i]) {
|
||||
|
@ -237,6 +238,7 @@ function createPaperArrayFromPrinterFeatures()
|
|||
obj.width_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".width_mm");
|
||||
obj.height_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".height_mm");
|
||||
obj.inches = gPrefs.getBoolPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".is_inch");
|
||||
obj.paperSize = 666; // deprecated
|
||||
|
||||
/* Calculate the width/height in paper's native units (either inches or millimeters) */
|
||||
if (obj.inches) {
|
||||
|
@ -907,6 +909,7 @@ function onAccept()
|
|||
print_resolution_name = gResolutionArray[resolutionSelectedInx].name;
|
||||
print_colorspace = gColorspaceArray[colorspaceSelectedInx].name;
|
||||
|
||||
gPrintSettings.paperSize = gPaperArray[paperSelectedInx].paperSize; // deprecated
|
||||
gPrintSettings.paperSizeType = print_paper_type;
|
||||
gPrintSettings.paperSizeUnit = print_paper_unit;
|
||||
gPrintSettings.paperWidth = print_paper_width;
|
||||
|
@ -941,6 +944,7 @@ function onAccept()
|
|||
|
||||
if (doDebug) {
|
||||
dump("onAccept******************************\n");
|
||||
dump("paperSize "+gPrintSettings.paperSize+" (deprecated)\n");
|
||||
dump("paperSizeType "+print_paper_type+" (should be 1)\n");
|
||||
dump("paperSizeUnit "+print_paper_unit+"\n");
|
||||
dump("paperWidth "+print_paper_width+"\n");
|
||||
|
|
|
@ -58,7 +58,7 @@ interface nsIPrintSession;
|
|||
*
|
||||
* @status UNDER_REVIEW
|
||||
*/
|
||||
[scriptable, uuid(b1b5e3cc-a52c-4325-a7f6-e1ac6fac19a5)]
|
||||
[scriptable, uuid(f1094df6-ce0e-42c9-9847-2f663172c38d)]
|
||||
|
||||
interface nsIPrintSettings : nsISupports
|
||||
{
|
||||
|
@ -75,12 +75,12 @@ interface nsIPrintSettings : nsISupports
|
|||
const unsigned long kInitSaveBGColors = 0x00000080;
|
||||
const unsigned long kInitSaveBGImages = 0x00000100;
|
||||
const unsigned long kInitSavePaperSize = 0x00000200;
|
||||
/* Flag 0x00000400 is unused */
|
||||
/* Flag 0x00000800 is unused */
|
||||
/* Flag 0x00001000 is unused */
|
||||
const unsigned long kInitSavePaperName = 0x00000400;
|
||||
const unsigned long kInitSavePaperSizeUnit = 0x00000800;
|
||||
const unsigned long kInitSavePaperSizeType = 0x00001000;
|
||||
const unsigned long kInitSavePaperData = 0x00002000;
|
||||
/* Flag 0x00004000 is unused */
|
||||
/* Flag 0x00008000 is unused */
|
||||
const unsigned long kInitSavePaperWidth = 0x00004000;
|
||||
const unsigned long kInitSavePaperHeight = 0x00008000;
|
||||
|
||||
const unsigned long kInitSaveReversed = 0x00010000;
|
||||
const unsigned long kInitSaveInColor = 0x00020000;
|
||||
|
@ -249,6 +249,7 @@ interface nsIPrintSettings : nsISupports
|
|||
|
||||
attribute boolean printReversed;
|
||||
attribute boolean printInColor; /* a false means grayscale */
|
||||
attribute long paperSize; /* see page size consts */
|
||||
attribute long orientation; /* see orientation consts */
|
||||
attribute wstring printCommand;
|
||||
attribute long numCopies;
|
||||
|
|
|
@ -243,6 +243,7 @@ Tester::Tester()
|
|||
ps->SetPaperSizeUnit(nsIPrintSettings::kPaperSizeMillimeters);
|
||||
ps->SetPrintReversed(PR_TRUE);
|
||||
ps->SetPrintInColor(PR_TRUE);
|
||||
ps->SetPaperSize(5);
|
||||
ps->SetOrientation(nsIPrintSettings::kLandscapeOrientation);
|
||||
ps->SetPrintCommand(NS_ConvertUTF8toUTF16("Command").get());
|
||||
ps->SetNumCopies(2);
|
||||
|
|
|
@ -86,6 +86,8 @@ static const char kPrintFooterStrCenter[] = "print_footercenter";
|
|||
static const char kPrintFooterStrRight[] = "print_footerright";
|
||||
|
||||
// Additional Prefs
|
||||
static const char kPrintPaperSize[] = "print_paper_size"; // deprecated
|
||||
|
||||
static const char kPrintReversed[] = "print_reversed";
|
||||
static const char kPrintInColor[] = "print_in_color";
|
||||
static const char kPrintPaperName[] = "print_paper_name";
|
||||
|
@ -300,40 +302,6 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
) \
|
||||
)
|
||||
|
||||
// Paper size prefs are read as a group
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSize) {
|
||||
PRInt32 sizeUnit, sizeType;
|
||||
double width, height;
|
||||
|
||||
PRBool success = GETINTPREF(kPrintPaperSizeUnit, &sizeUnit)
|
||||
&& GETINTPREF(kPrintPaperSizeType, &sizeType)
|
||||
&& GETDBLPREF(kPrintPaperWidth, width)
|
||||
&& GETDBLPREF(kPrintPaperHeight, height)
|
||||
&& GETSTRPREF(kPrintPaperName, str);
|
||||
|
||||
// Bug 315687: Sanity check paper size to avoid paper size values in
|
||||
// mm when the size unit flag is inches. The value 100 is arbitrary
|
||||
// and can be changed.
|
||||
if (success) {
|
||||
success = (sizeUnit == nsIPrintSettings::kPaperSizeInches)
|
||||
&& (width < 100.0)
|
||||
&& (height < 100.0);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
aPS->SetPaperSizeUnit(sizeUnit);
|
||||
DUMP_INT(kReadStr, kPrintPaperSizeUnit, sizeUnit);
|
||||
aPS->SetPaperSizeType(sizeType);
|
||||
DUMP_INT(kReadStr, kPrintPaperSizeType, sizeType);
|
||||
aPS->SetPaperWidth(width);
|
||||
DUMP_DBL(kReadStr, kPrintPaperWidth, width);
|
||||
aPS->SetPaperHeight(height);
|
||||
DUMP_DBL(kReadStr, kPrintPaperHeight, height);
|
||||
aPS->SetPaperName(str.get());
|
||||
DUMP_STR(kReadStr, kPrintPaperName, str.get());
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSaveOddEvenPages) {
|
||||
if (GETBOOLPREF(kPrintEvenPages, &b)) {
|
||||
aPS->SetPrintOptions(nsIPrintSettings::kPrintEvenPages, b);
|
||||
|
@ -404,6 +372,13 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSize) {
|
||||
if (GETINTPREF(kPrintPaperSize, &iVal)) { // this has been deprecated
|
||||
aPS->SetPaperSize(iVal);
|
||||
DUMP_INT(kReadStr, kPrintPaperSize, iVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSaveReversed) {
|
||||
if (GETBOOLPREF(kPrintReversed, &b)) {
|
||||
aPS->SetPrintReversed(b);
|
||||
|
@ -418,6 +393,13 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperName) {
|
||||
if (GETSTRPREF(kPrintPaperName, str)) {
|
||||
aPS->SetPaperName(str.get());
|
||||
DUMP_STR(kReadStr, kPrintPaperName, str.get());
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePlexName) {
|
||||
if (GETSTRPREF(kPrintPlexName, str)) {
|
||||
aPS->SetPlexName(str.get());
|
||||
|
@ -425,6 +407,20 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSizeUnit) {
|
||||
if (GETINTPREF(kPrintPaperSizeUnit, &iVal)) {
|
||||
aPS->SetPaperSizeUnit(iVal);
|
||||
DUMP_INT(kReadStr, kPrintPaperSizeUnit, iVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSizeType) {
|
||||
if (GETINTPREF(kPrintPaperSizeType, &iVal)) {
|
||||
aPS->SetPaperSizeType(iVal);
|
||||
DUMP_INT(kReadStr, kPrintPaperSizeType, iVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperData) {
|
||||
if (GETINTPREF(kPrintPaperData, &iVal)) {
|
||||
aPS->SetPaperData(iVal);
|
||||
|
@ -432,6 +428,20 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperWidth) {
|
||||
if (GETDBLPREF(kPrintPaperWidth, dbl)) {
|
||||
aPS->SetPaperWidth(dbl);
|
||||
DUMP_DBL(kReadStr, kPrintPaperWidth, dbl);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperHeight) {
|
||||
if (GETDBLPREF(kPrintPaperHeight, dbl)) {
|
||||
aPS->SetPaperHeight(dbl);
|
||||
DUMP_DBL(kReadStr, kPrintPaperHeight, dbl);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSaveColorspace) {
|
||||
if (GETSTRPREF(kPrintColorspace, str)) {
|
||||
aPS->SetColorspace(str.get());
|
||||
|
@ -537,34 +547,6 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
// Paper size prefs are saved as a group
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSize) {
|
||||
PRInt16 sizeUnit, sizeType;
|
||||
double width, height;
|
||||
PRUnichar *name;
|
||||
|
||||
if (
|
||||
NS_SUCCEEDED(aPS->GetPaperSizeUnit(&sizeUnit)) &&
|
||||
NS_SUCCEEDED(aPS->GetPaperSizeType(&sizeType)) &&
|
||||
NS_SUCCEEDED(aPS->GetPaperWidth(&width)) &&
|
||||
NS_SUCCEEDED(aPS->GetPaperHeight(&height)) &&
|
||||
NS_SUCCEEDED(aPS->GetPaperName(&name))
|
||||
) {
|
||||
DUMP_INT(kWriteStr, kPrintPaperSizeUnit, sizeUnit);
|
||||
mPrefBranch->SetIntPref(GetPrefName(kPrintPaperSizeUnit, aPrinterName),
|
||||
PRInt32(sizeUnit));
|
||||
DUMP_INT(kWriteStr, kPrintPaperSizeType, sizeType);
|
||||
mPrefBranch->SetIntPref(GetPrefName(kPrintPaperSizeType, aPrinterName),
|
||||
PRInt32(sizeType));
|
||||
DUMP_DBL(kWriteStr, kPrintPaperWidth, width);
|
||||
WritePrefDouble(GetPrefName(kPrintPaperWidth, aPrinterName), width);
|
||||
DUMP_DBL(kWriteStr, kPrintPaperHeight, height);
|
||||
WritePrefDouble(GetPrefName(kPrintPaperHeight, aPrinterName), height);
|
||||
DUMP_STR(kWriteStr, kPrintPaperName, name);
|
||||
WritePrefString(name, GetPrefName(kPrintPaperName, aPrinterName));
|
||||
}
|
||||
}
|
||||
|
||||
PRBool b;
|
||||
PRUnichar* uStr;
|
||||
PRInt32 iVal;
|
||||
|
@ -645,6 +627,14 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSize) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperSize(&iVal))) {
|
||||
DUMP_INT(kWriteStr, kPrintPaperSize, iVal);
|
||||
mPrefBranch->SetIntPref(GetPrefName(kPrintPaperSize, aPrinterName), iVal);
|
||||
// this has been deprecated
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSaveReversed) {
|
||||
if (NS_SUCCEEDED(aPS->GetPrintReversed(&b))) {
|
||||
DUMP_BOOL(kWriteStr, kPrintReversed, b);
|
||||
|
@ -659,6 +649,13 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperName) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperName(&uStr))) {
|
||||
DUMP_STR(kWriteStr, kPrintPaperName, uStr);
|
||||
WritePrefString(uStr, GetPrefName(kPrintPaperName, aPrinterName));
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePlexName) {
|
||||
if (NS_SUCCEEDED(aPS->GetPlexName(&uStr))) {
|
||||
DUMP_STR(kWriteStr, kPrintPlexName, uStr);
|
||||
|
@ -666,6 +663,22 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSizeUnit) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperSizeUnit(&iVal16))) {
|
||||
DUMP_INT(kWriteStr, kPrintPaperSizeUnit, iVal16);
|
||||
mPrefBranch->SetIntPref(GetPrefName(kPrintPaperSizeUnit, aPrinterName),
|
||||
PRInt32(iVal16));
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperSizeType) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperSizeType(&iVal16))) {
|
||||
DUMP_INT(kWriteStr, kPrintPaperSizeType, iVal16);
|
||||
mPrefBranch->SetIntPref(GetPrefName(kPrintPaperSizeType, aPrinterName),
|
||||
PRInt32(iVal16));
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperData) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperData(&iVal16))) {
|
||||
DUMP_INT(kWriteStr, kPrintPaperData, iVal16);
|
||||
|
@ -674,6 +687,20 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
|
|||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperWidth) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperWidth(&dbl))) {
|
||||
DUMP_DBL(kWriteStr, kPrintPaperWidth, dbl);
|
||||
WritePrefDouble(GetPrefName(kPrintPaperWidth, aPrinterName), dbl);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSavePaperHeight) {
|
||||
if (NS_SUCCEEDED(aPS->GetPaperHeight(&dbl))) {
|
||||
DUMP_DBL(kWriteStr, kPrintPaperHeight, dbl);
|
||||
WritePrefDouble(GetPrefName(kPrintPaperHeight, aPrinterName), dbl);
|
||||
}
|
||||
}
|
||||
|
||||
if (aFlags & nsIPrintSettings::kInitSaveColorspace) {
|
||||
if (NS_SUCCEEDED(aPS->GetColorspace(&uStr))) {
|
||||
DUMP_STR(kWriteStr, kPrintColorspace, uStr);
|
||||
|
@ -1217,6 +1244,7 @@ Tester::Tester()
|
|||
ps->SetPaperSizeUnit(nsIPrintSettings::kPaperSizeMillimeters);
|
||||
ps->SetPrintReversed(PR_TRUE);
|
||||
ps->SetPrintInColor(PR_TRUE);
|
||||
ps->SetPaperSize(5);
|
||||
ps->SetOrientation(nsIPrintSettings::kLandscapeOrientation);
|
||||
ps->SetPrintCommand(NS_ConvertUTF8toUTF16("Command").get());
|
||||
ps->SetNumCopies(2);
|
||||
|
@ -1242,8 +1270,13 @@ Tester::Tester()
|
|||
{kPrintBGImages, nsIPrintSettings::kInitSaveBGImages},
|
||||
{kPrintShrinkToFit, nsIPrintSettings::kInitSaveShrinkToFit},
|
||||
{kPrintPaperSize, nsIPrintSettings::kInitSavePaperSize},
|
||||
{kPrintPaperName, nsIPrintSettings::kInitSavePaperName},
|
||||
{kPrintPlexName, nsIPrintSettings::kInitSavePlexName},
|
||||
{kPrintPaperSizeUnit, nsIPrintSettings::kInitSavePaperSizeUnit},
|
||||
{kPrintPaperSizeType, nsIPrintSettings::kInitSavePaperSizeType},
|
||||
{kPrintPaperData, nsIPrintSettings::kInitSavePaperData},
|
||||
{kPrintPaperWidth, nsIPrintSettings::kInitSavePaperWidth},
|
||||
{kPrintPaperHeight, nsIPrintSettings::kInitSavePaperHeight},
|
||||
{kPrintReversed, nsIPrintSettings::kInitSaveReversed},
|
||||
{kPrintInColor, nsIPrintSettings::kInitSaveInColor},
|
||||
{kPrintColorspace, nsIPrintSettings::kInitSaveColorspace},
|
||||
|
|
|
@ -191,6 +191,19 @@ NS_IMETHODIMP nsPrintSettings::SetPrintInColor(PRBool aPrintInColor)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short paperSize; */
|
||||
NS_IMETHODIMP nsPrintSettings::GetPaperSize(PRInt32 *aPaperSize)
|
||||
{
|
||||
//NS_ENSURE_ARG_POINTER(aPaperSize);
|
||||
*aPaperSize = mPaperSize;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP nsPrintSettings::SetPaperSize(PRInt32 aPaperSize)
|
||||
{
|
||||
mPaperSize = aPaperSize;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* attribute short orientation; */
|
||||
NS_IMETHODIMP nsPrintSettings::GetOrientation(PRInt32 *aOrientation)
|
||||
{
|
||||
|
@ -986,6 +999,7 @@ nsPrintSettings& nsPrintSettings::operator=(const nsPrintSettings& rhs)
|
|||
mPaperSizeUnit = rhs.mPaperSizeUnit;
|
||||
mPrintReversed = rhs.mPrintReversed;
|
||||
mPrintInColor = rhs.mPrintInColor;
|
||||
mPaperSize = rhs.mPaperSize;
|
||||
mOrientation = rhs.mOrientation;
|
||||
mPrintCommand = rhs.mPrintCommand;
|
||||
mNumCopies = rhs.mNumCopies;
|
||||
|
|
|
@ -118,6 +118,7 @@ protected:
|
|||
|
||||
PRBool mPrintReversed;
|
||||
PRBool mPrintInColor; // a false means grayscale
|
||||
PRInt32 mPaperSize; // see page size consts
|
||||
PRInt32 mOrientation; // see orientation consts
|
||||
nsString mColorspace;
|
||||
nsString mResolutionName;
|
||||
|
|
|
@ -405,7 +405,11 @@ function onAccept()
|
|||
saveToPrefs = gPrefs.getBoolPref("print.save_print_settings");
|
||||
|
||||
if (saveToPrefs && printService != null) {
|
||||
var flags = gPrintSetInterface.kInitSavePaperSize |
|
||||
var flags = gPrintSetInterface.kInitSavePaperSizeType |
|
||||
gPrintSetInterface.kInitSavePaperSizeUnit |
|
||||
gPrintSetInterface.kInitSavePaperWidth |
|
||||
gPrintSetInterface.kInitSavePaperHeight |
|
||||
gPrintSetInterface.kInitSavePaperName |
|
||||
gPrintSetInterface.kInitSaveColorSpace |
|
||||
gPrintSetInterface.kInitSaveInColor |
|
||||
gPrintSetInterface.kInitSaveResolutionName |
|
||||
|
|
|
@ -200,6 +200,7 @@ function createPaperArrayFromDefaults()
|
|||
obj.width = paperWidths[i];
|
||||
obj.height = paperHeights[i];
|
||||
obj.inches = paperInches[i];
|
||||
obj.paperSize = paperEnums[i]; // deprecated
|
||||
|
||||
/* Calculate the width/height in millimeters */
|
||||
if (paperInches[i]) {
|
||||
|
@ -236,6 +237,7 @@ function createPaperArrayFromPrinterFeatures()
|
|||
obj.width_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".width_mm");
|
||||
obj.height_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".height_mm");
|
||||
obj.inches = gPrefs.getBoolPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".is_inch");
|
||||
obj.paperSize = 666; // deprecated
|
||||
|
||||
/* Calculate the width/height in paper's native units (either inches or millimeters) */
|
||||
if (obj.inches) {
|
||||
|
@ -906,6 +908,7 @@ function onAccept()
|
|||
print_resolution_name = gResolutionArray[resolutionSelectedInx].name;
|
||||
print_colorspace = gColorspaceArray[colorspaceSelectedInx].name;
|
||||
|
||||
gPrintSettings.paperSize = gPaperArray[paperSelectedInx].paperSize; // deprecated
|
||||
gPrintSettings.paperSizeType = print_paper_type;
|
||||
gPrintSettings.paperSizeUnit = print_paper_unit;
|
||||
gPrintSettings.paperWidth = print_paper_width;
|
||||
|
@ -940,6 +943,7 @@ function onAccept()
|
|||
|
||||
if (doDebug) {
|
||||
dump("onAccept******************************\n");
|
||||
dump("paperSize "+gPrintSettings.paperSize+" (deprecated)\n");
|
||||
dump("paperSizeType "+print_paper_type+" (should be 1)\n");
|
||||
dump("paperSizeUnit "+print_paper_unit+"\n");
|
||||
dump("paperWidth "+print_paper_width+"\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче