diff options
Diffstat (limited to 'include')
-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. |