From bd8a89f208c71e51921d5f090179b99b45cc0a5f Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 30 Nov 2015 09:44:19 +0100 Subject: sc interpreter: Don't hide S/W Interpreter behind an environment variable. Instead provide a user setting that can be enabled so that the S/W Interpreter is used on a subset of the operations. The operations for which it is used are controlled by a whitelist in ScCalcConfig::setOpenCLConfigToDefault(). Change-Id: I7d3f3a864fcb1231e5484ec23961f14fca1466c5 --- cui/source/options/optopencl.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'cui/source/options/optopencl.cxx') diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index 71cd281480dc..db1470e290c7 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -35,7 +35,8 @@ #include #include -#include "cuires.hrc" +#include +#include #include "optopencl.hxx" #include @@ -43,6 +44,7 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) SfxTabPage(pParent, "OptOpenCLPage", "cui/ui/optopenclpage.ui", &rSet), maConfig(OpenCLConfig::get()) { + get(mpUseSwInterpreter, "useswinterpreter"); get(mpUseOpenCL, "useopencl"); get(mpBlackListTable, "blacklist"); get(mpBlackListFrame,"blacklistframe"); @@ -60,6 +62,8 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet) get(mpVendor,"vendor"); get(mpDrvVersion,"driverversion"); + mpUseSwInterpreter->Check(officecfg::Office::Common::Misc::UseSwInterpreter::get()); + mpUseOpenCL->Check(maConfig.mbUseOpenCL); mpUseOpenCL->SetClickHdl(LINK(this, SvxOpenCLTabPage, EnableOpenCLHdl)); @@ -116,6 +120,7 @@ void SvxOpenCLTabPage::dispose() mpBlackList.disposeAndClear(); mpWhiteList.disposeAndClear(); + mpUseSwInterpreter.clear(); mpUseOpenCL.clear(); mpBlackListFrame.clear(); mpBlackListTable.clear(); @@ -146,6 +151,15 @@ bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) bool bModified = false; std::shared_ptr batch(comphelper::ConfigurationChanges::create()); + if (mpUseSwInterpreter->IsValueChangedFromSaved()) + { + officecfg::Office::Common::Misc::UseSwInterpreter::set(mpUseSwInterpreter->IsChecked(), batch); + bModified = true; + + ScopedVclPtrInstance aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO); + aWarnBox->Execute(); + } + if (mpUseOpenCL->IsValueChangedFromSaved()) maConfig.mbUseOpenCL = mpUseOpenCL->IsChecked(); @@ -195,6 +209,9 @@ void SvxOpenCLTabPage::Reset( const SfxItemSet* ) { maConfig = OpenCLConfig::get(); + mpUseSwInterpreter->Check(officecfg::Office::Common::Misc::UseSwInterpreter::get()); + mpUseSwInterpreter->SaveValue(); + mpUseOpenCL->Check(maConfig.mbUseOpenCL); mpUseOpenCL->SaveValue(); -- cgit