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 | |
parent | 1b6b4ffbd9608eff245deb87da5f193f5d955e51 (diff) |
let ConvertToSearchType() also adapt the regex bool, tdf#72196
Change-Id: I6d9c438873f3f26418e6b27884207106ccaea148
-rw-r--r-- | include/unotools/textsearch.hxx | 15 | ||||
-rw-r--r-- | sc/inc/docoptio.hxx | 5 |
2 files changed, 12 insertions, 8 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. diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx index 9335394c9b58..a5f3bbfdc298 100644 --- a/sc/inc/docoptio.hxx +++ b/sc/inc/docoptio.hxx @@ -98,12 +98,7 @@ public: utl::SearchParam::SearchType GetFormulaSearchType() const { if (eFormulaSearchType == eSearchTypeUnknown) - { eFormulaSearchType = utl::SearchParam::ConvertToSearchType( bFormulaWildcardsEnabled, bFormulaRegexEnabled); - if (bFormulaWildcardsEnabled && bFormulaRegexEnabled) - // Mutually exclusive, straighten out. - bFormulaRegexEnabled = false; - } return eFormulaSearchType; } |