[gnumeric] search-and-replace: fix problem with text formatted cells.



commit 0c0b3bb5ddf014d45e9056be7ed578e21f94ef8f
Author: Morten Welinder <terra gnome org>
Date:   Wed Feb 18 11:54:40 2015 -0500

    search-and-replace: fix problem with text formatted cells.
    
    It's expected that we don't get expressions for such cells, no matter what.

 ChangeLog      |    6 ++++++
 NEWS           |    1 +
 src/commands.c |    5 +++--
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3f90d8e..1a45e4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-18  Morten Welinder  <terra gnome org>
+
+       * src/commands.c (cmd_search_replace_do_cell): Don't report and
+       error just because a cell with text format fails to produce an
+       expression.  That's expected for text format.
+
 2015-02-17  Morten Welinder  <terra gnome org>
 
        * src/sheet-object-image.c (gnm_soi_get_property): Plug leak.
diff --git a/NEWS b/NEWS
index c9cf5ac..562e311 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ Morten:
        * Plug leaks.
        * Arrow properties editor.  [#158327]
        * Fix xlsx export of line style None.
+       * Fix search-and-replace problem with text format.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.20
diff --git a/src/commands.c b/src/commands.c
index ce586db..2c08d7c 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -4208,8 +4208,9 @@ cmd_search_replace_do_cell (CmdSearchReplace *me, GnmEvalPos *ep,
                 * FIXME: this is a hack, but parse_text_value_or_expr
                 * does not have a better way of signaling an error.
                 */
-               err = val && gnm_expr_char_start_p (cell_res.new_text);
-
+               err = (val &&
+                      gnm_expr_char_start_p (cell_res.new_text) &&
+                      !go_format_is_text (gnm_cell_get_format (cell_res.cell)));
                value_release (val);
                if (texpr) gnm_expr_top_unref (texpr);
 


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