[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Sat Feb 20 00:28:42 UTC 2016


 sc/source/core/tool/interpr1.cxx |    8 +++-----
 sc/source/ui/app/scmod.cxx       |    1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 1684e347cd16ce91ecf27d94691b185a0110cc34
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Feb 20 01:20:12 2016 +0100

    add missing IsFormulaWildcardsEnabled() calls, tdf#72196
    
    Change-Id: Ia684cfe93c6a0e71a0fbbe22974501bf610e9190

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a444491..26b7f10 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8512,9 +8512,8 @@ bool ScInterpreter::MayBeRegExp( const OUString& rStr, const ScDocument* pDoc, b
 
 bool ScInterpreter::MayBeWildcard( const OUString& rStr, const ScDocument* pDoc )
 {
-    /* TODO: doc options will need a new enum (or a second bool that takes
-     * precedence over regex?) */
-    (void)pDoc;
+    if ( pDoc && !pDoc->GetDocOptions().IsFormulaWildcardsEnabled() )
+        return false;
 
     // Wildcards without '~' escape, if there are no wildcards then an escaped
     // character does not make sense.
@@ -8537,8 +8536,7 @@ utl::SearchParam::SearchType ScInterpreter::DetectSearchType( const OUString& rS
 {
     if (pDoc)
     {
-        bool bWildcardEnabled = false;  /* TODO: obtain doc option */
-        if (bWildcardEnabled)
+        if (pDoc->GetDocOptions().IsFormulaWildcardsEnabled())
             return MayBeWildcard( rStr, nullptr) ? utl::SearchParam::SRCH_WILDCARD : utl::SearchParam::SRCH_NORMAL;
         if (pDoc->GetDocOptions().IsFormulaRegexEnabled())
             return MayBeRegExp( rStr, nullptr) ? utl::SearchParam::SRCH_REGEXP : utl::SearchParam::SRCH_NORMAL;
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 0ac4315..4d7e2d5 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1115,6 +1115,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
                          || rOldOpt.IsMatchWholeCell() != rNewOpt.IsMatchWholeCell()
                          || rOldOpt.GetYear2000()   != rNewOpt.GetYear2000()
                          || rOldOpt.IsFormulaRegexEnabled() != rNewOpt.IsFormulaRegexEnabled()
+                         || rOldOpt.IsFormulaWildcardsEnabled() != rNewOpt.IsFormulaWildcardsEnabled()
                          );
             pDoc->SetDocOptions( rNewOpt );
             pDocSh->SetDocumentModified();


More information about the Libreoffice-commits mailing list