[gtksourceview] view: small code improvements in style_updated()



commit 0be312be7b1b5999e9ce5da82d58371bfa3b439a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Jul 24 19:51:39 2016 +0200

    view: small code improvements in style_updated()
    
    There is nothing wrong with using correct typography in comments.
    Correct typography helps the reading.

 gtksourceview/gtksourceview.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 1943bdb..bb77fcb 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -4649,21 +4649,23 @@ gtk_source_view_update_style_scheme (GtkSourceView *view)
 static void
 gtk_source_view_style_updated (GtkWidget *widget)
 {
-       GtkSourceView *view;
-
-       /* call default handler first */
-       GTK_WIDGET_CLASS (gtk_source_view_parent_class)->style_updated (widget);
+       GtkSourceView *view = GTK_SOURCE_VIEW (widget);
 
-       view = GTK_SOURCE_VIEW (widget);
+       /* Call default handler first. */
+       if (GTK_WIDGET_CLASS (gtk_source_view_parent_class)->style_updated != NULL)
+       {
+               GTK_WIDGET_CLASS (gtk_source_view_parent_class)->style_updated (widget);
+       }
 
-       /* re-set tab stops, but only if we already modified them, i.e.
-        * do nothing with good old 8-space tabs */
+       /* Re-set tab stops, but only if we already modified them, i.e.
+        * do nothing with good old 8-space tabs.
+        */
        if (view->priv->tabs_set)
        {
                set_tab_stops_internal (view);
        }
 
-       /* make sure the margin position is recalculated on next redraw */
+       /* Make sure the margin position is recalculated on next redraw. */
        view->priv->cached_right_margin_pos = -1;
 
        update_style (view);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]