[gnumeric] Fix name-definition in presence of placeholder. [#663117]



commit 83799fbc01f9b89ee6a8094d7cd4c2f732edbc5b
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Wed Nov 2 22:25:35 2011 -0600

    Fix name-definition in presence of placeholder. [#663117]
    
    2011-11-02  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-define-names.c (cb_name_guru_name_edited): check for
    	placeholder

 NEWS                              |    1 +
 doc/developer/odf-foreign.txt     |    2 --
 src/dialogs/ChangeLog             |    5 +++++
 src/dialogs/dialog-define-names.c |   28 ++++++++++++++++------------
 4 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8ecc58e..8a89753 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,7 @@ Andreas:
 	* Improve text import/export from and to ODF. [#627509, #663135]
 	* Import hyperlinks from ODF. [#603533]
 	* Fix status of sub- and superscript buttons. [#662474]
+	* Fix name-definition in presence of placeholder. [#663117]
 
 Jean:
 	* Make things build against gtk+-3.0.
diff --git a/doc/developer/odf-foreign.txt b/doc/developer/odf-foreign.txt
index 303d60b..4af2b1b 100644
--- a/doc/developer/odf-foreign.txt
+++ b/doc/developer/odf-foreign.txt
@@ -32,7 +32,6 @@ An attribute to <number:fraction> giving the maximum number of denominator digit
 (In ODF 1.3 to be replaced by number:max-denominator-value.)
 
 2) Attribute _values_ added by Gnumeric. 
-Since these are not eleemnts or new attributes they are used in all ODF exports.
 
 gnm:step-start          in ODF1.3: step-end
 gnm:step-end		in ODF1.3: step-start
@@ -124,7 +123,6 @@ gnm:style-print
 A space separated list of items from annotations_at_end, black_n_white, draft, print_even_if_only_styles, errors_as_blank, errors_as_dashes, errors_as_na
 
 3) Attribute _values_ added by Gnumeric. 
-Since these are not eleemnts or new attributes they are used in all ODF exports.
 
 gnm:closed-spline
 gnm:parabolic-cspline
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 72f6729..6adf058 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-02  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* dialog-define-names.c (cb_name_guru_name_edited): check for
+	placeholder
+
 2011-10-28  Jean Brefort  <jean brefort normalesup org>
 
 	* autofilter-top10.ui: fixed GtkGrid spacings.
diff --git a/src/dialogs/dialog-define-names.c b/src/dialogs/dialog-define-names.c
index b632a4e..fdd713a 100644
--- a/src/dialogs/dialog-define-names.c
+++ b/src/dialogs/dialog-define-names.c
@@ -182,7 +182,8 @@ name_guru_warn (NameGuruState *state,
 }
 
 static gboolean
-cb_name_guru_show_all (GtkTreeModel *model, GtkTreePath *path,
+cb_name_guru_show_all (G_GNUC_UNUSED GtkTreeModel *model, 
+		       G_GNUC_UNUSED GtkTreePath *path,
 		       GtkTreeIter *iter, gpointer data)
 {
 	NameGuruState *state = data;
@@ -205,8 +206,9 @@ name_guru_erase_search_entry (GtkEntry *entry,
 }
 
 static gboolean
-cb_name_guru_search (GtkTreeModel *model, GtkTreePath *path,
-		       GtkTreeIter *iter, gpointer data)
+cb_name_guru_search (GtkTreeModel *model, 
+		     G_GNUC_UNUSED GtkTreePath *path,
+		     GtkTreeIter *iter, gpointer data)
 {
 	char const *text = data;
 	gchar *name;
@@ -889,10 +891,11 @@ name_guru_check_expression (NameGuruState *state, gchar *text,
 
 
 static void
-cb_name_guru_content_edited (GnumericCellRendererExprEntry *cell,
-			     gchar               *path_string,
-			     gchar               *new_text,
-			     NameGuruState       *state)
+cb_name_guru_content_edited 
+(G_GNUC_UNUSED GnumericCellRendererExprEntry *cell,
+ gchar               *path_string,
+ gchar               *new_text,
+ NameGuruState       *state)
 {
 	GtkTreeIter       iter;
 	item_type_t       type;
@@ -963,14 +966,15 @@ cb_name_guru_name_edited (G_GNUC_UNUSED GtkCellRendererText *cell,
 	name_guru_parse_pos_init (state, &pp, type);
 	nexpr = expr_name_lookup (&pp, new_text);
 
-	if (nexpr != NULL) {
+	if (nexpr != NULL && !nexpr->is_placeholder) {
 		Sheet *scope = nexpr->pos.sheet;
 		if ((type == item_type_new_unsaved_wb_name &&
 		     scope == NULL) ||
 		    (type == item_type_new_unsaved_sheet_name)) {
-			go_gtk_notice_dialog (GTK_WINDOW (state->dialog),
-					      GTK_MESSAGE_ERROR,
-					      _("This name is already in use!"));
+			go_gtk_notice_dialog 
+				(GTK_WINDOW (state->dialog),
+				 GTK_MESSAGE_ERROR,
+				 _("This name is already in use!"));
 			return;
 		}
 	}
@@ -1023,7 +1027,7 @@ name_guru_update_sensitivity (GtkTreeSelection *treeselection,
 }
 
 static gboolean
-cb_name_guru_selection_function (GtkTreeSelection *selection,
+cb_name_guru_selection_function (G_GNUC_UNUSED GtkTreeSelection *selection,
 				 GtkTreeModel *model,
 				 GtkTreePath *path,
 				 gboolean path_currently_selected,



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