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 624443 - GtkScale marks created with GtkBuilder allocate space for the markup even if it is null
GtkScale marks created with GtkBuilder allocate space for the markup even if ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-07-15 11:39 UTC by Filippo Argiolas
Modified: 2010-08-05 01:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valac --pkg gtk+-2.0 scale-mark-test.vala (1.09 KB, application/x-gzip)
2010-07-15 11:39 UTC, Filippo Argiolas
  Details
screenshot from the test case (20.12 KB, image/png)
2010-07-15 14:36 UTC, Filippo Argiolas
  Details
Do not create an empty layout for GtkScale marks (1.28 KB, patch)
2010-07-22 12:13 UTC, Filippo Argiolas
none Details | Review

Description Filippo Argiolas 2010-07-15 11:39:53 UTC
Created attachment 165948 [details]
valac --pkg gtk+-2.0 scale-mark-test.vala

Subject says it all, attaching a simple test case to show it.
Comment 1 Filippo Argiolas 2010-07-15 14:36:26 UTC
Created attachment 165968 [details]
screenshot from the test case
Comment 2 Filippo Argiolas 2010-07-22 12:13:03 UTC
Created attachment 166384 [details] [review]
Do not create an empty layout for GtkScale marks

When adding marks from buildable parser the markup property is stored
into a gstring. Then the pango layout is created if markup is not NULL
but strings coming from the parser are always not null even when empty.
Force the markup property to be NULL if the gstring length is zero.
Comment 3 Filippo Argiolas 2010-07-22 12:15:23 UTC
An alternative way of fixing this would be to check for the markup string to actually be not empty (str != NULL || *str != '\0') when creating the pango layout.