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

Eike Rathke erack at redhat.com
Wed Jan 17 21:24:10 UTC 2018


 sc/inc/document.hxx                 |    2 ++
 sc/source/core/data/documen8.cxx    |   10 ++++++++++
 sc/source/core/data/formulacell.cxx |    3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 55e484c7bcd3ef218e08d3fd93f97bf98fd8cb7f
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jan 17 22:22:55 2018 +0100

    Move implementation to CheckLinkFormulaNeedingCheck() for further reuse
    
    Change-Id: I541d2b6e12a88371c064b901b00e71206ee0c18e

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index b83aadc30a60..d8dfb21dc05b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1992,6 +1992,8 @@ public:
 
     bool            HasLinkFormulaNeedingCheck() const      { return bLinkFormulaNeedingCheck; }
     void            SetLinkFormulaNeedingCheck(bool bSet)   { bLinkFormulaNeedingCheck = bSet; }
+    /** Check token array and set link check if ocDde/ocWebservice is contained. */
+    SC_DLLPUBLIC void CheckLinkFormulaNeedingCheck( const ScTokenArray& rCode );
 
     void            SetRangeOverflowType(ErrCode nType)  { nRangeOverflowType = nType; }
     bool            HasRangeOverflow() const             { return nRangeOverflowType != ERRCODE_NONE; }
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index fc38d5add74e..eb75f2be076c 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -88,6 +88,7 @@
 #include <stringutil.hxx>
 #include <documentlinkmgr.hxx>
 #include <scopetools.hxx>
+#include <tokenarray.hxx>
 
 #include <memory>
 #include <utility>
@@ -1176,6 +1177,15 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
     }
 }
 
+void ScDocument::CheckLinkFormulaNeedingCheck( const ScTokenArray& rCode )
+{
+    if (HasLinkFormulaNeedingCheck())
+        return;
+
+    if (rCode.HasOpCodeRPN(ocDde) || rCode.HasOpCodeRPN(ocWebservice))
+        SetLinkFormulaNeedingCheck(true);
+}
+
 // TimerDelays etc.
 void ScDocument::KeyInput()
 {
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index c280d7276681..21d8dd015d59 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1360,8 +1360,7 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr
 
     //  After loading, it must be known if ocDde/ocWebservice is in any formula
     //  (for external links warning, CompileXML is called at the end of loading XML file)
-    if (!pDocument->HasLinkFormulaNeedingCheck() && (pCode->HasOpCodeRPN(ocDde) || pCode->HasOpCodeRPN(ocWebservice)))
-        pDocument->SetLinkFormulaNeedingCheck(true);
+    pDocument->CheckLinkFormulaNeedingCheck(*pCode);
 
     //volatile cells must be added here for import
     if( pCode->IsRecalcModeAlways() || pCode->IsRecalcModeForced() ||


More information about the Libreoffice-commits mailing list