summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-07-24 15:28:49 +0200
committerLuboš Luňák <l.lunak@collabora.com>2018-07-31 16:01:40 +0200
commit1bf7bc6f9929ceae0ea059b64ae0efa12228525f (patch)
treea682697177f49af89d62ec7042dd8ae2eb871663 /include/formula
parent58a15b452801f1f6f1b3e9f2fef49a1249538ac5 (diff)
try to detect that a formula does not contain any implicit intersection
Commit 67444cbe disabled svDoubleRef completely for OpenCL, which means many formulas weren't handled by OpenCL even if the implicit intersection problems are quite rare. This patch tries to detect formulas implicit intersections in formulas and if it's certain that a formula does not contain one, then it's ok to use OpenCL with svDoubleRef. The detection is done by having ScCompiler analyze each opcode call and its parameters, which should provide sufficient information to know if implicit intersection can take place or not. The extra compilation can be avoided by using OpenCL's compilation and doing the svDoubleRef conversion later on the RPN code, to be done later. This is opt-in, so if unsure don't do anything, if it turns out that some opcode needs special handling, it can be simply added. Change-Id: Iaa52fa7eb8b14dc8c2b92384a21e2ab8efe0ddd7 Reviewed-on: https://gerrit.libreoffice.org/57959 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/FormulaCompiler.hxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
index 1f0bb0d95c5b..d50a2e2f8be1 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -330,12 +330,13 @@ protected:
bool MergeRangeReference( FormulaToken * * const pCode1, FormulaToken * const * const pCode2 );
// Returns whether the opcode has implicit intersection ranges as parameters.
- // This is no-op for this class.
- virtual bool IsIIOpCode(OpCode /*nOpCode*/) const { return false; }
- // Handles II opcode and passes the parameter array and number of parameters.
- virtual void HandleIIOpCode(OpCode /*nOpCode*/, formula::ParamClass /*eClass*/,
+ // Called for (most) opcodes to possibly handle implicit intersection for the parameters.
+ virtual void HandleIIOpCode(FormulaToken* /*token*/,
FormulaToken*** /*pppToken*/, sal_uInt8 /*nNumParams*/) {}
+ // Called from CompileTokenArray() after RPN code generation is done.
+ virtual void PostProcessCode() {}
+
OUString aCorrectedFormula; // autocorrected Formula
OUString aCorrectedSymbol; // autocorrected Symbol