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:39:26 +0100 |
commit | 71591666441cfe39fd21560734e754371289ee6f (patch) | |
tree | c578053914a19b8306e90bd52d641a34735d61b5 | |
parent | 68b2573a60d145e81cdef7748e4107c84bfa1b47 (diff) |
only call switchOpenCLDevice only once
Change-Id: Id926b139b14ee667ce4ac0674a3c090b52680649
-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 ec6696a497fc..181f9d696f93 100644 --- a/sc/source/core/tool/formulaopt.cxx +++ b/sc/source/core/tool/formulaopt.cxx @@ -447,6 +447,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) { @@ -540,28 +541,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); } |