summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/unotools/textsearch.hxx15
-rw-r--r--sc/inc/docoptio.hxx5
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;
}