GNOME Bugzilla – Bug 639030
Small cleanup in gailtextview code.
Last modified: 2011-01-09 21:51:21 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.
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.
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 on attachment 177853 [details] [review] Small cleanup in gailtextview code. (I forgot to --amend one cut&paste error)
Created attachment 177855 [details] [review] Remove stipple attributes GtkTextView does not support them anymore.
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.
Looks fine to me. All this gail code duplication is horrible and really needs to be folded into the widgets themselves.