Commit cbca4454 authored by Morten Welinder's avatar Morten Welinder

D-funcs: various fixes.

Clearly a test suite was overdue for these functions.
parent baa13c0c
2016-06-11 Morten Welinder <terra@gnome.org>
* src/value.c (find_rows_that_match): Fix blank handling.
(criteria_test_unequal): Wrong type means unequal.
(criteria_test_match): Only match strings.
(parse_criteria): Don't anchor matches. This is the right thing
to do for DSUM and friends. Hopefully this doesn't break anything
else.
2016-05-19 Morten Welinder <terra@gnome.org>
......
......@@ -4,7 +4,8 @@ Morten:
* Improve format guessing for csv and txt files.
* Fix DCOUNT and DCOUNTA with missing field. [#767290]
* Fix strictness in database functions.
* Improve test suite.
* Fix a bunch of corner cases for database functions.
* Add tests for database functions.
--------------------------------------------------------------------------
Gnumeric 1.12.29
......
......@@ -1563,7 +1563,7 @@ criteria_test_unequal (GnmValue const *x, GnmCriteria *crit)
g_assert_not_reached ();
case CRIT_NULL:
case CRIT_WRONGTYPE:
return FALSE;
return TRUE;
case CRIT_FLOAT:
return xf != yf;
case CRIT_STRING:
......@@ -1647,6 +1647,10 @@ criteria_test_match (GnmValue const *x, GnmCriteria *crit)
if (!crit->has_rx)
return FALSE;
// Only strings are matched
if (!VALUE_IS_STRING (x))
return FALSE;
return go_regexec (&crit->rx, value_peek_string (x), 0, NULL, 0) ==
GO_REG_OK;
}
......@@ -1828,7 +1832,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, GO_REG_ICASE, TRUE, TRUE) == GO_REG_OK);
res->has_rx = (gnm_regcomp_XL (&res->rx, criteria, GO_REG_ICASE, FALSE, FALSE) == GO_REG_OK);
len = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment