[Libreoffice-commits] core.git: cui/source cui/uiconfig officecfg/registry sc/inc sc/source sc/uiconfig

Tor Lillqvist tml at collabora.com
Mon Nov 24 10:22:28 PST 2014


 cui/source/options/optgdlg.cxx                             |   10 ++
 cui/source/options/optgdlg.hxx                             |    2 
 cui/uiconfig/ui/optgeneralpage.ui                          |   41 ++++++++++
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs   |    7 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    7 +
 sc/inc/calcconfig.hxx                                      |    1 
 sc/source/core/data/formulacell.cxx                        |    7 +
 sc/source/core/tool/calcconfig.cxx                         |    3 
 sc/source/core/tool/formulagroup.cxx                       |   14 ++-
 sc/source/core/tool/formulaopt.cxx                         |   37 ++-------
 sc/source/core/tool/interpr5.cxx                           |    3 
 sc/source/ui/optdlg/calcoptionsdlg.cxx                     |   28 -------
 sc/source/ui/optdlg/calcoptionsdlg.hxx                     |    3 
 sc/source/ui/unoobj/docuno.cxx                             |    8 +-
 sc/uiconfig/scalc/ui/formulacalculationoptions.ui          |   49 ++-----------
 15 files changed, 98 insertions(+), 122 deletions(-)

New commits:
commit 3a58704459a8e60ecca337a247331ac55b7672d3
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Nov 24 18:08:55 2014 +0200

    Make whether to use OpenCL or not a global option
    
    Add a toggle to the "General" page.
    
    Change-Id: If35b1472032706b09a3bc3499c55cbd3ac2e13ac

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index e68743d..c449eb0 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -209,6 +209,7 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     get(m_pYearValueField, "year");
     get(m_pToYearFT, "toyear");
     get(m_pCollectUsageInfo, "collectusageinfo");
+    get(m_pUseOpenCL, "useopencl");
 
     if (m_pFileDlgCB->IsVisible() && SvtMiscOptions().IsUseSystemFileDialogReadOnly())
     {
@@ -301,6 +302,12 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
         bModified = true;
     }
 
+    if (m_pUseOpenCL->IsValueChangedFromSaved())
+    {
+        officecfg::Office::Common::Misc::UseOpenCL::set(m_pUseOpenCL->IsChecked(), batch);
+        bModified = true;
+    }
+
     batch->commit();
 
     return bModified;
@@ -342,6 +349,9 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
 
     m_pCollectUsageInfo->Check(officecfg::Office::Common::Misc::CollectUsageInformation::get());
     m_pCollectUsageInfo->SaveValue();
+
+    m_pUseOpenCL->Check(officecfg::Office::Common::Misc::UseOpenCL::get());
+    m_pUseOpenCL->SaveValue();
 }
 
 
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 3353457..a6a7dac 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -57,6 +57,8 @@ private:
 
     CheckBox*     m_pCollectUsageInfo;
 
+    CheckBox*     m_pUseOpenCL;
+
     DECL_LINK( TwoFigureHdl, NumericField* );
     DECL_LINK( TwoFigureConfigHdl, NumericField* );
     DECL_LINK(HelpCheckHdl_Impl, void *);
diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui
index b1447c5..d3e8015 100644
--- a/cui/uiconfig/ui/optgeneralpage.ui
+++ b/cui/uiconfig/ui/optgeneralpage.ui
@@ -370,5 +370,46 @@
         <property name="top_attach">5</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkFrame" id="openclframe">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <object class="GtkAlignment" id="alignment7">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">6</property>
+            <property name="left_padding">12</property>
+            <child>
+              <object class="GtkCheckButton" id="useopencl">
+                <property name="label" translatable="yes">Allow use of OpenCL</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child type="label">
+          <object class="GtkLabel" id="label8">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">OpenCL</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">6</property>
+      </packing>
+    </child>
   </object>
 </interface>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index c7aac17..001654a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1344,13 +1344,6 @@
 	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>true</value>
-        </prop>
         <prop oor:name="OpenCLSubsetOnly" oor:type="xs:boolean" oor:nillable="false">
           <!-- UIHints: Tools - Options  Spreadsheet  Formula -->
           <info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index edede77..74a25aa 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5553,6 +5553,13 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="UseOpenCL" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Determines whether OpenCL can be used, when available, to speed up
+          some operations.</desc>
+        </info>
+        <value>true</value>
+      </prop>
       <prop oor:name="MacroRecorderMode" oor:type="xs:boolean" oor:nillable="false">
         <info>
           <desc>Determines if the limited, and awkward code producing
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 2b93fa3..0a27d1b 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -96,7 +96,6 @@ struct SC_DLLPUBLIC ScCalcConfig
     StringConversion meStringConversion;
     bool mbEmptyStringAsZero:1;
 
-    bool mbOpenCLEnabled:1;
     bool mbOpenCLSubsetOnly:1;
     bool mbOpenCLAutoSelect:1;
     OUString maOpenCLDevice;
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 667be87..f8a6c9c 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -59,6 +59,7 @@
 #include <listenerquery.hxx>
 #include <listenerqueryids.hxx>
 #include <grouparealistener.hxx>
+#include <officecfg/Office/Common.hxx>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -419,7 +420,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
     meKernelState(sc::OpenCLKernelNone)
 {
 #if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-    if (ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
+    if (officecfg::Office::Common::Misc::UseOpenCL::get())
     {
         osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
         if (snCount++ == 0)
@@ -435,7 +436,7 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
 ScFormulaCellGroup::~ScFormulaCellGroup()
 {
 #if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
-    if (ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
+    if (officecfg::Office::Common::Misc::UseOpenCL::get())
     {
         osl::MutexGuard aGuard(getOpenCLCompilationThreadMutex());
         if (--snCount == 0 && sxCompilationThread.is())
@@ -3667,7 +3668,7 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
 
 bool ScFormulaCell::InterpretFormulaGroup()
 {
-    if (!ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
+    if (!officecfg::Office::Common::Misc::UseOpenCL::get())
         return false;
 
     if (!mxGroup || !pCode)
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 7c9ace9..ede5570 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -35,7 +35,6 @@ 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 = 100;
@@ -99,7 +98,6 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
     return meStringRefAddressSyntax == r.meStringRefAddressSyntax &&
            meStringConversion == r.meStringConversion &&
            mbEmptyStringAsZero == r.mbEmptyStringAsZero &&
-           mbOpenCLEnabled == r.mbOpenCLEnabled &&
            mbOpenCLSubsetOnly == r.mbOpenCLSubsetOnly &&
            mbOpenCLAutoSelect == r.mbOpenCLAutoSelect &&
            maOpenCLDevice == r.maOpenCLDevice &&
@@ -147,7 +145,6 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
         "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 << "',"
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index ab84aa7..e7a6125 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -20,6 +20,7 @@
 #include "globalnames.hxx"
 
 #include <formula/vectortoken.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <rtl/bootstrap.hxx>
 
 #include <vector>
@@ -522,7 +523,7 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
     if ( !msInstance )
     {
         const ScCalcConfig& rConfig = ScInterpreter::GetGlobalConfig();
-        if (rConfig.mbOpenCLEnabled)
+        if (officecfg::Office::Common::Misc::UseOpenCL::get())
             switchOpenCLDevice(rConfig.maOpenCLDevice, rConfig.mbOpenCLAutoSelect, false);
 
         if ( !msInstance ) // software fallback
@@ -549,7 +550,7 @@ void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenCLPlatformInfo>& rP
 
 bool FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool bAutoSelect, bool bForceEvaluation)
 {
-    bool bOpenCLEnabled = ScInterpreter::GetGlobalConfig().mbOpenCLEnabled;
+    bool bOpenCLEnabled = officecfg::Office::Common::Misc::UseOpenCL::get();
     if (!bOpenCLEnabled || rDeviceId == OPENCL_SOFTWARE_DEVICE_CONFIG_NAME)
     {
         if(msInstance)
@@ -576,7 +577,7 @@ bool FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool
     msInstance = NULL;
 
 #if HAVE_FEATURE_OPENCL
-    if ( ScInterpreter::GetGlobalConfig().mbOpenCLEnabled )
+    if ( officecfg::Office::Common::Misc::UseOpenCL::get() )
     {
         msInstance = new sc::opencl::FormulaGroupInterpreterOpenCL();
         return msInstance != NULL;
@@ -591,7 +592,7 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3
 {
     rDeviceId = -1;
     rPlatformId = -1;
-    bool bOpenCLEnabled = ScInterpreter::GetGlobalConfig().mbOpenCLEnabled;
+    bool bOpenCLEnabled = officecfg::Office::Common::Misc::UseOpenCL::get();
     if(!bOpenCLEnabled)
         return;
 
@@ -608,8 +609,11 @@ void FormulaGroupInterpreter::getOpenCLDeviceInfo(sal_Int32& rDeviceId, sal_Int3
 
 void FormulaGroupInterpreter::enableOpenCL(bool bEnable, bool bEnableCompletely, const std::set<OpCodeEnum>& rSubsetToEnable)
 {
+    boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+    officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch);
+    batch->commit();
+
     ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig();
-    aConfig.mbOpenCLEnabled = bEnable;
     aConfig.mbOpenCLSubsetOnly = !bEnableCompletely;
     aConfig.maOpenCLSubsetOpCodes = rSubsetToEnable;
     ScInterpreter::SetGlobalConfig(aConfig);
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 9f05a01..8596653 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -200,15 +200,14 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
 #define SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO 7
 #define SCFORMULAOPT_OOXML_RECALC         8
 #define SCFORMULAOPT_ODF_RECALC           9
-#define SCFORMULAOPT_OPENCL_ENABLED      10
-#define SCFORMULAOPT_OPENCL_AUTOSELECT   11
-#define SCFORMULAOPT_OPENCL_DEVICE       12
-#define SCFORMULAOPT_OPENCL_SUBSET_ONLY  13
-#define SCFORMULAOPT_OPENCL_MIN_SIZE     14
-#define SCFORMULAOPT_OPENCL_SUBSET_OPS   15
-#define SCFORMULAOPT_OPENCL_BLACKLIST    16
-#define SCFORMULAOPT_OPENCL_WHITELIST    17
-#define SCFORMULAOPT_COUNT               18
+#define SCFORMULAOPT_OPENCL_AUTOSELECT   10
+#define SCFORMULAOPT_OPENCL_DEVICE       11
+#define SCFORMULAOPT_OPENCL_SUBSET_ONLY  12
+#define SCFORMULAOPT_OPENCL_MIN_SIZE     13
+#define SCFORMULAOPT_OPENCL_SUBSET_OPS   14
+#define SCFORMULAOPT_OPENCL_BLACKLIST    15
+#define SCFORMULAOPT_OPENCL_WHITELIST    16
+#define SCFORMULAOPT_COUNT               17
 
 Sequence<OUString> ScFormulaCfg::GetPropertyNames()
 {
@@ -224,7 +223,6 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
         "Syntax/EmptyStringAsZero",      // SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO
         "Load/OOXMLRecalcMode",          // SCFORMULAOPT_OOXML_RECALC
         "Load/ODFRecalcMode",            // SCFORMULAOPT_ODF_RECALC
-        "Calculation/OpenCL",            // SCFORMULAOPT_OPENCL_ENABLED
         "Calculation/OpenCLAutoSelect",  // SCFORMULAOPT_OPENCL_AUTOSELECT
         "Calculation/OpenCLDevice",      // SCFORMULAOPT_OPENCL_DEVICE
         "Calculation/OpenCLSubsetOnly",  // SCFORMULAOPT_OPENCL_SUBSET_ONLY
@@ -255,7 +253,6 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
         SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO,
         SCFORMULAOPT_OOXML_RECALC,
         SCFORMULAOPT_ODF_RECALC,
-        SCFORMULAOPT_OPENCL_ENABLED,
         SCFORMULAOPT_OPENCL_AUTOSELECT,
         SCFORMULAOPT_OPENCL_DEVICE,
         SCFORMULAOPT_OPENCL_SUBSET_ONLY,
@@ -542,17 +539,6 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
                     SetODFRecalcOptions(eOpt);
                 }
                 break;
-                case SCFORMULAOPT_OPENCL_ENABLED:
-                {
-                    bool bVal = GetCalcConfig().mbOpenCLEnabled;
-                    pValues[nProp] >>= bVal;
-#if 0 // Don't remove please.
-      // The intent here is that tml when running CppunitTest_sc_opencl_test turns this on.
-                    bVal = sal_True;
-#endif
-                    GetCalcConfig().mbOpenCLEnabled = bVal;
-                }
-                break;
                 case SCFORMULAOPT_OPENCL_AUTOSELECT:
                 {
                     bool bVal = GetCalcConfig().mbOpenCLAutoSelect;
@@ -716,13 +702,6 @@ void ScFormulaCfg::Commit()
                 pValues[nProp] <<= nVal;
             }
             break;
-            case SCFORMULAOPT_OPENCL_ENABLED:
-            {
-                bool bVal = GetCalcConfig().mbOpenCLEnabled;
-                pValues[nProp] <<= bVal;
-                bSetOpenCL = bVal;
-            }
-            break;
             case SCFORMULAOPT_OPENCL_AUTOSELECT:
             {
                 bool bVal = GetCalcConfig().mbOpenCLAutoSelect;
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 1f2e4a1..05936fa 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -23,6 +23,7 @@
 #include <stdio.h>
 
 #include <unotools/bootstrap.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <svl/zforlist.hxx>
 
 #include "interpre.hxx"
@@ -908,7 +909,7 @@ void ScInterpreter::ScMatInv()
         SCSIZE nC, nR;
         pMat->GetDimensions(nC, nR);
 
-        if (maCalcConfig.mbOpenCLEnabled)
+        if (officecfg::Office::Common::Misc::UseOpenCL::get())
         {
             ScMatrixRef xResMat = sc::FormulaGroupInterpreter::getStatic()->inverseMatrix(*pMat);
             if (xResMat)
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index f656970..dbf390a 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -39,7 +39,6 @@ typedef enum {
     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,
@@ -206,9 +205,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
     maCaptionEmptyStringAsZero = get<vcl::Window>("empty_str_as_zero_caption")->GetText();
     maDescEmptyStringAsZero = get<vcl::Window>("empty_str_as_zero_desc")->GetText();
 
-    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();
 
@@ -387,7 +383,6 @@ void ScCalcOptionsDialog::FillOptionsList()
     }
 
 #if HAVE_FEATURE_OPENCL
-    pModel->Insert(createItem(maCaptionOpenCLEnabled,toString(maConfig.mbOpenCLEnabled)));
     pModel->Insert(createItem(maCaptionOpenCLSubsetEnabled,toString(maConfig.mbOpenCLSubsetOnly)));
     pModel->Insert(createItem(maCaptionOpenCLMinimumFormulaSize,toString(maConfig.mnOpenCLMinimumFormulaGroupSize)));
     pModel->Insert(createItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes)));
@@ -480,7 +475,6 @@ void ScCalcOptionsDialog::SelectionChanged()
 
         // booleans
         case CALC_OPTION_EMPTY_AS_ZERO:
-        case CALC_OPTION_ENABLE_OPENCL:
         case CALC_OPTION_ENABLE_OPENCL_SUBSET:
         {
             mpLbOptionEdit->Hide();
@@ -508,19 +502,6 @@ void ScCalcOptionsDialog::SelectionChanged()
                         break;  // nothing
                 }
             }
-            else if ( nSelectedPos == CALC_OPTION_ENABLE_OPENCL )
-            {
-                bValue = maConfig.mbOpenCLEnabled;
-                mpFtAnnotation->SetText(maDescOpenCLEnabled);
-                mpOpenclInfoList->GetParent()->Show();
-                setOptimalLayoutSize();
-                if(bValue)
-                    mpOpenclInfoList->GetParent()->Enable();
-                else
-                    mpOpenclInfoList->GetParent()->Disable();
-
-                OpenCLAutomaticSelectionChanged();
-            }
             else if ( nSelectedPos == CALC_OPTION_ENABLE_OPENCL_SUBSET )
             {
                 bValue = maConfig.mbOpenCLSubsetOnly;
@@ -663,7 +644,6 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
         break;
 
         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:
@@ -730,14 +710,6 @@ void ScCalcOptionsDialog::RadioValueChanged()
         case CALC_OPTION_EMPTY_AS_ZERO:
             maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero = bValue;
             break;
-        case CALC_OPTION_ENABLE_OPENCL:
-            maConfig.mbOpenCLEnabled = bValue;
-            if(bValue)
-                mpOpenclInfoList->GetParent()->Enable();
-            else
-                mpOpenclInfoList->GetParent()->Disable();
-            OpenCLAutomaticSelectionChanged();
-            break;
         case CALC_OPTION_ENABLE_OPENCL_SUBSET:
             maConfig.mbOpenCLSubsetOnly = bValue;
             break;
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 705873c..5c483b0 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -119,9 +119,6 @@ private:
     OUString maCaptionEmptyStringAsZero;
     OUString maDescEmptyStringAsZero;
 
-    OUString maCaptionOpenCLEnabled;
-    OUString maDescOpenCLEnabled;
-
     OUString maCaptionOpenCLSubsetEnabled;
     OUString maDescOpenCLSubsetEnabled;
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index aa55519..94a06f0 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2324,17 +2324,19 @@ void ScModelObj::HandleCalculateEvents()
 sal_Bool ScModelObj::isOpenCLEnabled()
     throw (uno::RuntimeException, std::exception)
 {
-    return ScInterpreter::GetGlobalConfig().mbOpenCLEnabled;
+    return officecfg::Office::Common::Misc::UseOpenCL::get();
 }
 
 void ScModelObj::enableOpenCL(sal_Bool bEnable)
     throw (uno::RuntimeException, std::exception)
 {
+    boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+    officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch);
+    batch->commit();
+
     ScCalcConfig aConfig = ScInterpreter::GetGlobalConfig();
     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 decce43..0cdaaab 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -570,34 +570,6 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="opencl_enabled">
-                <property name="can_focus">False</property>
-                <property name="no_show_all">True</property>
-                <property name="label" translatable="yes">Enable OpenCL for some formula computation</property>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">15</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="opencl_enabled_desc">
-                <property name="can_focus">False</property>
-                <property name="no_show_all">True</property>
-                <property name="label" translatable="yes">This option enables some sorts of simple formula expressions to be executed using OpenCL if it is available on your system.</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">16</property>
-                <property name="width">1</property>
-                <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>
@@ -605,7 +577,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">17</property>
+                <property name="top_attach">15</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -620,7 +592,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">18</property>
+                <property name="top_attach">16</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -633,7 +605,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">19</property>
+                <property name="top_attach">17</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -648,7 +620,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">20</property>
+                <property name="top_attach">18</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -661,7 +633,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">21</property>
+                <property name="top_attach">19</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -676,7 +648,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">22</property>
+                <property name="top_attach">20</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -689,7 +661,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">23</property>
+                <property name="top_attach">21</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -704,7 +676,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">24</property>
+                <property name="top_attach">22</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -717,7 +689,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">25</property>
+                <property name="top_attach">23</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -732,7 +704,7 @@
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">26</property>
+                <property name="top_attach">25</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
@@ -954,7 +926,6 @@
       <widget name="annotation"/>
       <widget name="ref_syntax_desc"/>
       <widget name="empty_str_as_zero_desc"/>
-      <widget name="opencl_enabled_desc"/>
     </widgets>
   </object>
   <object class="GtkSizeGroup" id="sizegroup2">


More information about the Libreoffice-commits mailing list