summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/token.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/token.cxx')
-rw-r--r--sc/source/core/tool/token.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index dcbcc72f1de5..0a586073c7c6 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1337,16 +1337,28 @@ bool ScTokenArray::AddFormulaToken(
void ScTokenArray::CheckToken( const FormulaToken& r )
{
+ static const std::set<OpCode> aThreadedCalcBlackList({
+ ocMacro,
+ ocTableOp
+ });
+
if (IsFormulaVectorDisabled())
// It's already disabled. No more checking needed.
return;
static const bool bThreadingRequested = std::getenv("CPU_THREADED_CALCULATION");
+ OpCode eOp = r.GetOpCode();
+
if (!ScCalcConfig::isOpenCLEnabled() && bThreadingRequested)
+ {
+ if (aThreadedCalcBlackList.count(eOp))
+ {
+ meVectorState = FormulaVectorDisabledNotInSubSet;
+ SAL_INFO("sc.core.formulagroup", "opcode " << formula::FormulaCompiler().GetOpCodeMap(sheet::FormulaLanguage::ENGLISH)->getSymbol(eOp) << " disables threaded calculation of formula group");
+ }
return;
-
- OpCode eOp = r.GetOpCode();
+ }
if (SC_OPCODE_START_FUNCTION <= eOp && eOp < SC_OPCODE_STOP_FUNCTION)
{