[gedit/zbrown/deteplification-src: 561/633] View: safer vfunc chain-up




commit f6e1da2388d4c2cb548b4749656e7862819cea1d
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 66727ce9d..c1753b70b 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -616,15 +616,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]