Kaydet (Commit) 55e484c7 authored tarafından Eike Rathke's avatar Eike Rathke

Move implementation to CheckLinkFormulaNeedingCheck() for further reuse

Change-Id: I541d2b6e12a88371c064b901b00e71206ee0c18e
üst 34f1883e
......@@ -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; }
......
......@@ -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()
{
......
......@@ -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() ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment