Created attachment 500694
don't use PS prefs in gtk

The attached patch fixes this problem for me.

In widget/src/xpwidgets/nsPrintOptionsImpl.cpp the page size is read and
written to the prefs of the form:

print.printer_NAME.print_paper_name
print.printer_NAME.print_paper_size_width
print.printer_NAME.print_paper_size_height
print.printer_NAME.print_paper_size_type
print.printer_NAME.print_paper_size_unit

where NAME is the printer name.

In widget/src/gtk2/nsDeviceContextSpecG.cpp the page size is read but
not written from the following prefs:

print.postscript.printer_NAME.paper_size
print.printer_NAME.paper_size
print.postscript.paper_size
print.paper_size

The problem is the prefs read in nsDeviceContextSpecG.cpp are not the
same as the prefs written in nsPrintOptionsImpl.cpp. If these prefs do
not exist there is no problem as the prefs read in
nsPrintOptionsImpl.cpp are used. However I have found that in a newly
created profile the pref "print.postscript.paper_size = letter" always
exists. This will always be read and override the saved paper size. As
it is not written, the "letter" default will not go away.

The attached patch changes the module name used when reading prefs in
nsDeviceContextSpecG.cpp from "postscript" to null so the
"print.postscript.paper_size" pref is never read. I am assuming the
"postscript" module name is leftover from before gtkprint was used.

With the patch applied and using a newly created profile the default
paper size will be the gtk_paper_size_get_default() paper size which is
based on the current locale. After printing for the first time the
selected page size is correctly saved and restored the next time the
print dialog is opened.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is a direct subscriber.
https://bugs.launchpad.net/bugs/10910

Title:
  Default page size for printing is letter

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to