summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-24 18:08:55 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-28 10:21:30 +0200
commit2f0d4b3c41def8a2bc5a1440d53a008fe40da577 (patch)
tree588217e33686ef21f678cc1d3f056dbec2d0a261 /sc/source/ui
parent030c604642e3ce5058b9d83cb94319cd6b7ef4d5 (diff)
Make whether to use OpenCL or not a global option
Add a toggle to the "General" page. Change-Id: If35b1472032706b09a3bc3499c55cbd3ac2e13ac
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx28
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.hxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx8
3 files changed, 5 insertions, 34 deletions
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 0b0d160d05dd..2a19a76d5797 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 705873cde91c..5c483b02976f 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 aa555196f025..94a06f050073 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);
}