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

Eike Rathke erack at redhat.com
Thu Jan 25 13:45:52 UTC 2018


 sc/source/core/data/conditio.cxx |    6 ++++++
 sc/source/core/data/documen8.cxx |   17 +++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 2930ba2ac5d9423f2848b968edcd8ddc71966186
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jan 25 14:25:38 2018 +0100

    CheckLinkFormulaNeedingCheck() for .ods conditional format expressions
    
    Change-Id: I45eb1ab5efa0ec9da2663f20427d2474ce300826

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 4829be28388d..eb86f3e4bc61 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -471,6 +471,12 @@ void ScConditionEntry::CompileXML()
     Compile( GetExpression(aSrcPos, 0, 0, eTempGrammar1),
              GetExpression(aSrcPos, 1, 0, eTempGrammar2),
              aStrNmsp1, aStrNmsp2, eTempGrammar1, eTempGrammar2, true );
+
+    // Importing ocDde/ocWebservice?
+    if (pFormula1)
+        mpDoc->CheckLinkFormulaNeedingCheck(*pFormula1);
+    if (pFormula2)
+        mpDoc->CheckLinkFormulaNeedingCheck(*pFormula2);
 }
 
 void ScConditionEntry::SetSrcString( const OUString& rNew )
commit faa0305ba3d0dc698fce4915d4f3a1fb52422380
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jan 25 13:20:27 2018 +0100

    Prepare CheckLinkFormulaNeedingCheck() to use either RPN or tokenized code
    
    Conditional format formulas aren't finally compiled until needed
    so the check will have to operate on the tokenized expression
    instead of RPN code.
    
    Change-Id: I68837e9bd33f125ab47b10b1a6fa18175abd1627

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index eb75f2be076c..eb58eb080213 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1182,8 +1182,21 @@ void ScDocument::CheckLinkFormulaNeedingCheck( const ScTokenArray& rCode )
     if (HasLinkFormulaNeedingCheck())
         return;
 
-    if (rCode.HasOpCodeRPN(ocDde) || rCode.HasOpCodeRPN(ocWebservice))
-        SetLinkFormulaNeedingCheck(true);
+    // Prefer RPN over tokenized formula if available.
+    if (rCode.GetCodeLen())
+    {
+        if (rCode.HasOpCodeRPN(ocDde) || rCode.HasOpCodeRPN(ocWebservice))
+            SetLinkFormulaNeedingCheck(true);
+    }
+    else if (rCode.GetLen())
+    {
+        if (rCode.HasOpCode(ocDde) || rCode.HasOpCode(ocWebservice))
+            SetLinkFormulaNeedingCheck(true);
+    }
+    else
+    {
+        assert(!"called with empty ScTokenArray");
+    }
 }
 
 // TimerDelays etc.


More information about the Libreoffice-commits mailing list