[Libreoffice-commits] core.git: Branch 'private/tml/opencl-default-1' - 283 commits - accessibility/source avmedia/source basctl/source basegfx/source basic/source bin/lo-all-static-libs bridges/source canvas/source chart2/inc chart2/qa chart2/source comphelper/source compilerplugins/clang config_host.mk.in configmgr/qa configure.ac connectivity/source cppu/source cpputools/source crashrep/source cui/source cui/uiconfig dbaccess/source desktop/source drawinglayer/source editeng/source extensions/source external/cppunit external/icu external/lpsolve external/python3 filter/source filter/uiconfig forms/source fpicker/source framework/source helpcontent2 hwpfilter/source icon-themes/crystal icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/industrial icon-themes/oxygen icon-themes/sifr icon-themes/tango icon-themes/tango_testing idlc/source include/canvas include/comphelper include/editeng include/formula include/oox include/rsc include/rtl include/svx include/toolkit include/v cl jvmfwk/plugins l10ntools/source linguistic/source Makefile.in mysqlc/source odk/qa offapi/com offapi/UnoApi_offapi.mk officecfg/registry oox/source package/source registry/source reportdesign/source Repository.mk rsc/inc rsc/source sal/qa sal/rtl sax/source scaddins/source sc/inc sc/Library_scfilt.mk scp2/source sc/qa scripting/source sc/source sc/uiconfig sdext/source sd/qa sd/source sd/uiconfig sfx2/sdi sfx2/source slideshow/test starmath/inc starmath/source store/source svgio/inc svgio/source svl/source svtools/langsupport svtools/source svx/inc svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk svx/workben sw/CppunitTest_sw_tox.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Module_sw.mk sw/qa sw/source sw/uiconfig toolkit/source tools/source ucb/source unoidl/source unotest/source unotools/source unoxml/Library_unoxml.mk unoxml/source unusedcode.easy vbahelper/source vcl/generic vcl/inc vcl/osx vcl/qa vcl/source vcl/unx vcl/workben winaccessibility/source write rfilter/source xmlhelp/source xmloff/source xmlscript/source

Tor Lillqvist tml at collabora.com
Thu Nov 6 02:04:56 PST 2014


Rebased ref, commits from common ancestor:
commit 1449f862606abb57fd7dffdf257ce3895b120a02
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 6 11:59:22 2014 +0200

    Be more specific in warning
    
    Change-Id: I96d5dc1267af714e78e431581592e75f0bff73f4

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 68f5c9d..9431819 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -293,7 +293,8 @@ VclBuilder::VclBuilder(vcl::Window *pParent, const OUString& sUIDir, const OUStr
     {
         NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get<vcl::Window>(aI->m_sID));
         const Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue);
-        SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment");
+        SAL_WARN_IF(!pTarget, "vcl", "missing NumericFormatter element of spinbutton/adjustment");
+        SAL_WARN_IF(!pAdjustment, "vcl", "missing Adjustment element of spinbutton/adjustment");
         if (pTarget && pAdjustment)
             mungeAdjustment(*pTarget, *pAdjustment);
     }
commit 9b3410961e52b4666a118158512e050462711fd0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 6 09:56:49 2014 +0000

    Resolves: fdo#76581 copy-and-paste -> slideshow crash in presenter console
    
    crash started after...
    
    commit 0218b0e2fa510d7acd7413dbedefd9ad50257f76
    Date:   Mon Jul 15 19:45:44 2013 +0300
        fdo#65457 -  Provide visual clues in presenter view.
    
    Change-Id: I19d84800bd5924f2dcc9e5debcf18ef95577105c

diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 43d60ac..6c64bd7 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -358,7 +358,7 @@ void PresenterController::UpdatePaneTitles (void)
                     sCurrentSlideName = sName;
             }
         }
-        catch (beans::UnknownPropertyException&)
+        catch (const beans::UnknownPropertyException&)
         {
         }
     }
@@ -585,10 +585,16 @@ bool PresenterController::HasTransition (Reference<drawing::XDrawPage>& rxPage)
     if( rxPage.is() )
     {
         Reference<beans::XPropertySet> xSlidePropertySet (rxPage, UNO_QUERY);
-        xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType;
-        if( aTransitionType > 0 )
+        try
+        {
+            xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType;
+            if (aTransitionType > 0)
+            {
+                bTransition = true;
+            }
+        }
+        catch (const beans::UnknownPropertyException&)
         {
-            bTransition = true;
         }
     }
     return bTransition;
@@ -597,8 +603,6 @@ bool PresenterController::HasTransition (Reference<drawing::XDrawPage>& rxPage)
 bool PresenterController::HasCustomAnimation (Reference<drawing::XDrawPage>& rxPage)
 {
     bool bCustomAnimation = false;
-    presentation::AnimationEffect aEffect = presentation::AnimationEffect_NONE;
-    presentation::AnimationEffect aTextEffect = presentation::AnimationEffect_NONE;
     if( rxPage.is() )
     {
         sal_uInt32 i, nCount = rxPage->getCount();
@@ -606,8 +610,16 @@ bool PresenterController::HasCustomAnimation (Reference<drawing::XDrawPage>& rxP
         {
             Reference<drawing::XShape> xShape(rxPage->getByIndex(i), UNO_QUERY);
             Reference<beans::XPropertySet> xShapePropertySet(xShape, UNO_QUERY);
-            xShapePropertySet->getPropertyValue("Effect") >>= aEffect;
-            xShapePropertySet->getPropertyValue("TextEffect") >>= aTextEffect;
+            presentation::AnimationEffect aEffect = presentation::AnimationEffect_NONE;
+            presentation::AnimationEffect aTextEffect = presentation::AnimationEffect_NONE;
+            try
+            {
+                xShapePropertySet->getPropertyValue("Effect") >>= aEffect;
+                xShapePropertySet->getPropertyValue("TextEffect") >>= aTextEffect;
+            }
+            catch (const beans::UnknownPropertyException&)
+            {
+            }
             if( aEffect != presentation::AnimationEffect_NONE ||
                 aTextEffect != presentation::AnimationEffect_NONE )
             {
commit e0d9303042192ee70d9a387bdf06a1e538124640
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 6 11:48:18 2014 +0200

    Bin unused "description" labels
    
    Change-Id: I8710b698904d5c89644633bb53b78a95dcef7d7b

diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index 9a07859..959c2b1 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -224,19 +224,6 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel" id="os_desc">
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                                <property name="label" translatable="yes">Operating System, one of: Windows, Linux, OS X</property>
-                                <property name="wrap">True</property>
-                                <property name="max_width_chars">10</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">1</property>
-                              </packing>
-                            </child>
-                            <child>
                               <object class="GtkTextView" id="os:border">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -245,7 +232,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">2</property>
+                                <property name="top_attach">1</property>
                               </packing>
                             </child>
                             <child>
@@ -259,20 +246,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">3</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="osversion_desc">
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                                <property name="label" translatable="yes">Operating System Version, free form</property>
-                                <property name="wrap">True</property>
-                                <property name="max_width_chars">10</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">4</property>
+                                <property name="top_attach">2</property>
                               </packing>
                             </child>
                             <child>
@@ -284,7 +258,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">5</property>
+                                <property name="top_attach">3</property>
                               </packing>
                             </child>
                             <child>
@@ -298,20 +272,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">6</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="openclvendor_desc">
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                                <property name="label" translatable="yes">OpenCL Platform Vendor</property>
-                                <property name="wrap">True</property>
-                                <property name="max_width_chars">56</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">7</property>
+                                <property name="top_attach">4</property>
                               </packing>
                             </child>
                             <child>
@@ -323,7 +284,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">8</property>
+                                <property name="top_attach">5</property>
                               </packing>
                             </child>
                             <child>
@@ -337,20 +298,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">9</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="opencldevice_desc">
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                                <property name="label" translatable="yes">OpenCL Device</property>
-                                <property name="wrap">True</property>
-                                <property name="max_width_chars">56</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">10</property>
+                                <property name="top_attach">6</property>
                               </packing>
                             </child>
                             <child>
@@ -362,7 +310,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">11</property>
+                                <property name="top_attach">7</property>
                               </packing>
                             </child>
                             <child>
@@ -376,20 +324,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">12</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="opencldriverversion_desc">
-                                <property name="can_focus">False</property>
-                                <property name="no_show_all">True</property>
-                                <property name="label" translatable="yes">OpenCL Driver Version</property>
-                                <property name="wrap">True</property>
-                                <property name="max_width_chars">56</property>
-                              </object>
-                              <packing>
-                                <property name="left_attach">0</property>
-                                <property name="top_attach">13</property>
+                                <property name="top_attach">8</property>
                               </packing>
                             </child>
                             <child>
@@ -401,7 +336,7 @@
                               </object>
                               <packing>
                                 <property name="left_attach">0</property>
-                                <property name="top_attach">14</property>
+                                <property name="top_attach">9</property>
                               </packing>
                             </child>
                           </object>
commit 731ddce00fc704a1415f030f3accce99d3909e2d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 6 09:58:32 2014 +0200

    Fix non-dbgutil build where OpCode is sal_uInt16 and not OpCodeEnum
    
    Change-Id: Ie88b0b23b7b6f688f920f5aadcf711ba15602686

diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 529f86d..47499d0 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -190,7 +190,7 @@ std::set<OpCodeEnum> SC_DLLPUBLIC ScStringToOpCodeSet(const OUString& rOpCodes)
             {
                 auto opcode(pHashMap->find(element));
                 if (opcode != pHashMap->end())
-                    result.insert(opcode->second);
+                    result.insert(static_cast<OpCodeEnum>(opcode->second));
                 else
                     SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << " in OpCode set string");
             }
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 93b3778..9d86b3e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1219,7 +1219,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
 
     if (SC_OPCODE_START_FUNCTION <= eOp && eOp < SC_OPCODE_STOP_FUNCTION)
     {
-        if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
+        if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(static_cast<OpCodeEnum>(eOp)) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
         {
             meVectorState = FormulaVectorDisabled;
             return;
@@ -1460,7 +1460,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
     if (eOp >= SC_OPCODE_START_BIN_OP &&
         eOp <= SC_OPCODE_STOP_UN_OP &&
         ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
-        ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
+        ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(static_cast<OpCodeEnum>(eOp)) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
     {
         meVectorState = FormulaVectorDisabled;
         return;
commit 959a9947ccdd553ddc59bc9e4ed003212878c1a2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 6 08:41:49 2014 +0200

    D'oh, it's oor:separator. Thanks to dtardon for pointing it out to me
    
    I guess it would be futile to expect some warning at run-time about an
    unrecognized attribute.
    
    Change-Id: I04ccaa6df8ec932f747384486174c1fd23eb110a

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index ba44e30..46edbf2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1401,7 +1401,7 @@
           <info>
             <desc>Like OpenCLWhiteList, but for combinations known to be bad.</desc>
           </info>
-          <value separator=";">Windows/*/Intel(R) Corporation/9.17.10.2884;SuperOS/1.0/Big Corp, Inc./2.3\/beta</value>
+          <value oor:separator=";">Windows/*/Intel(R) Corporation/9.17.10.2884;SuperOS/1.0/Big Corp, Inc./2.3\/beta</value>
         </prop>
       </group>
       <group oor:name="Syntax">
commit e50bb871ecf32ab32f909ba3bbd528e0f941b46a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Nov 6 08:40:49 2014 +0200

    Bin unnecessary variables
    
    Doing .ui "manually" is not *that* verbose;)
    
    Change-Id: Ide50258174e86cc94975a33c5c0e5c663ae8d77c

diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index e1de436..286cc7f 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -201,21 +201,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     maCaptionOpenCLBlackList = get<vcl::Window>("opencl_blacklist")->GetText();
     maDescOpenCLBlackList = get<vcl::Window>("opencl_blacklist_desc")->GetText();
 
-    maCaptionOS = get<vcl::Window>("oslabel")->GetText();
-    maDescOS = get<vcl::Window>("os_desc")->GetText();
-
-    maCaptionOSVersion = get<vcl::Window>("osversionlabel")->GetText();
-    maDescOSVersion = get<vcl::Window>("osversion_desc")->GetText();
-
-    maCaptionOpenCLVendor = get<vcl::Window>("openclvendorlabel")->GetText();
-    maDescOpenCLVendor = get<vcl::Window>("openclvendor_desc")->GetText();
-
-    maCaptionOpenCLDevice = get<vcl::Window>("opencldevicelabel")->GetText();
-    maDescOpenCLDevice = get<vcl::Window>("opencldevice_desc")->GetText();
-
-    maCaptionOpenCLDriverVersion = get<vcl::Window>("opencldriverversionlabel")->GetText();
-    maDescOpenCLDriverVersion = get<vcl::Window>("opencldriverversion_desc")->GetText();
-
     maSoftware = get<vcl::Window>("software")->GetText();
 
     mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight());
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index a4aa684..860f943 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -129,21 +129,6 @@ private:
     OUString maCaptionOpenCLBlackList;
     OUString maDescOpenCLBlackList;
 
-    OUString maCaptionOS;
-    OUString maDescOS;
-
-    OUString maCaptionOSVersion;
-    OUString maDescOSVersion;
-
-    OUString maCaptionOpenCLVendor;
-    OUString maDescOpenCLVendor;
-
-    OUString maCaptionOpenCLDevice;
-    OUString maDescOpenCLDevice;
-
-    OUString maCaptionOpenCLDriverVersion;
-    OUString maDescOpenCLDriverVersion;
-
     OUString maSoftware;
 
     ScCalcConfig maConfig;
commit 97a74ee6b86532ac9c1f5c4b2d0d0a557e5ddb59
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Nov 5 23:15:20 2014 +0200

    Intermediate commit: start on whitelist/blacklist of OpenCL implementations
    
    Change-Id: I5a6ef8f5e428ec4e62b3fdac8fe3e63f0ae58f1b

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index d0eb9d1..ba44e30 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1389,6 +1389,20 @@
           </info>
           <value/>
         </prop>
+        <prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
+          <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
+          <info>
+            <desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
+          </info>
+          <value/>
+        </prop>
+        <prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
+          <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
+          <info>
+            <desc>Like OpenCLWhiteList, but for combinations known to be bad.</desc>
+          </info>
+          <value separator=";">Windows/*/Intel(R) Corporation/9.17.10.2884;SuperOS/1.0/Big Corp, Inc./2.3\/beta</value>
+        </prop>
       </group>
       <group oor:name="Syntax">
         <info>
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 3a54efd..aa286a0 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -52,6 +52,9 @@ struct SC_DLLPUBLIC ScCalcConfig
     sal_Int32 mnOpenCLMinimumFormulaGroupSize;
     std::set<OpCodeEnum> maOpenCLSubsetOpCodes;
 
+    std::set<OUString> maOpenCLWhiteList;
+    std::set<OUString> maOpenCLBlackList;
+
     ScCalcConfig();
 
     void setOpenCLConfigToDefault();
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 7d50d78..529f86d 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -38,6 +38,10 @@ void ScCalcConfig::setOpenCLConfigToDefault()
     mbOpenCLAutoSelect = true;
     mnOpenCLMinimumFormulaGroupSize = 20;
     maOpenCLSubsetOpCodes = {ocMin, ocMax, ocSum, ocAverage, ocSumIfs};
+    maOpenCLBlackList = {
+        "Windows/*/Intel(R) Corporation/9.17.10.2884",
+        "SuperOS/1.0/Big Corp, Inc./2.3\\/beta"
+    };
 }
 
 void ScCalcConfig::reset()
@@ -64,7 +68,9 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
            mbOpenCLAutoSelect == r.mbOpenCLAutoSelect &&
            maOpenCLDevice == r.maOpenCLDevice &&
            mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize &&
-           maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes;
+           maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes &&
+           maOpenCLWhiteList == r.maOpenCLWhiteList &&
+           maOpenCLBlackList == r.maOpenCLBlackList;
 }
 
 bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
@@ -72,6 +78,20 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
     return !operator==(r);
 }
 
+namespace {
+
+void writeStringSet(std::ostream& rStream, const std::set<OUString>& rSet)
+{
+    for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+    {
+        if (i != rSet.cbegin())
+            rStream << ",";
+        rStream << (*i).replaceAll(",", "\\,");
+    }
+}
+
+} // anonymous namespace
+
 std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
 {
     rStream << "{"
@@ -83,7 +103,13 @@ std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig&
         "OpenCLAutoSelect=" << (rConfig.mbOpenCLAutoSelect?"Y":"N") << ","
         "OpenCLDevice='" << rConfig.maOpenCLDevice << "',"
         "OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << ","
-        "OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "}"
+        "OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "},"
+        "OpenCLWhiteList={";
+    writeStringSet(rStream, rConfig.maOpenCLWhiteList);
+    rStream << "},"
+        "OpenCLBlackList={";
+    writeStringSet(rStream, rConfig.maOpenCLBlackList);
+    rStream << "}"
         "}";
     return rStream;
 }
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 22bf452..aa2b7a1 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -203,7 +203,9 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
 #define SCFORMULAOPT_OPENCL_SUBSET_ONLY  13
 #define SCFORMULAOPT_OPENCL_MIN_SIZE     14
 #define SCFORMULAOPT_OPENCL_SUBSET_OPS   15
-#define SCFORMULAOPT_COUNT               16
+#define SCFORMULAOPT_OPENCL_WHITELIST    16
+#define SCFORMULAOPT_OPENCL_BLACKLIST    17
+#define SCFORMULAOPT_COUNT               18
 
 Sequence<OUString> ScFormulaCfg::GetPropertyNames()
 {
@@ -225,6 +227,8 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
         "Calculation/OpenCLSubsetOnly",  // SCFORMULAOPT_OPENCL_SUBSET_ONLY
         "Calculation/OpenCLMinimumDataSize",  // SCFORMULAOPT_OPENCL_MIN_SIZE
         "Calculation/OpenCLSubsetOpCodes",    // SCFORMULAOPT_OPENCL_SUBSET_OPS
+        "Calculation/OpenCLWhiteList",    // SCFORMULAOPT_OPENCL_WHITELIST
+        "Calculation/OpenCLBlackList",    // SCFORMULAOPT_OPENCL_BLACKLIST
     };
     Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
     OUString* pNames = aNames.getArray();
@@ -254,6 +258,8 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
         SCFORMULAOPT_OPENCL_SUBSET_ONLY,
         SCFORMULAOPT_OPENCL_MIN_SIZE,
         SCFORMULAOPT_OPENCL_SUBSET_OPS,
+        SCFORMULAOPT_OPENCL_WHITELIST,
+        SCFORMULAOPT_OPENCL_BLACKLIST,
     };
     OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync");
     PropsToIds aPropIdMap;
@@ -270,6 +276,35 @@ ScFormulaCfg::ScFormulaCfg() :
     EnableNotification( aNames );
 }
 
+namespace {
+
+css::uno::Sequence<OUString> StringSetToStringSequence(std::set<OUString>& rSet)
+{
+    css::uno::Sequence<OUString> result(rSet.size());
+
+    size_t n(0);
+    for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+    {
+        result[n++] = *i;
+    }
+
+    return result;
+}
+
+std::set<OUString> StringSequenceToStringSet(css::uno::Sequence<OUString>& rSequence)
+{
+    std::set<OUString> result;
+
+    for (auto i = rSequence.begin(); i != rSequence.end(); ++i)
+    {
+        result.insert(*i);
+    }
+
+    return result;
+}
+
+} // anonymous namespace
+
 void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
 {
     Sequence<Any> aValues = GetProperties(aNames);
@@ -512,8 +547,20 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
                     GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
                 }
                 break;
-                default:
-                    ;
+                case SCFORMULAOPT_OPENCL_WHITELIST:
+                {
+                    css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLWhiteList);
+                    pValues[nProp] >>= sVal;
+                    GetCalcConfig().maOpenCLWhiteList = StringSequenceToStringSet(sVal);
+                }
+                break;
+                case SCFORMULAOPT_OPENCL_BLACKLIST:
+                {
+                    css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLBlackList);
+                    pValues[nProp] >>= sVal;
+                    GetCalcConfig().maOpenCLBlackList = StringSequenceToStringSet(sVal);
+                }
+                break;
                 }
             }
         }
@@ -667,8 +714,18 @@ void ScFormulaCfg::Commit()
                 pValues[nProp] <<= sVal;
             }
             break;
-            default:
-                ;
+            case SCFORMULAOPT_OPENCL_WHITELIST:
+            {
+                css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLWhiteList);
+                pValues[nProp] <<= sVal;
+            }
+            break;
+            case SCFORMULAOPT_OPENCL_BLACKLIST:
+            {
+                css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLBlackList);
+                pValues[nProp] <<= sVal;
+            }
+            break;
         }
     }
     if(bSetOpenCL)
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index b479aa3..e1de436 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -29,7 +29,9 @@ typedef enum {
     CALC_OPTION_ENABLE_OPENCL,
     CALC_OPTION_ENABLE_OPENCL_SUBSET,
     CALC_OPTION_OPENCL_MIN_SIZE,
-    CALC_OPTION_OPENCL_SUBSET_OPS
+    CALC_OPTION_OPENCL_SUBSET_OPS,
+    CALC_OPTION_OPENCL_WHITELIST,
+    CALC_OPTION_OPENCL_BLACKLIST,
 } CalcOptionOrder;
 
 class OptionString : public SvLBoxString
@@ -141,6 +143,11 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     get(mpBtnFalse, "false");
     get(mpSpinButton, "spinbutton");
     get(mpEditField, "entry");
+    get(mpListGrid, "listgrid");
+    get(mpListBox, "listbox");
+    get(mpListEditButton, "listbox-edit");
+    get(mpListNewButton, "listbox-new");
+    get(mpListDeleteButton, "listbox-delete");
     get(mpOpenclInfoList, "opencl_list");
     get(mpBtnAutomaticSelectionTrue, "automatic_select_true");
     get(mpBtnAutomaticSelectionFalse, "automatic_select_false");
@@ -151,6 +158,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, NumModifiedHdl));
     mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
 
+    mpListBox->set_height_request(4* mpListBox->GetTextHeight());
+    mpListBox->SetStyle(mpListBox->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
+
     mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight());
     mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
     mpOpenclInfoList->SetHighlightRange();
@@ -185,6 +195,27 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     maCaptionOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes")->GetText();
     maDescOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes_desc")->GetText();
 
+    maCaptionOpenCLWhiteList = get<vcl::Window>("opencl_whitelist")->GetText();
+    maDescOpenCLWhiteList = get<vcl::Window>("opencl_whitelist_desc")->GetText();
+
+    maCaptionOpenCLBlackList = get<vcl::Window>("opencl_blacklist")->GetText();
+    maDescOpenCLBlackList = get<vcl::Window>("opencl_blacklist_desc")->GetText();
+
+    maCaptionOS = get<vcl::Window>("oslabel")->GetText();
+    maDescOS = get<vcl::Window>("os_desc")->GetText();
+
+    maCaptionOSVersion = get<vcl::Window>("osversionlabel")->GetText();
+    maDescOSVersion = get<vcl::Window>("osversion_desc")->GetText();
+
+    maCaptionOpenCLVendor = get<vcl::Window>("openclvendorlabel")->GetText();
+    maDescOpenCLVendor = get<vcl::Window>("openclvendor_desc")->GetText();
+
+    maCaptionOpenCLDevice = get<vcl::Window>("opencldevicelabel")->GetText();
+    maDescOpenCLDevice = get<vcl::Window>("opencldevice_desc")->GetText();
+
+    maCaptionOpenCLDriverVersion = get<vcl::Window>("opencldriverversionlabel")->GetText();
+    maDescOpenCLDriverVersion = get<vcl::Window>("opencldriverversion_desc")->GetText();
+
     maSoftware = get<vcl::Window>("software")->GetText();
 
     mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight());
@@ -237,6 +268,16 @@ SvTreeListEntry *ScCalcOptionsDialog::createStringItem(const OUString &rCaption,
     return pEntry;
 }
 
+SvTreeListEntry *ScCalcOptionsDialog::createStringListItem(const OUString &rCaption) const
+{
+    SvTreeListEntry* pEntry = new SvTreeListEntry;
+    pEntry->AddItem(new SvLBoxString(pEntry, 0, OUString()));
+    pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false));
+    OptionString* pItem = new OptionString(rCaption, "");
+    pEntry->AddItem(pItem);
+    return pEntry;
+}
+
 void ScCalcOptionsDialog::setValueAt(size_t nPos, const OUString &rValue)
 {
     SvTreeList *pModel = mpLbSettings->GetModel();
@@ -276,7 +317,7 @@ void ScCalcOptionsDialog::fillOpenCLList()
         for(std::vector<sc::OpenCLDeviceInfo>::iterator
                 itr = it->maDevices.begin(), itrEnd = it->maDevices.end(); itr != itrEnd; ++itr)
         {
-            OUString aDeviceId = it->maVendor + " " + itr->maName;
+            OUString aDeviceId = it->maVendor + " " + itr->maName + " " + itr->maDriver;
             SvTreeListEntry* pEntry = mpOpenclInfoList->InsertEntry(aDeviceId);
             if(aDeviceId == aStoredDevice)
             {
@@ -297,6 +338,23 @@ void ScCalcOptionsDialog::fillOpenCLList()
     SelectedDeviceChanged();
 }
 
+namespace {
+
+void fillListBox(ListBox* pListBox, const std::set<OUString>& rSet)
+{
+    pListBox->SetUpdateMode(false);
+    pListBox->Clear();
+
+    for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
+    {
+        pListBox->InsertEntry(*i, LISTBOX_APPEND);
+    }
+
+    pListBox->SetUpdateMode(true);
+}
+
+} // anonymous namespace
+
 #endif
 
 namespace {
@@ -338,6 +396,8 @@ void ScCalcOptionsDialog::FillOptionsList()
     pModel->Insert(createBoolItem(maCaptionOpenCLSubsetEnabled,maConfig.mbOpenCLSubsetOnly));
     pModel->Insert(createIntegerItem(maCaptionOpenCLMinimumFormulaSize,maConfig.mnOpenCLMinimumFormulaGroupSize));
     pModel->Insert(createStringItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes)));
+    pModel->Insert(createStringListItem(maCaptionOpenCLWhiteList));
+    pModel->Insert(createStringListItem(maCaptionOpenCLBlackList));
 
     fillOpenCLList();
 
@@ -360,6 +420,7 @@ void ScCalcOptionsDialog::SelectionChanged()
             mpBtnFalse->Hide();
             mpSpinButton->Hide();
             mpEditField->Hide();
+            mpListGrid->Hide();
             mpLbOptionEdit->Show();
             mpOpenclInfoList->GetParent()->Hide();
 
@@ -394,6 +455,7 @@ void ScCalcOptionsDialog::SelectionChanged()
             mpBtnFalse->Hide();
             mpSpinButton->Hide();
             mpEditField->Hide();
+            mpListGrid->Hide();
             mpLbOptionEdit->Show();
             mpOpenclInfoList->GetParent()->Hide();
 
@@ -426,12 +488,12 @@ void ScCalcOptionsDialog::SelectionChanged()
         case CALC_OPTION_ENABLE_OPENCL:
         case CALC_OPTION_ENABLE_OPENCL_SUBSET:
         {
-            // Treat empty string as zero.
             mpLbOptionEdit->Hide();
             mpBtnTrue->Show();
             mpBtnFalse->Show();
             mpSpinButton->Hide();
             mpEditField->Hide();
+            mpListGrid->Hide();
 
             bool bValue = false;
             bool bEnable = true;
@@ -508,6 +570,7 @@ void ScCalcOptionsDialog::SelectionChanged()
             mpBtnFalse->Hide();
             mpSpinButton->Show();
             mpEditField->Hide();
+            mpListGrid->Hide();
             mpOpenclInfoList->GetParent()->Hide();
             mpFtAnnotation->SetText(maDescOpenCLMinimumFormulaSize);
             mpSpinButton->SetValue(nValue);
@@ -524,11 +587,37 @@ void ScCalcOptionsDialog::SelectionChanged()
             mpBtnFalse->Hide();
             mpSpinButton->Hide();
             mpEditField->Show();
+            mpListGrid->Hide();
             mpOpenclInfoList->GetParent()->Hide();
             mpFtAnnotation->SetText(maDescOpenCLSubsetOpCodes);
             mpEditField->SetText(sValue);
         }
         break;
+
+        // string lists
+        case CALC_OPTION_OPENCL_WHITELIST:
+        case CALC_OPTION_OPENCL_BLACKLIST:
+        {
+            // SAL _DEBUG(__FILE__ ":" << __LINE__ << ": " << maConfig);
+            mpLbOptionEdit->Hide();
+            mpBtnTrue->Hide();
+            mpBtnFalse->Hide();
+            mpSpinButton->Hide();
+            mpEditField->Hide();
+            mpListGrid->Show();
+            mpOpenclInfoList->GetParent()->Hide();
+            if ( nSelectedPos == CALC_OPTION_OPENCL_WHITELIST )
+            {
+                mpFtAnnotation->SetText(maDescOpenCLWhiteList);
+                fillListBox(mpListBox, maConfig.maOpenCLWhiteList);
+            }
+            else
+            {
+                mpFtAnnotation->SetText(maDescOpenCLBlackList);
+                fillListBox(mpListBox, maConfig.maOpenCLBlackList);
+            }
+        }
+        break;
     }
 }
 
@@ -582,7 +671,9 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
         case CALC_OPTION_ENABLE_OPENCL_SUBSET:
         case CALC_OPTION_OPENCL_MIN_SIZE:
         case CALC_OPTION_OPENCL_SUBSET_OPS:
-            break;
+        case CALC_OPTION_OPENCL_WHITELIST:
+        case CALC_OPTION_OPENCL_BLACKLIST:
+        break;
     }
 }
 
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 5676cfc..a4aa684 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -17,6 +17,7 @@
 #include <vcl/edit.hxx>
 #include <vcl/field.hxx>
 #include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/lstbox.hxx>
 #include <svx/checklbx.hxx>
 #include <svtools/treelistbox.hxx>
@@ -62,6 +63,7 @@ private:
     SvTreeListEntry *createBoolItem(const OUString &rCaption, bool bValue) const;
     SvTreeListEntry *createIntegerItem(const OUString &rCaption, sal_Int32 nValue) const;
     SvTreeListEntry *createStringItem(const OUString &rCaption, const OUString& sValue) const;
+    SvTreeListEntry *createStringListItem(const OUString &rCaption) const;
     void     setValueAt(size_t nPos, const OUString &rString);
 
 private:
@@ -72,6 +74,11 @@ private:
     RadioButton* mpBtnFalse;
     NumericField* mpSpinButton;
     Edit* mpEditField;
+    VclGrid* mpListGrid;
+    ListBox* mpListBox;
+    PushButton* mpListEditButton;
+    PushButton* mpListNewButton;
+    PushButton* mpListDeleteButton;
 
     FixedText* mpFtAnnotation;
     FixedText* mpFtFrequency;
@@ -116,6 +123,27 @@ private:
     OUString maCaptionOpenCLSubsetOpCodes;
     OUString maDescOpenCLSubsetOpCodes;
 
+    OUString maCaptionOpenCLWhiteList;
+    OUString maDescOpenCLWhiteList;
+
+    OUString maCaptionOpenCLBlackList;
+    OUString maDescOpenCLBlackList;
+
+    OUString maCaptionOS;
+    OUString maDescOS;
+
+    OUString maCaptionOSVersion;
+    OUString maDescOSVersion;
+
+    OUString maCaptionOpenCLVendor;
+    OUString maDescOpenCLVendor;
+
+    OUString maCaptionOpenCLDevice;
+    OUString maDescOpenCLDevice;
+
+    OUString maCaptionOpenCLDriverVersion;
+    OUString maDescOpenCLDriverVersion;
+
     OUString maSoftware;
 
     ScCalcConfig maConfig;
diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index 0aaef43..9a07859 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -184,6 +184,290 @@
                         <property name="top_attach">0</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkGrid" id="listgrid">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <child>
+                          <object class="GtkTreeView" id="listbox:border">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkGrid">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="orientation">vertical</property>
+                            <property name="vexpand">True</property>
+                            <property name="row_spacing">6</property>
+                            <child>
+                              <object class="GtkLabel" id="oslabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">_OS</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">os:border</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="os_desc">
+                                <property name="can_focus">False</property>
+                                <property name="no_show_all">True</property>
+                                <property name="label" translatable="yes">Operating System, one of: Windows, Linux, OS X</property>
+                                <property name="wrap">True</property>
+                                <property name="max_width_chars">10</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTextView" id="os:border">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="osversionlabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">OS _Version</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">osversion:border</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">3</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="osversion_desc">
+                                <property name="can_focus">False</property>
+                                <property name="no_show_all">True</property>
+                                <property name="label" translatable="yes">Operating System Version, free form</property>
+                                <property name="wrap">True</property>
+                                <property name="max_width_chars">10</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">4</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTextView" id="osversion:border">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">5</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="openclvendorlabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">OpenCL Platform Vendor</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">openclvendor:border</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">6</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="openclvendor_desc">
+                                <property name="can_focus">False</property>
+                                <property name="no_show_all">True</property>
+                                <property name="label" translatable="yes">OpenCL Platform Vendor</property>
+                                <property name="wrap">True</property>
+                                <property name="max_width_chars">56</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">7</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTextView" id="openclvendor:border">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">8</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="opencldevicelabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">OpenCL Device</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">opencldevice:border</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">9</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="opencldevice_desc">
+                                <property name="can_focus">False</property>
+                                <property name="no_show_all">True</property>
+                                <property name="label" translatable="yes">OpenCL Device</property>
+                                <property name="wrap">True</property>
+                                <property name="max_width_chars">56</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">10</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTextView" id="opencldevice:border">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">11</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="opencldriverversionlabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">OpenCL Driver Version</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">opencldriverversion:border</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">12</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="opencldriverversion_desc">
+                                <property name="can_focus">False</property>
+                                <property name="no_show_all">True</property>
+                                <property name="label" translatable="yes">OpenCL Driver Version</property>
+                                <property name="wrap">True</property>
+                                <property name="max_width_chars">56</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">13</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkTextView" id="opencldriverversion:border">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="top_attach">14</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="top_attach">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkButtonBox" id="listbox-action_area1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">6</property>
+                            <property name="layout_style">start</property>
+                            <child>
+                              <object class="GtkButton" id="listbox-edit">
+                                <property name="label" translatable="yes">Edi_t...</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="listbox-new">
+                                <property name="label" translatable="yes">_New...</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="listbox-delete">
+                                <property name="label" translatable="yes">_Delete</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="left_attach">2</property>
+                            <property name="top_attach">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">5</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -393,7 +677,6 @@
                 <property name="height">1</property>
               </packing>
             </child>
-
             <child>
               <object class="GtkLabel" id="opencl_subset_enabled">
                 <property name="can_focus">False</property>
@@ -422,7 +705,6 @@
                 <property name="height">1</property>
               </packing>
             </child>
-
             <child>
               <object class="GtkLabel" id="opencl_minimum_size">
                 <property name="can_focus">False</property>
@@ -451,7 +733,6 @@
                 <property name="height">1</property>
               </packing>
             </child>
-
             <child>
               <object class="GtkLabel" id="opencl_subset_opcodes">
                 <property name="can_focus">False</property>
@@ -480,7 +761,62 @@
                 <property name="height">1</property>
               </packing>
             </child>
-
+            <child>
+              <object class="GtkLabel" id="opencl_whitelist">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">List known-good OpenCL implementations</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">23</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_whitelist_desc">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">List of known-good OpenCL implementations.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">24</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_blacklist">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">List of known-bad OpenCL implementations</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">25</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_blacklist_desc">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">List of known-bad OpenCL implementations.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">26</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkGrid" id="grid6">
                 <property name="can_focus">False</property>
@@ -673,7 +1009,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">17</property>
+                <property name="top_attach">27</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
commit ef809ce9480182ea5c4f77843f72d1d45bd48c35
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Nov 5 00:34:35 2014 +0200

    More work on the new OpenCL options
    
    Now the new options show up in the "Detailed Calculation Settings" dialog and
    are saved and restored from the per-user configuration.
    
    The code that manipulates the "Detailed Calculation Settings" dialog is quite
    ugly with all its manual hiding and showing of widgets depending on which
    detail it is that is being edited. This also means that the dialog cannot be
    designed using Glade. But no time now to re-work this.
    
    Change-Id: I03a3a51d902084e73aab5a787b588d22ea7578f2

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index cb16b9b..d0eb9d1 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1340,12 +1340,40 @@
         <info>
           <desc>Contains settings for how to calculate formulae.</desc>
         </info>
+	<!-- Note: The default values below probably must correspond
+	to those assigned in setOpenCLConfigToDefault() in
+	sc/source/core/tool/calcconfig.cxx
+	-->
         <prop oor:name="OpenCL" oor:type="xs:boolean" oor:nillable="false">
           <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
           <info>
             <desc>Whether to use OpenCL for formula computation, if available.</desc>
           </info>
-          <value>false</value>
+          <value>true</value>
+        </prop>
+        <prop oor:name="OpenCLSubsetOnly" oor:type="xs:boolean" oor:nillable="false">
+          <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
+          <info>
+            <desc>Whether to use only a subset of OpenCL.</desc>
+          </info>
+          <value>true</value>
+        </prop>
+        <prop oor:name="OpenCLMinimumDataSize" oor:type="xs:int">
+          <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
+          <info>
+            <desc>An approximate lower limit on the number of data cells a spreadsheet formula should use for OpenCL to be considered.</desc>
+          </info>
+          <value>20</value>
+        </prop>
+        <prop oor:name="OpenCLSubsetOpCodes" oor:type="xs:string" oor:nillable="false">
+          <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
+          <info>
+            <desc>The list of operator and function opcodes for which to use OpenCL. If a
+	    formula contains only these operators and functions, it
+	    might be calculated using OpenCL.</desc>
+          </info>
+	  <!-- numeric values correspond to MIN;MAX;SUM;AVERAGE;SUMIFS -->
+          <value>222;223;224;226;403</value>
         </prop>
         <prop oor:name="OpenCLAutoSelect" oor:type="xs:boolean" oor:nillable="false">
           <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 77e944d..3a54efd 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -12,11 +12,11 @@
 
 #include "scdllapi.h"
 
+#include <ostream>
 #include <set>
 
 #include <formula/grammar.hxx>
 #include <formula/opcode.hxx>
-
 #include <rtl/ustring.hxx>
 
 // have to match the registry values
@@ -49,11 +49,13 @@ struct SC_DLLPUBLIC ScCalcConfig
     bool mbOpenCLSubsetOnly:1;
     bool mbOpenCLAutoSelect:1;
     OUString maOpenCLDevice;
-    int mnOpenCLMinimumFormulaGroupSize;
-    std::set<OpCodeEnum> maOpenCLSubsetFunctions;
+    sal_Int32 mnOpenCLMinimumFormulaGroupSize;
+    std::set<OpCodeEnum> maOpenCLSubsetOpCodes;
 
     ScCalcConfig();
 
+    void setOpenCLConfigToDefault();
+
     void reset();
     void MergeDocumentSpecific( const ScCalcConfig& r );
 
@@ -61,6 +63,12 @@ struct SC_DLLPUBLIC ScCalcConfig
     bool operator!= (const ScCalcConfig& r) const;
 };
 
+std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& rConfig);
+
+OUString SC_DLLPUBLIC ScOpCodeSetToNumberString(const std::set<OpCodeEnum>& rOpCodes);
+OUString SC_DLLPUBLIC ScOpCodeSetToSymbolicString(const std::set<OpCodeEnum>& rOpCodes);
+std::set<OpCodeEnum> SC_DLLPUBLIC ScStringToOpCodeSet(const OUString& rOpCodes);
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 8bca2ac..7d50d78 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -7,18 +7,37 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <ostream>
+#include <set>
+
+#include <formula/FormulaCompiler.hxx>
+#include <formula/grammar.hxx>
+#include <formula/opcode.hxx>
+#include <rtl/ustring.hxx>
+#include <sfx2/objsh.hxx>
+
 #include "calcconfig.hxx"
+#include "compiler.hxx"
+#include "docsh.hxx"
 
 ScCalcConfig::ScCalcConfig() :
     meStringRefAddressSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED),
     meStringConversion(STRING_CONVERSION_LOCALE_DEPENDENT),     // old LibreOffice behavior
-    mbEmptyStringAsZero(false),
-    mbOpenCLEnabled(true),
-    mbOpenCLSubsetOnly(true),
-    mbOpenCLAutoSelect(true),
-    mnOpenCLMinimumFormulaGroupSize(4),
-    maOpenCLSubsetFunctions {ocAverage, ocMax, ocMin, ocSum, ocSumIfs}
+    mbEmptyStringAsZero(false)
+{
+    setOpenCLConfigToDefault();
+}
+
+void ScCalcConfig::setOpenCLConfigToDefault()
 {
+    // Note that these defaults better be kept in sync with those in
+    // officecfg/registry/schema/org/openoffice/Office/Calc.xcs.
+    // Crazy.
+    mbOpenCLEnabled = true;
+    mbOpenCLSubsetOnly = true;
+    mbOpenCLAutoSelect = true;
+    mnOpenCLMinimumFormulaGroupSize = 20;
+    maOpenCLSubsetOpCodes = {ocMin, ocMax, ocSum, ocAverage, ocSumIfs};
 }
 
 void ScCalcConfig::reset()
@@ -45,7 +64,7 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
            mbOpenCLAutoSelect == r.mbOpenCLAutoSelect &&
            maOpenCLDevice == r.maOpenCLDevice &&
            mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize &&
-           maOpenCLSubsetFunctions == r.maOpenCLSubsetFunctions;
+           maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes;
 }
 
 bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
@@ -53,4 +72,110 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
     return !operator==(r);
 }
 
+std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
+{
+    rStream << "{"
+        "StringRefAddressSyntax=" << rConfig.meStringRefAddressSyntax << ","
+        "StringConversion=" << rConfig.meStringConversion << ","
+        "EmptyStringAsZero=" << (rConfig.mbEmptyStringAsZero?"Y":"N") << ","
+        "OpenCLEnabled=" << (rConfig.mbOpenCLEnabled?"Y":"N") << ","
+        "OpenCLSubsetOnly=" << (rConfig.mbOpenCLSubsetOnly?"Y":"N") << ","
+        "OpenCLAutoSelect=" << (rConfig.mbOpenCLAutoSelect?"Y":"N") << ","
+        "OpenCLDevice='" << rConfig.maOpenCLDevice << "',"
+        "OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << ","
+        "OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "}"
+        "}";
+    return rStream;
+}
+
+namespace {
+
+formula::FormulaCompiler::OpCodeMapPtr setup()
+{
+    SfxObjectShell* pObjShell = SfxObjectShell::Current();
+    ScDocShell* pScDocShell = PTR_CAST(ScDocShell, pObjShell);
+
+    if (pScDocShell)
+    {
+        ScDocument& rDoc(pScDocShell->GetDocument());
+        ScCompiler* pComp(new ScCompiler(&rDoc, ScAddress()));
+        return pComp->GetOpCodeMap(css::sheet::FormulaLanguage::NATIVE);
+    }
+
+    return nullptr;
+}
+
+} // anonymous namespace
+
+OUString SC_DLLPUBLIC ScOpCodeSetToNumberString(const std::set<OpCodeEnum>& rOpCodes)
+{
+    OUStringBuffer result;
+
+    for (auto i = rOpCodes.cbegin(); i != rOpCodes.cend(); ++i)
+    {
+        if (i != rOpCodes.cbegin())
+            result.append(';');
+        result.append(static_cast<int>(*i));
+    }
+
+    return result.toString();
+}
+
+OUString SC_DLLPUBLIC ScOpCodeSetToSymbolicString(const std::set<OpCodeEnum>& rOpCodes)
+{
+    OUStringBuffer result;
+    formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(setup());
+
+    if (!pOpCodeMap)
+        return ScOpCodeSetToNumberString(rOpCodes);
+
+    for (auto i = rOpCodes.cbegin(); i != rOpCodes.cend(); ++i)
+    {
+        if (i != rOpCodes.cbegin())
+            result.append(';');
+        result.append(pOpCodeMap->getSymbol(*i));
+    }
+
+    return result.toString();
+}
+
+std::set<OpCodeEnum> SC_DLLPUBLIC ScStringToOpCodeSet(const OUString& rOpCodes)
+{
+    std::set<OpCodeEnum> result;
+    formula::FormulaCompiler::OpCodeMapPtr pOpCodeMap(setup());
+
+    OUString s(rOpCodes + ";");
+
+    const formula::OpCodeHashMap *pHashMap(nullptr);
+    if (pOpCodeMap)
+        pHashMap = pOpCodeMap->getHashMap();
+
+    sal_Int32 fromIndex(0);
+    sal_Int32 semicolon;
+    while ((semicolon = s.indexOf(';', fromIndex)) >= 0)
+    {
+        if (semicolon > fromIndex)
+        {
+            OUString element(s.copy(fromIndex, semicolon - fromIndex));
+            sal_Int32 n = element.toInt32();
+            if (n > 0 || (n == 0 && element == "0"))
+                result.insert(static_cast<OpCodeEnum>(n));
+            else if (pHashMap)
+            {
+                auto opcode(pHashMap->find(element));
+                if (opcode != pHashMap->end())
+                    result.insert(opcode->second);
+                else
+                    SAL_WARN("sc.opencl", "Unrecognized OpCode " << element << " in OpCode set string");
+            }
+            else
+            {
+                SAL_WARN("sc.opencl", "No current doc, can't convert from OpCode name to value");
+            }
+        }
+        fromIndex = semicolon+1;
+    }
+    return result;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index a5ad10b..ab84aa7 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -611,7 +611,7 @@ void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely,
     ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig();
     aConfig.mbOpenCLEnabled = bEnable;
     aConfig.mbOpenCLSubsetOnly = !bEnableCompletely;
-    aConfig.maOpenCLSubsetFunctions = rSubsetToEnable;
+    aConfig.maOpenCLSubsetOpCodes = rSubsetToEnable;
     ScInterpreter::SetGlobalConfig(aConfig);
 }
 
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 346525d..22bf452 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -200,7 +200,10 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
 #define SCFORMULAOPT_OPENCL_ENABLED      10
 #define SCFORMULAOPT_OPENCL_AUTOSELECT   11
 #define SCFORMULAOPT_OPENCL_DEVICE       12
-#define SCFORMULAOPT_COUNT               13
+#define SCFORMULAOPT_OPENCL_SUBSET_ONLY  13
+#define SCFORMULAOPT_OPENCL_MIN_SIZE     14
+#define SCFORMULAOPT_OPENCL_SUBSET_OPS   15
+#define SCFORMULAOPT_COUNT               16
 
 Sequence<OUString> ScFormulaCfg::GetPropertyNames()
 {
@@ -218,7 +221,10 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
         "Load/ODFRecalcMode",            // SCFORMULAOPT_ODF_RECALC
         "Calculation/OpenCL",            // SCFORMULAOPT_OPENCL_ENABLED
         "Calculation/OpenCLAutoSelect",  // SCFORMULAOPT_OPENCL_AUTOSELECT
-        "Calculation/OpenCLDevice"   // SCFORMULAOPT_OPENCL_DEVICE
+        "Calculation/OpenCLDevice",      // SCFORMULAOPT_OPENCL_DEVICE
+        "Calculation/OpenCLSubsetOnly",  // SCFORMULAOPT_OPENCL_SUBSET_ONLY
+        "Calculation/OpenCLMinimumDataSize",  // SCFORMULAOPT_OPENCL_MIN_SIZE
+        "Calculation/OpenCLSubsetOpCodes",    // SCFORMULAOPT_OPENCL_SUBSET_OPS
     };
     Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
     OUString* pNames = aNames.getArray();
@@ -231,7 +237,24 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
 ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
 {
     Sequence<OUString> aPropNames = GetPropertyNames();
-    static sal_uInt16 aVals[] = { SCFORMULAOPT_GRAMMAR, SCFORMULAOPT_ENGLISH_FUNCNAME, SCFORMULAOPT_SEP_ARG, SCFORMULAOPT_SEP_ARRAY_ROW, SCFORMULAOPT_SEP_ARRAY_COL, SCFORMULAOPT_STRING_REF_SYNTAX, SCFORMULAOPT_STRING_CONVERSION, SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO, SCFORMULAOPT_OOXML_RECALC, SCFORMULAOPT_ODF_RECALC, SCFORMULAOPT_OPENCL_ENABLED, SCFORMULAOPT_OPENCL_AUTOSELECT, SCFORMULAOPT_OPENCL_DEVICE };
+    static sal_uInt16 aVals[] = {
+        SCFORMULAOPT_GRAMMAR,
+        SCFORMULAOPT_ENGLISH_FUNCNAME,
+        SCFORMULAOPT_SEP_ARG,
+        SCFORMULAOPT_SEP_ARRAY_ROW,
+        SCFORMULAOPT_SEP_ARRAY_COL,
+        SCFORMULAOPT_STRING_REF_SYNTAX,
+        SCFORMULAOPT_STRING_CONVERSION,
+        SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO,
+        SCFORMULAOPT_OOXML_RECALC,
+        SCFORMULAOPT_ODF_RECALC,
+        SCFORMULAOPT_OPENCL_ENABLED,
+        SCFORMULAOPT_OPENCL_AUTOSELECT,
+        SCFORMULAOPT_OPENCL_DEVICE,
+        SCFORMULAOPT_OPENCL_SUBSET_ONLY,
+        SCFORMULAOPT_OPENCL_MIN_SIZE,
+        SCFORMULAOPT_OPENCL_SUBSET_OPS,
+    };
     OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync");
     PropsToIds aPropIdMap;
     for ( sal_uInt16 i=0; i<aPropNames.getLength(); ++i )
@@ -468,6 +491,27 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
                     GetCalcConfig().maOpenCLDevice = aOpenCLDevice;
                 }
                 break;
+                case SCFORMULAOPT_OPENCL_SUBSET_ONLY:
+                {
+                    bool bVal = GetCalcConfig().mbOpenCLSubsetOnly;
+                    pValues[nProp] >>= bVal;
+                    GetCalcConfig().mbOpenCLSubsetOnly = bVal;
+                }
+                break;
+                case SCFORMULAOPT_OPENCL_MIN_SIZE:
+                {
+                    sal_Int32 nVal = GetCalcConfig().mnOpenCLMinimumFormulaGroupSize;
+                    pValues[nProp] >>= nVal;
+                    GetCalcConfig().mnOpenCLMinimumFormulaGroupSize = nVal;
+                }
+                break;
+                case SCFORMULAOPT_OPENCL_SUBSET_OPS:
+                {
+                    OUString sVal = ScOpCodeSetToNumberString(GetCalcConfig().maOpenCLSubsetOpCodes);
+                    pValues[nProp] >>= sVal;
+                    GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
+                }
+                break;
                 default:
                     ;
                 }
@@ -605,6 +649,24 @@ void ScFormulaCfg::Commit()
                 bSetOpenCL = true;
             }
             break;
+            case SCFORMULAOPT_OPENCL_SUBSET_ONLY:
+            {
+                bool bVal = GetCalcConfig().mbOpenCLSubsetOnly;
+                pValues[nProp] <<= bVal;
+            }
+            break;
+            case SCFORMULAOPT_OPENCL_MIN_SIZE:
+            {
+                sal_Int32 nVal = GetCalcConfig().mnOpenCLMinimumFormulaGroupSize;
+                pValues[nProp] <<= nVal;
+            }
+            break;
+            case SCFORMULAOPT_OPENCL_SUBSET_OPS:
+            {
+                OUString sVal = ScOpCodeSetToNumberString(GetCalcConfig().maOpenCLSubsetOpCodes);
+                pValues[nProp] <<= sVal;
+            }
+            break;
             default:
                 ;
         }
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 93c3463..93b3778 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1219,7 +1219,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
 
     if (SC_OPCODE_START_FUNCTION <= eOp && eOp < SC_OPCODE_STOP_FUNCTION)
     {
-        if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.end())
+        if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
         {
             meVectorState = FormulaVectorDisabled;
             return;
@@ -1460,7 +1460,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
     if (eOp >= SC_OPCODE_START_BIN_OP &&
         eOp <= SC_OPCODE_STOP_UN_OP &&
         ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
-        ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.end())
+        ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetOpCodes.end())
     {
         meVectorState = FormulaVectorDisabled;
         return;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 34fc04b..b479aa3 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include "calcconfig.hxx"
 #include "calcoptionsdlg.hxx"
 #include "sc.hrc"
 #include "scresid.hxx"
@@ -22,10 +23,13 @@
 namespace {
 
 typedef enum {
-    CALC_OPTION_STRING_CONVERSION = 0,
-    CALC_OPTION_EMPTY_AS_ZERO     = 1,
-    CALC_OPTION_REF_SYNTAX        = 2,
-    CALC_OPTION_ENABLE_OPENCL     = 3
+    CALC_OPTION_STRING_CONVERSION,
+    CALC_OPTION_EMPTY_AS_ZERO,
+    CALC_OPTION_REF_SYNTAX,
+    CALC_OPTION_ENABLE_OPENCL,
+    CALC_OPTION_ENABLE_OPENCL_SUBSET,
+    CALC_OPTION_OPENCL_MIN_SIZE,
+    CALC_OPTION_OPENCL_SUBSET_OPS
 } CalcOptionOrder;
 
 class OptionString : public SvLBoxString
@@ -135,6 +139,8 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     get(mpFtAnnotation, "annotation");
     get(mpBtnTrue, "true");
     get(mpBtnFalse, "false");
+    get(mpSpinButton, "spinbutton");
+    get(mpEditField, "entry");
     get(mpOpenclInfoList, "opencl_list");
     get(mpBtnAutomaticSelectionTrue, "automatic_select_true");
     get(mpBtnAutomaticSelectionFalse, "automatic_select_false");
@@ -142,6 +148,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     get(mpFtComputeUnits, "compute_units");
     get(mpFtMemory, "memory");
 
+    mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, NumModifiedHdl));
+    mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
+
     mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight());
     mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
     mpOpenclInfoList->SetHighlightRange();
@@ -166,6 +175,16 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
 
     maCaptionOpenCLEnabled = get<vcl::Window>("opencl_enabled")->GetText();
     maDescOpenCLEnabled = get<vcl::Window>("opencl_enabled_desc")->GetText();
+
+    maCaptionOpenCLSubsetEnabled = get<vcl::Window>("opencl_subset_enabled")->GetText();
+    maDescOpenCLSubsetEnabled = get<vcl::Window>("opencl_subset_enabled_desc")->GetText();
+
+    maCaptionOpenCLMinimumFormulaSize = get<vcl::Window>("opencl_minimum_size")->GetText();
+    maDescOpenCLMinimumFormulaSize = get<vcl::Window>("opencl_minimum_size_desc")->GetText();
+
+    maCaptionOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes")->GetText();
+    maDescOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes_desc")->GetText();
+
     maSoftware = get<vcl::Window>("software")->GetText();
 
     mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight());
@@ -198,6 +217,26 @@ SvTreeListEntry *ScCalcOptionsDialog::createBoolItem(const OUString &rCaption, b
     return pEntry;
 }
 
+SvTreeListEntry *ScCalcOptionsDialog::createIntegerItem(const OUString &rCaption, sal_Int32 nValue) const
+{
+    SvTreeListEntry* pEntry = new SvTreeListEntry;
+    pEntry->AddItem(new SvLBoxString(pEntry, 0, OUString()));
+    pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false));
+    OptionString* pItem = new OptionString(rCaption, toString(nValue));
+    pEntry->AddItem(pItem);
+    return pEntry;
+}
+
+SvTreeListEntry *ScCalcOptionsDialog::createStringItem(const OUString &rCaption, const OUString& sValue) const
+{
+    SvTreeListEntry* pEntry = new SvTreeListEntry;
+    pEntry->AddItem(new SvLBoxString(pEntry, 0, OUString()));
+    pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false));
+    OptionString* pItem = new OptionString(rCaption, sValue);
+    pEntry->AddItem(pItem);
+    return pEntry;
+}
+
 void ScCalcOptionsDialog::setValueAt(size_t nPos, const OUString &rValue)
 {
     SvTreeList *pModel = mpLbSettings->GetModel();
@@ -296,6 +335,10 @@ void ScCalcOptionsDialog::FillOptionsList()
 
 #if HAVE_FEATURE_OPENCL
     pModel->Insert(createBoolItem(maCaptionOpenCLEnabled,maConfig.mbOpenCLEnabled));
+    pModel->Insert(createBoolItem(maCaptionOpenCLSubsetEnabled,maConfig.mbOpenCLSubsetOnly));
+    pModel->Insert(createIntegerItem(maCaptionOpenCLMinimumFormulaSize,maConfig.mnOpenCLMinimumFormulaGroupSize));
+    pModel->Insert(createStringItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes)));
+
     fillOpenCLList();
 
     mpBtnAutomaticSelectionFalse->Check(!maConfig.mbOpenCLAutoSelect);
@@ -315,6 +358,8 @@ void ScCalcOptionsDialog::SelectionChanged()
             // Formula syntax for INDIRECT function.
             mpBtnTrue->Hide();
             mpBtnFalse->Hide();
+            mpSpinButton->Hide();
+            mpEditField->Hide();
             mpLbOptionEdit->Show();
             mpOpenclInfoList->GetParent()->Hide();
 
@@ -347,6 +392,8 @@ void ScCalcOptionsDialog::SelectionChanged()
             // String conversion for arithmetic operations.
             mpBtnTrue->Hide();
             mpBtnFalse->Hide();
+            mpSpinButton->Hide();
+            mpEditField->Hide();
             mpLbOptionEdit->Show();
             mpOpenclInfoList->GetParent()->Hide();
 
@@ -377,11 +424,14 @@ void ScCalcOptionsDialog::SelectionChanged()
         // booleans
         case CALC_OPTION_EMPTY_AS_ZERO:
         case CALC_OPTION_ENABLE_OPENCL:
+        case CALC_OPTION_ENABLE_OPENCL_SUBSET:
         {
             // Treat empty string as zero.
             mpLbOptionEdit->Hide();
             mpBtnTrue->Show();
             mpBtnFalse->Show();
+            mpSpinButton->Hide();
+            mpEditField->Hide();
 
             bool bValue = false;
             bool bEnable = true;
@@ -401,7 +451,7 @@ void ScCalcOptionsDialog::SelectionChanged()
                         break;  // nothing
                 }
             }
-            else
+            else if ( nSelectedPos == CALC_OPTION_ENABLE_OPENCL )
             {
                 bValue = maConfig.mbOpenCLEnabled;
                 mpFtAnnotation->SetText(maDescOpenCLEnabled);
@@ -414,6 +464,16 @@ void ScCalcOptionsDialog::SelectionChanged()
 
                 OpenCLAutomaticSelectionChanged();
             }
+            else if ( nSelectedPos == CALC_OPTION_ENABLE_OPENCL_SUBSET )
+            {
+                bValue = maConfig.mbOpenCLSubsetOnly;
+                mpFtAnnotation->SetText(maDescOpenCLSubsetEnabled);
+                mpOpenclInfoList->GetParent()->Hide();
+            }
+            else
+            {
+                assert(false);
+            }
 
             if ( bValue )
             {
@@ -437,8 +497,38 @@ void ScCalcOptionsDialog::SelectionChanged()
             }
         }
         break;
-        default:
-            ;
+
+        // numeric fields
+        case CALC_OPTION_OPENCL_MIN_SIZE:
+        {
+            // just one numeric field so far
+            sal_Int32 nValue = maConfig.mnOpenCLMinimumFormulaGroupSize;
+            mpLbOptionEdit->Hide();
+            mpBtnTrue->Hide();
+            mpBtnFalse->Hide();
+            mpSpinButton->Show();
+            mpEditField->Hide();
+            mpOpenclInfoList->GetParent()->Hide();
+            mpFtAnnotation->SetText(maDescOpenCLMinimumFormulaSize);
+            mpSpinButton->SetValue(nValue);
+        }
+        break;
+
+        // strings
+        case CALC_OPTION_OPENCL_SUBSET_OPS:
+        {
+            // just one string field so far
+            OUString sValue = ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes);
+            mpLbOptionEdit->Hide();
+            mpBtnTrue->Hide();
+            mpBtnFalse->Hide();
+            mpSpinButton->Hide();
+            mpEditField->Show();
+            mpOpenclInfoList->GetParent()->Hide();
+            mpFtAnnotation->SetText(maDescOpenCLSubsetOpCodes);
+            mpEditField->SetText(sValue);
+        }
+        break;
     }
 }
 
@@ -489,6 +579,9 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
 
         case CALC_OPTION_EMPTY_AS_ZERO:
         case CALC_OPTION_ENABLE_OPENCL:
+        case CALC_OPTION_ENABLE_OPENCL_SUBSET:
+        case CALC_OPTION_OPENCL_MIN_SIZE:
+        case CALC_OPTION_OPENCL_SUBSET_OPS:
             break;
     }
 }
@@ -558,11 +651,30 @@ void ScCalcOptionsDialog::RadioValueChanged()
                 mpOpenclInfoList->GetParent()->Disable();
             OpenCLAutomaticSelectionChanged();
             break;
+        case CALC_OPTION_ENABLE_OPENCL_SUBSET:
+            maConfig.mbOpenCLSubsetOnly = bValue;
+            break;
     }
 
     setValueAt(nSelected, toString(bValue));
 }
 
+void ScCalcOptionsDialog::SpinButtonValueChanged()
+{
+    // We know that the mpSpinButton is used for only one thing at the moment,
+    // the OpenCL minimum formula size
+    sal_Int64 nVal = mpSpinButton->GetValue();
+    maConfig.mnOpenCLMinimumFormulaGroupSize = nVal;
+}
+
+void ScCalcOptionsDialog::EditFieldValueChanged()
+{
+    // We know that the mpEditField is used for only one thing at the moment,
+    // the OpenCL subset list of opcodes
+    OUString sVal = mpEditField->GetText();
+    maConfig.maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
+}
+
 OUString ScCalcOptionsDialog::toString(formula::FormulaGrammar::AddressConvention eConv) const
 {
     switch (eConv)
@@ -601,6 +713,11 @@ OUString ScCalcOptionsDialog::toString(bool bVal) const
     return bVal ? maTrue : maFalse;
 }
 
+OUString ScCalcOptionsDialog::toString(sal_Int32 nVal) const
+{
+    return OUString::number(nVal);
+}
+
 IMPL_LINK(ScCalcOptionsDialog, SettingsSelHdl, Control*, pCtrl)
 {
     if (pCtrl == mpLbSettings)
@@ -629,4 +746,16 @@ IMPL_LINK_NOARG(ScCalcOptionsDialog, DeviceSelHdl)
     return 0;
 }
 
+IMPL_LINK_NOARG(ScCalcOptionsDialog, NumModifiedHdl)
+{
+    SpinButtonValueChanged();
+    return 0;
+}
+
+IMPL_LINK_NOARG(ScCalcOptionsDialog, EditModifiedHdl)
+{
+    EditFieldValueChanged();
+    return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index adac98a..5676cfc 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -14,6 +14,8 @@
 
 #include <vcl/dialog.hxx>
 #include <vcl/button.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
 #include <vcl/fixed.hxx>
 #include <vcl/lstbox.hxx>
 #include <svx/checklbx.hxx>
@@ -35,6 +37,8 @@ public:
     DECL_LINK( BtnToggleHdl, void* );
     DECL_LINK( BtnAutomaticSelectHdl, void* );
     DECL_LINK( DeviceSelHdl, void* );
+    DECL_LINK( NumModifiedHdl, void * );
+    DECL_LINK( EditModifiedHdl, void * );
 
     const ScCalcConfig& GetConfig() const { return maConfig;}
 
@@ -45,6 +49,8 @@ private:
     void RadioValueChanged();
     void OpenCLAutomaticSelectionChanged();
     void SelectedDeviceChanged();
+    void SpinButtonValueChanged();
+    void EditFieldValueChanged();
 #if HAVE_FEATURE_OPENCL
     void fillOpenCLList();
 #endif
@@ -52,7 +58,10 @@ private:
     OUString toString(formula::FormulaGrammar::AddressConvention eConv) const;
     OUString toString(ScCalcConfig::StringConversion eConv) const;
     OUString toString(bool bVal) const;
+    OUString toString(sal_Int32 nVal) const;
     SvTreeListEntry *createBoolItem(const OUString &rCaption, bool bValue) const;
+    SvTreeListEntry *createIntegerItem(const OUString &rCaption, sal_Int32 nValue) const;
+    SvTreeListEntry *createStringItem(const OUString &rCaption, const OUString& sValue) const;
     void     setValueAt(size_t nPos, const OUString &rString);
 
 private:
@@ -61,6 +70,8 @@ private:
     ListBox* mpLbOptionEdit;
     RadioButton* mpBtnTrue;
     RadioButton* mpBtnFalse;
+    NumericField* mpSpinButton;
+    Edit* mpEditField;
 
     FixedText* mpFtAnnotation;
     FixedText* mpFtFrequency;
@@ -96,6 +107,15 @@ private:
     OUString maCaptionOpenCLEnabled;
     OUString maDescOpenCLEnabled;
 
+    OUString maCaptionOpenCLSubsetEnabled;
+    OUString maDescOpenCLSubsetEnabled;
+
+    OUString maCaptionOpenCLMinimumFormulaSize;
+    OUString maDescOpenCLMinimumFormulaSize;
+
+    OUString maCaptionOpenCLSubsetOpCodes;
+    OUString maDescOpenCLSubsetOpCodes;
+
     OUString maSoftware;
 
     ScCalcConfig maConfig;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index db2a626..aa55519 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2331,7 +2331,10 @@ void ScModelObj::enableOpenCL(sal_Bool bEnable)
     throw (uno::RuntimeException, std::exception)
 {
     ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig();
-    aConfig.mbOpenCLEnabled = bEnable;
+    if (bEnable)
+        aConfig.setOpenCLConfigToDefault();
+    else
+        aConfig.mbOpenCLEnabled = false;
     ScInterpreter::SetGlobalConfig(aConfig);
 }
 
diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index 08f2379..0aaef43 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -155,6 +155,35 @@
                         <property name="height">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkSpinButton" id="spinbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="halign">start</property>
+                        <property name="invisible_char">●</property>
+                        <property name="adjustment">adjustment1</property>
+                        <property name="climb_rate">1</property>
+                        <property name="update_policy">if-valid</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">3</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkEntry" id="entry">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="valign">center</property>
+                        <property name="invisible_char">●</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">4</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -364,6 +393,94 @@
                 <property name="height">1</property>
               </packing>
             </child>
+
+            <child>
+              <object class="GtkLabel" id="opencl_subset_enabled">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Use OpenCL only for a subset of operations</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">17</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_subset_enabled_desc">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Use OpenCL only for some of the operations that spreadsheet formulas are translated to.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">18</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+
+            <child>
+              <object class="GtkLabel" id="opencl_minimum_size">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Minimum data size for OpenCL use</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">19</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_minimum_size_desc">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">An approximate lower limit on the number of data cells a spreadsheet formula should use for OpenCL to be considered.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">20</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+
+            <child>
+              <object class="GtkLabel" id="opencl_subset_opcodes">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">Subset of opcodes for which OpenCL is used</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">21</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="opencl_subset_opcodes_desc">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="label" translatable="yes">The list of operator and function opcodes for which to use OpenCL. If a formula contains only these operators and functions, it might be calculated using OpenCL.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">56</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">22</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+
             <child>
               <object class="GtkGrid" id="grid6">
                 <property name="can_focus">False</property>
commit c78b58e1a1950ea78dc0f9a5d8abe2fc228b08c2
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 3 14:04:51 2014 +0200

    Check also unary and binary operation opcodes for presence in subset
    
    Change-Id: I316ebdb017d512e72d0ad15a847802bca0e15814

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 46fd5a4..93c3463 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1454,6 +1454,16 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
             default:
                 ;
         }
+        return;
+    }
+
+    if (eOp >= SC_OPCODE_START_BIN_OP &&
+        eOp <= SC_OPCODE_STOP_UN_OP &&
+        ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
+        ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.find(eOp) == ScInterpreter::GetGlobalConfig().maOpenCLSubsetFunctions.end())
+    {
+        meVectorState = FormulaVectorDisabled;
+        return;
     }
 }
 
commit 8dd9c5c8b1dc6baa50db3c190762cdc92b609049
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 3 14:04:12 2014 +0200

    Add also parameters for the opcode subset to enableOpenCL()
    
    In CppunitTest_sc_opencl_test we want to explicitly disable subsetting and use
    OpenCL maximally, to match how it used to work.
    
    Change-Id: Ie900adb5fa58b7cd1111169e44efd70d8cac5256

diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index 1ee0249..d507cd5 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -15,6 +15,7 @@
 #include "platforminfo.hxx"
 #include "stlalgorithm.hxx"
 
+#include <formula/opcode.hxx>
 #include <svl/sharedstringpool.hxx>
 
 #include <vector>
@@ -122,7 +123,7 @@ class SC_DLLPUBLIC FormulaGroupInterpreter
     static FormulaGroupInterpreter *getStatic();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list