GNOME Bugzilla – Bug 460908
gtk_paper_size_get_[width|height] doesn't support GTK_UNIT_PIXEL
Last modified: 2012-05-04 01:31:05 UTC
Steps: 0) gtk_paper_size_get_width (paper_size, GTK_UNIT_PIXEL) Results: Gtk-WARNING **: Unsupported unit (gdb) where
+ Trace 150924
The docs don't mention that PIXEL isn't supported here. Same applies for gtk_paper_size_get_default_*_margin.
Created attachment 208039 [details] [review] document functions that reject GTK_UNIT_PIXEL for units parameter
I did a bit of review of the code -- it looks like the 'pixel' unit is basically used nowhere except for the case that a unit hasn't been specified in the print operation (in which case no transformation is used for cairo). I wonder if we should perhaps not rename it to GTK_UNIT_NONE at which point it would be more evident that you can't use it with the other functions...
Created attachment 213422 [details] [review] printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE ...and document that many functions don't accept "none" as a unit.
Review of attachment 213422 [details] [review]: sure, why not
Attachment 213422 [details] pushed as 88c6390 - printing: Rename GTK_UNIT_PIXEL to GTK_UNIT_NONE