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 639030 - Small cleanup in gailtextview code.
Small cleanup in gailtextview code.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Accessibility
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-01-08 23:49 UTC by Paolo Borelli
Modified: 2011-01-09 21:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small cleanup in gailtextview code. (15.54 KB, patch)
2011-01-08 23:50 UTC, Paolo Borelli
none Details | Review
Small cleanup in gailtextview code. (15.52 KB, patch)
2011-01-08 23:59 UTC, Paolo Borelli
committed Details | Review
Remove stipple attributes (1.24 KB, patch)
2011-01-09 00:33 UTC, Paolo Borelli
committed Details | Review

Description Paolo Borelli 2011-01-08 23:49:59 UTC
While checking users of GtkTextAttributes I spotted gail_misc_add_to_attr_set and noticed that it is not useful: it is a big switch statement, but the function is only used by a single caller and the common part out of the switch is just one line. Just folding it into the caller leads to much less code, one less public function, more efficient code and one less user of GtkTextAttributes.

4 files changed, 63 insertions(+), 188 deletions(-)

The patch does not change a single bit of behavior and I checked a couple of times I did not do cut and paste mistakes. Make check passes but other than that I am not sure how to test.
Comment 1 Paolo Borelli 2011-01-08 23:50:03 UTC
Created attachment 177853 [details] [review]
Small cleanup in gailtextview code.

Fold gail_misc_add_to_attr_set into the only function calling it, which
avoids a useless big "switch" and results in much less code.
Comment 2 Paolo Borelli 2011-01-08 23:59:09 UTC
Created attachment 177854 [details] [review]
Small cleanup in gailtextview code.

Fold gail_misc_add_to_attr_set into the only function calling it, which
avoids a useless big "switch" and results in much less code.
Comment 3 Paolo Borelli 2011-01-09 00:00:22 UTC
Comment on attachment 177853 [details] [review]
Small cleanup in gailtextview code.

(I forgot to --amend one cut&paste error)
Comment 4 Paolo Borelli 2011-01-09 00:33:40 UTC
Created attachment 177855 [details] [review]
Remove stipple attributes

GtkTextView does not support them anymore.
Comment 5 Paolo Borelli 2011-01-09 00:36:15 UTC
The follow up patch just removes the two stipple attributes since I think they do not make sense anymore (not beside that they were always set to null since they were not handled in the original function's switch statement).

I split it in a separate patch since it actually introduces a change and I have no idea how to test it.
Comment 6 Matthias Clasen 2011-01-09 20:00:00 UTC
Looks fine to me. All this gail code duplication is horrible and really needs to be folded into the widgets themselves.