]> git.saurik.com Git - wxWidgets.git/commitdiff
No real changes, just minor cleanup in wxGTK wxDVC.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Oct 2009 22:43:51 +0000 (22:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Oct 2009 22:43:51 +0000 (22:43 +0000)
Don't duplicate wxGtkTreeCellDataFunc declaration.

Don't triplicate "visible" property setting inside the function itself.

Indent the inside of if statement properly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dataview.cpp

index 3228e441f234bf4bfa9b3fccc036eb0713bd85bb..fead2fd22fe47b0c8c582331e261eb22d9bb7ed5 100644 (file)
@@ -2497,14 +2497,8 @@ gtk_dataview_header_button_press_callback( GtkWidget *WXUNUSED(widget),
     return FALSE;
 }
 
-extern "C" {
-static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column,
-                            GtkCellRenderer *cell,
-                            GtkTreeModel *model,
-                            GtkTreeIter *iter,
-                            gpointer data );
-}
-
+extern "C"
+{
 
 static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
                             GtkCellRenderer *renderer,
@@ -2523,37 +2517,25 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
 
     if (!wx_model->IsVirtualListModel())
     {
-
-    if (wx_model->IsContainer( item ))
-    {
-        if (wx_model->HasContainerColumns( item ) || (cell->GetOwner()->GetModelColumn() == 0))
+        gboolean visible;
+        if (wx_model->IsContainer( item ))
         {
-            GValue gvalue = { 0, };
-            g_value_init( &gvalue, G_TYPE_BOOLEAN );
-            g_value_set_boolean( &gvalue, TRUE );
-            g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
-            g_value_unset( &gvalue );
+            visible = wx_model->HasContainerColumns( item ) ||
+                        (cell->GetOwner()->GetModelColumn() == 0);
         }
         else
         {
-            GValue gvalue = { 0, };
-            g_value_init( &gvalue, G_TYPE_BOOLEAN );
-            g_value_set_boolean( &gvalue, FALSE );
-            g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
-            g_value_unset( &gvalue );
-
-            return;
+            visible = true;
         }
-    }
-    else
-    {
+
         GValue gvalue = { 0, };
         g_value_init( &gvalue, G_TYPE_BOOLEAN );
-        g_value_set_boolean( &gvalue, TRUE );
+        g_value_set_boolean( &gvalue, visible );
         g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
         g_value_unset( &gvalue );
-    }
 
+        if ( !visible )
+            return;
     }
 
     wxVariant value;
@@ -2650,6 +2632,8 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
 
 }
 
+} // extern "C"
+
 #include <wx/listimpl.cpp>
 WX_DEFINE_LIST(wxDataViewColumnList)