summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-01-17 22:22:55 +0100
committerEike Rathke <erack@redhat.com>2018-01-17 22:23:48 +0100
commit55e484c7bcd3ef218e08d3fd93f97bf98fd8cb7f (patch)
tree05d0435c162a126aa1c5749ad504547397b92a17
parent34f1883e35ef9d8c35502b092b75b39ab47d221c (diff)
Move implementation to CheckLinkFormulaNeedingCheck() for further reuse
Change-Id: I541d2b6e12a88371c064b901b00e71206ee0c18e
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/source/core/data/documen8.cxx10
-rw-r--r--sc/source/core/data/formulacell.cxx3
3 files changed, 13 insertions, 2 deletions
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() ||