[gtksourceview: 2/2] CompletionContainer: add post-conditions



commit 2b11df90ecf4433bedcd33e936688ba466336de1
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Oct 15 17:19:35 2015 +0200

    CompletionContainer: add post-conditions
    
    When running test-completion I get those critical messages:
    
    Gtk-CRITICAL **: gtk_widget_get_preferred_width_for_height: assertion 'height >= 0' failed
    Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 13 and height -24
    
    But it looks like everything is fine in CompletionContainer.

 gtksourceview/gtksourcecompletioncontainer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletioncontainer.c b/gtksourceview/gtksourcecompletioncontainer.c
index 21eb6ed..7ff5cea 100644
--- a/gtksourceview/gtksourcecompletioncontainer.c
+++ b/gtksourceview/gtksourcecompletioncontainer.c
@@ -87,6 +87,8 @@ _gtk_source_completion_container_get_preferred_width (GtkWidget *widget,
        {
                *nat_width = width;
        }
+
+       g_return_if_fail (width >= 0);
 }
 
 static gint
@@ -165,6 +167,8 @@ _gtk_source_completion_container_get_preferred_height (GtkWidget *widget,
        {
                *nat_height = height;
        }
+
+       g_return_if_fail (height >= 0);
 }
 
 static void


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