]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/assertdlg_gtk.cpp
Fix crash in wxDC::GetMultiLineTextExtent() after last commit.
[wxWidgets.git] / src / gtk / assertdlg_gtk.cpp
index e80caffbdb9b58b7e7756a8ee01dd7e9d45f22a1..bdcd83c0863a54bfa88e666e15d94d7f013fd5a4 100644 (file)
@@ -7,6 +7,8 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////// */
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////// */
 
+#include "wx/wxprec.h"
+
 #include "wx/platform.h"
 #include <gtk/gtk.h>
 #include "wx/gtk/assertdlg_gtk.h"
 #include "wx/platform.h"
 #include <gtk/gtk.h>
 #include "wx/gtk/assertdlg_gtk.h"
        in gtk_assert_dialog_create_backtrace_list_model() function
  */
 #define STACKFRAME_LEVEL_COLIDX        0
        in gtk_assert_dialog_create_backtrace_list_model() function
  */
 #define STACKFRAME_LEVEL_COLIDX        0
-#define FUNCTION_NAME_COLIDX           1
+#define FUNCTION_PROTOTYPE_COLIDX      1
 #define SOURCE_FILE_COLIDX             2
 #define LINE_NUMBER_COLIDX             3
 #define SOURCE_FILE_COLIDX             2
 #define LINE_NUMBER_COLIDX             3
-#define FUNCTION_ARGS_COLIDX           4
 
 
 
 
 
 
@@ -84,12 +85,11 @@ GtkWidget *gtk_assert_dialog_create_backtrace_list_model ()
     GtkWidget *treeview;
 
     /* create list store */
     GtkWidget *treeview;
 
     /* create list store */
-    store = gtk_list_store_new (5,
+    store = gtk_list_store_new (4,
                                 G_TYPE_UINT,        /* stack frame number */
                                 G_TYPE_UINT,        /* stack frame number */
-                                G_TYPE_STRING,      /* function name      */
+                                G_TYPE_STRING,      /* function prototype */
                                 G_TYPE_STRING,      /* source file name   */
                                 G_TYPE_STRING,      /* source file name   */
-                                G_TYPE_STRING,      /* line number        */
-                                G_TYPE_STRING);     /* function arguments */
+                                G_TYPE_STRING);     /* line number        */
 
     /* create the tree view */
     treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store));
 
     /* create the tree view */
     treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store));
@@ -98,8 +98,7 @@ GtkWidget *gtk_assert_dialog_create_backtrace_list_model ()
 
     /* append columns */
     gtk_assert_dialog_append_text_column(treeview, "#", STACKFRAME_LEVEL_COLIDX);
 
     /* append columns */
     gtk_assert_dialog_append_text_column(treeview, "#", STACKFRAME_LEVEL_COLIDX);
-    gtk_assert_dialog_append_text_column(treeview, "Function name", FUNCTION_NAME_COLIDX);
-    gtk_assert_dialog_append_text_column(treeview, "Function args", FUNCTION_ARGS_COLIDX);
+    gtk_assert_dialog_append_text_column(treeview, "Function Prototype", FUNCTION_PROTOTYPE_COLIDX);
     gtk_assert_dialog_append_text_column(treeview, "Source file", SOURCE_FILE_COLIDX);
     gtk_assert_dialog_append_text_column(treeview, "Line #", LINE_NUMBER_COLIDX);
 
     gtk_assert_dialog_append_text_column(treeview, "Source file", SOURCE_FILE_COLIDX);
     gtk_assert_dialog_append_text_column(treeview, "Line #", LINE_NUMBER_COLIDX);
 
@@ -299,7 +298,7 @@ static void gtk_assert_dialog_init(GtkAssertDialog* dlg)
         /* add the expander */
         dlg->expander = gtk_expander_new_with_mnemonic ("Back_trace:");
         gtk_box_pack_start (GTK_BOX(vbox), dlg->expander, TRUE, TRUE, 0);
         /* add the expander */
         dlg->expander = gtk_expander_new_with_mnemonic ("Back_trace:");
         gtk_box_pack_start (GTK_BOX(vbox), dlg->expander, TRUE, TRUE, 0);
-        g_signal_connect (GTK_EXPANDER(dlg->expander), "activate",
+        g_signal_connect (dlg->expander, "activate",
                             G_CALLBACK(gtk_assert_dialog_expander_callback), dlg);
     }
 
                             G_CALLBACK(gtk_assert_dialog_expander_callback), dlg);
     }
 
@@ -379,7 +378,7 @@ gchar *gtk_assert_dialog_get_message (GtkAssertDialog *dlg)
 
 gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
 {
 
 gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
 {
-    gchar *function, *arguments, *sourcefile, *linenum;
+    gchar *function, *sourcefile, *linenum;
     guint count;
 
     GtkTreeModel *model;
     guint count;
 
     GtkTreeModel *model;
@@ -397,16 +396,15 @@ gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
     do
     {
         /* append this stack frame's info to the string */
     do
     {
         /* append this stack frame's info to the string */
-        gtk_tree_model_get (model, &iter,
+        gtk_tree_model_get(model, &iter,
                             STACKFRAME_LEVEL_COLIDX, &count,
                             STACKFRAME_LEVEL_COLIDX, &count,
-                            FUNCTION_NAME_COLIDX, &function,
-                            FUNCTION_ARGS_COLIDX, &arguments,
+                            FUNCTION_PROTOTYPE_COLIDX, &function,
                             SOURCE_FILE_COLIDX, &sourcefile,
                             LINE_NUMBER_COLIDX, &linenum,
                             -1);
 
                             SOURCE_FILE_COLIDX, &sourcefile,
                             LINE_NUMBER_COLIDX, &linenum,
                             -1);
 
-        g_string_append_printf (string, "[%u] %s(%s)",
-                                count, function, arguments);
+        g_string_append_printf(string, "[%u] %s",
+                                count, function);
         if (sourcefile[0] != '\0')
             g_string_append_printf (string, " %s", sourcefile);
         if (linenum[0] != '\0')
         if (sourcefile[0] != '\0')
             g_string_append_printf (string, " %s", sourcefile);
         if (linenum[0] != '\0')
@@ -414,7 +412,6 @@ gchar *gtk_assert_dialog_get_backtrace (GtkAssertDialog *dlg)
         g_string_append (string, "\n");
 
         g_free (function);
         g_string_append (string, "\n");
 
         g_free (function);
-        g_free (arguments);
         g_free (sourcefile);
         g_free (linenum);
 
         g_free (sourcefile);
         g_free (linenum);
 
@@ -449,7 +446,6 @@ void gtk_assert_dialog_set_backtrace_callback(GtkAssertDialog *assertdlg,
 
 void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
                                           const gchar *function,
 
 void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
                                           const gchar *function,
-                                          const gchar *arguments,
                                           const gchar *sourcefile,
                                           guint line_number)
 {
                                           const gchar *sourcefile,
                                           guint line_number)
 {
@@ -472,8 +468,7 @@ void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
     gtk_list_store_append (GTK_LIST_STORE(model), &iter);
     gtk_list_store_set (GTK_LIST_STORE(model), &iter,
                         STACKFRAME_LEVEL_COLIDX, count+1,     /* start from 1 and not from 0 */
     gtk_list_store_append (GTK_LIST_STORE(model), &iter);
     gtk_list_store_set (GTK_LIST_STORE(model), &iter,
                         STACKFRAME_LEVEL_COLIDX, count+1,     /* start from 1 and not from 0 */
-                        FUNCTION_NAME_COLIDX, function,
-                        FUNCTION_ARGS_COLIDX, arguments,
+                        FUNCTION_PROTOTYPE_COLIDX, function,
                         SOURCE_FILE_COLIDX, sourcefile,
                         LINE_NUMBER_COLIDX, linenum->str,
                         -1);
                         SOURCE_FILE_COLIDX, sourcefile,
                         LINE_NUMBER_COLIDX, linenum->str,
                         -1);