[libgda] Misc corrections and improvements



commit 24d14ed1305735c9d298ef8bac6f7a61c7ef7f55
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sat Oct 17 14:09:00 2009 +0200

    Misc corrections and improvements

 libgda-ui/gdaui-data-store.c |    7 +++++--
 libgda-ui/gdaui-grid.c       |   16 ++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/libgda-ui/gdaui-data-store.c b/libgda-ui/gdaui-data-store.c
index e67e993..8a3b564 100644
--- a/libgda-ui/gdaui-data-store.c
+++ b/libgda-ui/gdaui-data-store.c
@@ -681,7 +681,7 @@ data_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column,
 	GdauiDataStore *store;
 	const GValue *tmp;
 	GType rettype;
-	gint model_nb_cols;
+	gint model_nb_cols = -10;
 
 	g_return_if_fail (GDAUI_IS_DATA_STORE (tree_model));
         store = GDAUI_DATA_STORE (tree_model);
@@ -693,12 +693,12 @@ data_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column,
 
 	rettype = data_store_get_column_type (tree_model, column);
 	g_value_init (value, rettype);
-	model_nb_cols = gda_data_proxy_get_proxied_model_n_cols (store->priv->proxy);
 
 	/* Global attributes */
 	if (column < 0) {
 		switch (column) {
 		case DATA_STORE_COL_MODEL_N_COLUMNS:
+			model_nb_cols = gda_data_proxy_get_proxied_model_n_cols (store->priv->proxy);
 			g_value_set_int (value, model_nb_cols);
 			break;
 		case DATA_STORE_COL_MODEL_POINTER:
@@ -721,6 +721,9 @@ data_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column,
 		}
 	}
 
+	if (model_nb_cols == -10)
+		model_nb_cols = gda_data_proxy_get_proxied_model_n_cols (store->priv->proxy);
+
 	/* current proxy values or original ones */
 	if (((column >= 0) && (column < model_nb_cols)) ||
 	    ((column >= 2 * model_nb_cols) && (column < 3 * model_nb_cols))) {
diff --git a/libgda-ui/gdaui-grid.c b/libgda-ui/gdaui-grid.c
index 9ec9aa2..306bf24 100644
--- a/libgda-ui/gdaui-grid.c
+++ b/libgda-ui/gdaui-grid.c
@@ -1,6 +1,6 @@
 /* gdaui-grid.c
  *
- * Copyright (C) 2002 - 2006 Vivien Malerba
+ * Copyright (C) 2002 - 2009 Vivien Malerba
  *
  * This Library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public License as
@@ -30,13 +30,13 @@ static void gdaui_grid_class_init (GdauiGridClass * class);
 static void gdaui_grid_init (GdauiGrid *wid);
 
 static void gdaui_grid_set_property (GObject *object,
-					guint param_id,
-					const GValue *value,
-					GParamSpec *pspec);
+				     guint param_id,
+				     const GValue *value,
+				     GParamSpec *pspec);
 static void gdaui_grid_get_property (GObject *object,
-					guint param_id,
-					GValue *value,
-					GParamSpec *pspec);
+				     guint param_id,
+				     GValue *value,
+				     GParamSpec *pspec);
 
 struct _GdauiGridPriv
 {
@@ -147,7 +147,7 @@ gdaui_grid_new (GdaDataModel *model)
 	g_return_val_if_fail (!model || GDA_IS_DATA_MODEL (model), NULL);
 
 	grid = (GdauiGrid *) g_object_new (GDAUI_TYPE_GRID,
-	                                     "model", model, NULL);
+					   "model", model, NULL);
 
 	return (GtkWidget *) grid;
 }



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