[gnumeric] Avoid multiple undos in additional cases.



commit 427cf3b776da6661b903395adef9fe0718cb0597
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Fri Aug 13 20:07:20 2010 -0600

    Avoid multiple undos in additional cases.
    
    2010-08-13  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/commands.c (cmd_set_text_full_check_text): if we have already
    	  have a string in the cell, we can ignore a leading '

 ChangeLog      |    5 +++++
 src/commands.c |    9 +++------
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fbe2b9e..f6b65f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-08-13  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/commands.c (cmd_set_text_full_check_text): if we have already
+	  have a string in the cell, we can ignore a leading '
+
+2010-08-13  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/commands.c (cmd_set_text_full_check_text): new
 	(cmd_set_text_full_check_markup): new
 	(cmd_set_text_full): check for changed text and markup
diff --git a/src/commands.c b/src/commands.c
index ee8a199..1ed84a8 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -772,12 +772,9 @@ cmd_set_text_full_check_text (GnmCellIter const *iter, char *text)
 	old_text = gnm_cell_get_entered_text (iter->cell);
 	same = strcmp (old_text, text) == 0;
 
-	/* We do not recognize that entering "a" and "'a" is the same thing */
-	/* nor that "'a" and "'a" is the same thing */
-	/* We could do: */
-/* 	if (!same && text[0] == '\'') */
-/* 		same = strcmp (old_text, text + 1) == 0; */
-	/* but we would then think that "1" and "'1" are the same (which they aren't. */
+	if (!same && iter->cell->value && VALUE_IS_STRING (iter->cell->value) 
+	    && text[0] == '\'')
+		same = strcmp (old_text, text + 1) == 0;
  
 	g_free (old_text);
 



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