summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-05-26 21:28:35 +0200
committerJan Holesovsky <kendy@collabora.com>2016-05-31 17:01:12 +0200
commitb75670009ca885869aa6b58ac33766808e23653c (patch)
tree42447bb988efc534e9303c57412d6e5e6543b16b /sc/source/ui
parenta1ebcf401da3ae0cc8a12320b8b549a2d8d6e5bf (diff)
tdf#100160 - Changing OpenCL state doesn't update sheet
now we re-check for vectorization state of formula token each time OpenCL is enabled or disabled Change-Id: I652397dd154f5fbf788cb511c70e53a47cc94293
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 43f5897930fd..56d5a6148d8d 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2821,6 +2821,9 @@ sal_Bool ScModelObj::isOpenCLEnabled()
void ScModelObj::enableOpenCL(sal_Bool bEnable)
throw (uno::RuntimeException, std::exception)
{
+ if (ScCalcConfig::isOpenCLEnabled() == static_cast<bool>(bEnable))
+ return;
+
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Misc::UseOpenCL::set(bEnable, batch);
batch->commit();
@@ -2829,6 +2832,12 @@ void ScModelObj::enableOpenCL(sal_Bool bEnable)
if (bEnable)
aConfig.setOpenCLConfigToDefault();
ScInterpreter::SetGlobalConfig(aConfig);
+
+ sc::FormulaGroupInterpreter::switchOpenCLDevice(OUString(), true, false);
+
+ ScDocument* pDoc = GetDocument();
+ pDoc->CheckVectorizationState();
+
}
void ScModelObj::enableAutomaticDeviceSelection(sal_Bool bForce)