[gnumeric] COUNTIF: Fix pattern matching.



commit 7ea71880b4155ac5ad270bba590dcc8f15f8611d
Author: Morten Welinder <terra gnome org>
Date:   Wed Jul 10 11:44:53 2013 -0400

    COUNTIF: Fix pattern matching.
    
    1. Should anchor at end.
    2. Should be case insensitive.

 ChangeLog         |    5 +++++
 NEWS              |    1 +
 samples/sumif.xls |  Bin 11776 -> 11776 bytes
 src/value.c       |    2 +-
 4 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f4beaad..4630234 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-10  Morten Welinder  <terra gnome org>
+
+       * src/value.c (parse_criteria): Patterns should anchor at the end
+       (#703770) and be case insensitive (no bug#).
+
 2013-07-04  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * src/sheet-object-image.c (gnm_soi_assign_to_sheet): do not try
diff --git a/NEWS b/NEWS
index b157414..ea9c5a9 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ Morten:
        * Fix problems saving auto filters to xls.  [#703308]
        * Improve handling of large graph ranges.  [#703546]
        * Fix analysis issue with translations.  [#703355]
+       * Fix COUNTIF (etc) pattern matching.  [#703770]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.3
diff --git a/samples/sumif.xls b/samples/sumif.xls
index d5b4af3..02d49fb 100755
Binary files a/samples/sumif.xls and b/samples/sumif.xls differ
diff --git a/src/value.c b/src/value.c
index 517cd04..3704d4b 100644
--- a/src/value.c
+++ b/src/value.c
@@ -1745,7 +1745,7 @@ parse_criteria (GnmValue const *crit_val, GODateConventions const *date_conv)
                len = 1;
        } else {
                res->fun = criteria_test_match;
-               res->has_rx = (gnm_regcomp_XL (&res->rx, criteria, 0, TRUE, FALSE) == GO_REG_OK);
+               res->has_rx = (gnm_regcomp_XL (&res->rx, criteria, GO_REG_ICASE, TRUE, TRUE) == GO_REG_OK);
                len = 0;
        }
 


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