summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-13 16:57:56 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-19 17:03:18 +0200
commitfbe359018a4f0be9eb8f4e05435fab947dfcb308 (patch)
tree788f0ff215c6a5ffc48f0b9d4c6a1843f19d2e89
parent2eada22f6f2495e9e61be63a896e3a839be08702 (diff)
store opencl auto select setting in configuration
Change-Id: I687b31959b2932cc1b5f7ce6daea8d7bbbe85ee5
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs7
-rw-r--r--sc/inc/calcconfig.hxx1
-rw-r--r--sc/source/core/tool/calcconfig.cxx6
-rw-r--r--sc/source/core/tool/formulaopt.cxx21
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx2
5 files changed, 32 insertions, 5 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index ada44161f99f..5950597cd73b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1337,6 +1337,13 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="OpenCLAutoSelect" oor:type="xs:boolean" oor:nillable="false">
+ <!-- UIHints: Tools - Options Spreadsheet Formula -->
+ <info>
+ <desc>Whether to automatically select the OpenCL device</desc>
+ </info>
+ <value>true</value>
+ </prop>
</group>
<group oor:name="Syntax">
<info>
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index aace08dad030..14778744279d 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -29,6 +29,7 @@ struct SC_DLLPUBLIC ScCalcConfig
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax;
bool mbEmptyStringAsZero:1;
bool mbOpenCLEnabled:1;
+ bool mbOpenCLAutoSelect:1;
ScCalcConfig();
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx
index 896e0092322a..12784028d3dc 100644
--- a/sc/source/core/tool/calcconfig.cxx
+++ b/sc/source/core/tool/calcconfig.cxx
@@ -12,7 +12,8 @@
ScCalcConfig::ScCalcConfig() :
meStringRefAddressSyntax(formula::FormulaGrammar::CONV_UNSPECIFIED),
mbEmptyStringAsZero(false),
- mbOpenCLEnabled(false)
+ mbOpenCLEnabled(false),
+ mbOpenCLAutoSelect(true)
{
}
@@ -25,7 +26,8 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
{
return meStringRefAddressSyntax == r.meStringRefAddressSyntax &&
mbEmptyStringAsZero == r.mbEmptyStringAsZero &&
- mbOpenCLEnabled == r.mbOpenCLEnabled;
+ mbOpenCLEnabled == r.mbOpenCLEnabled &&
+ mbOpenCLAutoSelect == r.mbOpenCLAutoSelect;
}
bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 0868fd20db36..bf6b385fbd0d 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -196,7 +196,8 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
#define SCFORMULAOPT_OOXML_RECALC 7
#define SCFORMULAOPT_ODF_RECALC 8
#define SCFORMULAOPT_OPENCL_ENABLED 9
-#define SCFORMULAOPT_COUNT 10
+#define SCFORMULAOPT_OPENCL_AUTOSELECT 10
+#define SCFORMULAOPT_COUNT 11
Sequence<OUString> ScFormulaCfg::GetPropertyNames()
{
@@ -211,7 +212,8 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
"Syntax/EmptyStringAsZero", // SCFORMULAOPT_EMPTY_STRING_AS_ZERO
"Load/OOXMLRecalcMode", // SCFORMULAOPT_OOXML_RECALC
"Load/ODFRecalcMode", // SCFORMULAOPT_ODF_RECALC
- "Calculation/OpenCL" // SCFORMULAOPT_OPENCL_ENABLED
+ "Calculation/OpenCL", // SCFORMULAOPT_OPENCL_ENABLED
+ "Calculation/OpenCLAutoSelect" // SCFORMULAOPT_OPENCL_AUTOSELECT
};
Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
OUString* pNames = aNames.getArray();
@@ -224,7 +226,7 @@ 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_EMPTY_STRING_AS_ZERO, SCFORMULAOPT_OOXML_RECALC, SCFORMULAOPT_ODF_RECALC, SCFORMULAOPT_OPENCL_ENABLED };
+ 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_EMPTY_STRING_AS_ZERO, SCFORMULAOPT_OOXML_RECALC, SCFORMULAOPT_ODF_RECALC, SCFORMULAOPT_OPENCL_ENABLED, SCFORMULAOPT_OPENCL_AUTOSELECT };
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 )
@@ -409,6 +411,13 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
pValues[nProp] >>= bVal;
GetCalcConfig().mbOpenCLEnabled = bVal;
}
+ break;
+ case SCFORMULAOPT_OPENCL_AUTOSELECT:
+ {
+ sal_Bool bVal = GetCalcConfig().mbOpenCLAutoSelect;
+ pValues[nProp] >>= bVal;
+ GetCalcConfig().mbOpenCLAutoSelect = bVal;
+ }
default:
;
}
@@ -517,6 +526,12 @@ void ScFormulaCfg::Commit()
pValues[nProp] <<= bVal;
}
break;
+ case SCFORMULAOPT_OPENCL_AUTOSELECT:
+ {
+ sal_Bool bVal = GetCalcConfig().mbOpenCLAutoSelect;
+ pValues[nProp] <<= bVal;
+ }
+ break;
default:
;
}
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 4ac8b917e42e..76871cb0b008 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -349,6 +349,8 @@ void ScCalcOptionsDialog::OpenclAutomaticSelectionChanged()
mpOpenclInfoList->Disable();
else
mpOpenclInfoList->Enable();
+
+ maConfig.mbOpenCLAutoSelect = bValue;
}
void ScCalcOptionsDialog::RadioValueChanged()