diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-20 18:41:11 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-20 20:04:44 +0100 |
commit | 49d289475167ab21682bc8dbf26a7f67d5902ded (patch) | |
tree | 91d6259ba058bd1dbceef16407b86373fa51aa56 /include/unotools/textsearch.hxx | |
parent | 1b6b4ffbd9608eff245deb87da5f193f5d955e51 (diff) |
let ConvertToSearchType() also adapt the regex bool, tdf#72196
Change-Id: I6d9c438873f3f26418e6b27884207106ccaea148
Diffstat (limited to 'include/unotools/textsearch.hxx')
-rw-r--r-- | include/unotools/textsearch.hxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx index 67c440ad033c..07d2527e242a 100644 --- a/include/unotools/textsearch.hxx +++ b/include/unotools/textsearch.hxx @@ -50,11 +50,20 @@ public: enum SearchType{ SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST, SRCH_WILDCARD }; /** Convert configuration and document boolean settings to SearchType. - If bWildcard is true it takes precedence over bRegExp. + If bWildcard is true it takes precedence over rbRegExp. + @param rbRegExp + If true and bWildcard is also true, rbRegExp is set to false to + adapt the caller's settings. */ - static SearchType ConvertToSearchType( bool bWildcard, bool bRegExp ) + static SearchType ConvertToSearchType( bool bWildcard, bool & rbRegExp ) { - return bWildcard ? SRCH_WILDCARD : (bRegExp ? SRCH_REGEXP : SRCH_NORMAL); + if (bWildcard) + { + if (rbRegExp) + rbRegExp = false; + return SRCH_WILDCARD; + } + return rbRegExp ? SRCH_REGEXP : SRCH_NORMAL; } /** Convert SearchType to configuration and document boolean settings. |