After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639186 - gtk_paper_size_new fails to recognize valid name
gtk_paper_size_new fails to recognize valid name
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-01-10 23:57 UTC by Andreas J. Guelzow
Modified: 2011-01-13 03:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2011-01-10 23:57:34 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.
Comment 1 Morten Welinder 2011-01-11 21:58:41 UTC
See also bug 493880.
Comment 2 Andreas J. Guelzow 2011-01-11 22:09:04 UTC
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.