[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sc/source

Luboš Luňák l.lunak at collabora.com
Tue Jun 12 20:12:45 UTC 2018


 sc/source/core/tool/token.cxx |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 36b2b687afa58d4d2043115b5bd9df58e6b9710a
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Tue Jun 12 13:03:09 2018 +0200

    do not even consider ScTokenArray for OpenCL if it's disabled
    
    If sc/qa/unit/data/ods/functions.ods is run with OpenCL disabled
    (and the mnOpenCLMinimumFormulaGroupSize check disabled too), then
    ScTokenArray::CheckToken() considers the token for OpenCL, and if
    the token is ocExternal, it passes all the related OpenCL checks,
    and thus ScTokenArray::CheckForThreading() is never called.
    However, since OpenCL is disabled, then actually the threaded code
    will be executed, since the blacklisting for ocExternal has not been
    done.
    
    Change-Id: Ib4d4d63d3925746f6e13da0611ac869e9a094b5b
    Reviewed-on: https://gerrit.libreoffice.org/55676
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    (cherry picked from commit fb4ad5b0c766440e1a47d991c6cbc9cb017ada59)
    Reviewed-on: https://gerrit.libreoffice.org/55719
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
    Tested-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 7eb36aac5ced..cddc6294abd9 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1819,9 +1819,18 @@ void ScTokenArray::GenHash()
 
 void ScTokenArray::ResetVectorState()
 {
-    meVectorState = FormulaVectorEnabled;
-    mbOpenCLEnabled = true;
-    mbThreadingEnabled = !ScCalcConfig::isOpenCLEnabled() && ScCalcConfig::isThreadingEnabled();
+    if(ScCalcConfig::isOpenCLEnabled())
+    {
+        meVectorState = FormulaVectorEnabled;
+        mbOpenCLEnabled = true;
+        mbThreadingEnabled = false;
+    }
+    else
+    {
+        meVectorState = FormulaVectorDisabled;
+        mbOpenCLEnabled = false;
+        mbThreadingEnabled = ScCalcConfig::isThreadingEnabled();
+    }
 }
 
 bool ScTokenArray::IsFormulaVectorDisabled() const
@@ -1887,11 +1896,9 @@ bool ScTokenArray::IsValidReference( ScRange& rRange, const ScAddress& rPos ) co
 
 ScTokenArray::ScTokenArray() :
     FormulaTokenArray(),
-    mnHashValue(0),
-    meVectorState(FormulaVectorEnabled),
-    mbOpenCLEnabled(true),
-    mbThreadingEnabled(!ScCalcConfig::isOpenCLEnabled() && ScCalcConfig::isThreadingEnabled())
+    mnHashValue(0)
 {
+    ResetVectorState();
 }
 
 ScTokenArray::~ScTokenArray()
@@ -1929,9 +1936,7 @@ bool ScTokenArray::EqualTokens( const ScTokenArray* pArr2) const
 void ScTokenArray::Clear()
 {
     mnHashValue = 0;
-    meVectorState = FormulaVectorEnabled;
-    mbOpenCLEnabled = true;
-    mbThreadingEnabled = !ScCalcConfig::isOpenCLEnabled() && ScCalcConfig::isThreadingEnabled();
+    ResetVectorState();
     FormulaTokenArray::Clear();
 }
 


More information about the Libreoffice-commits mailing list