summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/conditio.cxx6
-rw-r--r--sc/source/core/data/documen8.cxx17
-rw-r--r--sc/source/filter/excel/xicontent.cxx6
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx2
4 files changed, 29 insertions, 2 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index c4b32cd813dd..2beedf0b1a54 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -472,6 +472,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 )
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index cc77c70a0b3a..9734ce650f5f 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1159,8 +1159,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.
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 8534f8a68832..73513ee17e81 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -657,7 +657,10 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize1, false, FT_CondFormat );
// formula converter owns pTokArr -> create a copy of the token array
if( pTokArr )
+ {
xTokArr1.reset( pTokArr->Clone() );
+ GetDocRef().CheckLinkFormulaNeedingCheck( *xTokArr1);
+ }
}
::std::unique_ptr< ScTokenArray > pTokArr2;
@@ -668,7 +671,10 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize2, false, FT_CondFormat );
// formula converter owns pTokArr -> create a copy of the token array
if( pTokArr )
+ {
pTokArr2.reset( pTokArr->Clone() );
+ GetDocRef().CheckLinkFormulaNeedingCheck( *pTokArr2);
+ }
}
// *** create the Calc conditional formatting ***
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 98f654f2610b..d1e230ecb58e 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -867,11 +867,13 @@ void CondFormatRule::finalizeImport()
{
pTokenArray2.reset(new ScTokenArray());
ScTokenConversion::ConvertToTokenArray( rDoc, *pTokenArray2.get(), maModel.maFormulas[ 1 ] );
+ rDoc.CheckLinkFormulaNeedingCheck( *pTokenArray2.get());
}
ScTokenArray aTokenArray;
OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, maModel.maFormulas[ 0 ] );
+ rDoc.CheckLinkFormulaNeedingCheck( aTokenArray);
ScCondFormatEntry* pNewEntry = new ScCondFormatEntry(eOperator,
&aTokenArray, pTokenArray2.get(), &rDoc, aPos, aStyleName);
mpFormat->AddEntry(pNewEntry);