GNOME Bugzilla – Bug 639186
gtk_paper_size_new fails to recognize valid name
Last modified: 2011-01-13 03:31:09 UTC
gtk_paper_size_new is advertised to create "a new GtkPaperSize object by parsing a PWG 5101.1-2002 paper name." If it is passed the name "iso_a4_210x297mm" it does not recognize this correctly as A4: (gdb) p *gtk_paper $3 = {info = 0x0, name = 0x85dd090 "iso_a4", display_name = 0x84d08d0 "iso_a4", ppd_name = 0x0, width = 210, height = 297, is_custom = 0} Note the display_name! Strangely enough if we call it with "iso_a4" it returns: (gdb) p *gtk_paper $2 = {info = 0xb2af5c, name = 0x0, display_name = 0x0, ppd_name = 0x0, width = 210, height = 297, is_custom = 0} but apparently knows when this is used that it is really A4.
See also bug 493880.
This bug differs from bug 493880 in that both "iso_a4_210x297mm" and "iso_a4" are considered valid (although only the former is truely a PWG 5101.1-2002 paper name). The problem is here that the display name should be A4 in both cases. I think that gtk_paper_size_new should check the paper-names listing to see whether a proper display name can be found.