diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-11-29 01:36:33 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-11-29 01:38:55 +0100 |
commit | f8b86f6dec86eb30a4e522d4dceeb04b06edc0c3 (patch) | |
tree | 2c704c67405ae4f1e103dde25f2f9851c496b505 /sc/source/core/tool | |
parent | 169658bfa38c684219e24a2e30893e1e30ea6621 (diff) |
only call switchOpenCLDevice only once
Change-Id: Id926b139b14ee667ce4ac0674a3c090b52680649
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r-- | sc/source/core/tool/formulaopt.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx index 21a453f50c59..f3336866fc49 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -442,6 +442,7 @@ void ScFormulaCfg::Commit() Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues(aNames.getLength()); Any* pValues = aValues.getArray(); + bool bSetOpenCL = false; for (int nProp = 0; nProp < aNames.getLength(); ++nProp) { @@ -535,28 +536,31 @@ void ScFormulaCfg::Commit() { sal_Bool bVal = GetCalcConfig().mbOpenCLEnabled; pValues[nProp] <<= bVal; + bSetOpenCL = bVal; } break; case SCFORMULAOPT_OPENCL_AUTOSELECT: { sal_Bool bVal = GetCalcConfig().mbOpenCLAutoSelect; pValues[nProp] <<= bVal; - sc::FormulaGroupInterpreter::switchOpenCLDevice( - GetCalcConfig().maOpenCLDevice, bVal); + bSetOpenCL = true; } break; case SCFORMULAOPT_OPENCL_DEVICE: { OUString aOpenCLDevice = GetCalcConfig().maOpenCLDevice; pValues[nProp] <<= aOpenCLDevice; - sc::FormulaGroupInterpreter::switchOpenCLDevice( - aOpenCLDevice, GetCalcConfig().mbOpenCLAutoSelect); + bSetOpenCL = true; } break; default: ; } } + if(bSetOpenCL) + sc::FormulaGroupInterpreter::switchOpenCLDevice( + GetCalcConfig().maOpenCLDevice, GetCalcConfig().mbOpenCLAutoSelect); + PutProperties(aNames, aValues); } |