summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-01-25 13:20:27 +0100
committerEike Rathke <erack@redhat.com>2018-01-25 14:45:30 +0100
commitfaa0305ba3d0dc698fce4915d4f3a1fb52422380 (patch)
tree241795a54739f854bfa80b2b3de702d3fa75d45d /sc
parent6feeb77552c38e3d9819611e9678470a44c00c84 (diff)
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
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen8.cxx17
1 files changed, 15 insertions, 2 deletions
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.