Commit d66e132f authored by Morten Welinder's avatar Morten Welinder

Conditional format: fix "contains".

1. Case insensitive.
2. Allow wildcards like SEARCH.
parent ce8d16a5
2014-03-21 Morten Welinder <terra@gnome.org>
* src/style-conditions.c (gnm_style_cond_eval): Make "Contains..."
case insensitve and allow wildcards.
* src/gutils.c (gnm_excel_search_impl): New function, extracted
from fn-string.
......
......@@ -609,8 +609,9 @@ gnm_style_cond_eval (GnmStyleCond const *cond, GnmValue const *cv,
negate = TRUE; /* ...and fall through */
case GNM_STYLE_COND_CONTAINS_STR:
res = (cv &&
strstr (value_peek_string (cv),
value_peek_string (val0)) != NULL);
gnm_excel_search_impl (value_peek_string (val0),
value_peek_string (cv),
0) >= 0);
break;
case GNM_STYLE_COND_NOT_BEGINS_WITH_STR:
......
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