[gedit] View: safer vfunc chain-up



commit b85d0e1c87038751f4dbc21ecd078f6a447292ff
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Nov 24 22:46:27 2020 +0100

    View: safer vfunc chain-up

 gedit/gedit-view.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index af719a6c2..768cad24f 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -589,15 +589,15 @@ gedit_view_delete_from_cursor (GtkTextView   *text_view,
         * GTK_DELETE_PARAGRAPHS case is not implemented as we like (i.e. it
         * does not remove the newline in the previous line).
         */
-       switch (type)
+       if (type == GTK_DELETE_PARAGRAPHS)
        {
-               case GTK_DELETE_PARAGRAPHS:
-                       delete_line (text_view, count);
-                       break;
+               delete_line (text_view, count);
+               return;
+       }
 
-               default:
-                       GTK_TEXT_VIEW_CLASS (gedit_view_parent_class)->delete_from_cursor(text_view, type, 
count);
-                       break;
+       if (GTK_TEXT_VIEW_CLASS (gedit_view_parent_class)->delete_from_cursor != NULL)
+       {
+               GTK_TEXT_VIEW_CLASS (gedit_view_parent_class)->delete_from_cursor (text_view, type, count);
        }
 }
 


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