Kaydet (Commit) 4b5a9894 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#73408: Make the software interpreter selection stick in the UI.

Change-Id: I136a98fadbde82a7a585df9a5691f884c0362699
üst d8fd1587
......@@ -23,6 +23,10 @@
// set (in nScriptType) if type has not been determined yet
#define SC_SCRIPTTYPE_UNKNOWN 0x08
// Device name used to represent the software group interpreter for OpenCL
// mode. This string gets stored in use configuration as the device name.
#define OPENCL_SOFTWARE_DEVICE_CONFIG_NAME "Software"
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -16,6 +16,7 @@
#include "compiler.hxx"
#include "interpre.hxx"
#include "scmatrix.hxx"
#include "globalnames.hxx"
#include "formula/vectortoken.hxx"
#include "rtl/bootstrap.hxx"
......@@ -599,7 +600,7 @@ void FormulaGroupInterpreter::fillOpenCLInfo(std::vector<OpenclPlatformInfo>& rP
bool FormulaGroupInterpreter::switchOpenCLDevice(const OUString& rDeviceId, bool bAutoSelect, bool bForceEvaluation)
{
bool bOpenCLEnabled = ScInterpreter::GetGlobalConfig().mbOpenCLEnabled;
if(!bOpenCLEnabled || rDeviceId == "Software")
if (!bOpenCLEnabled || rDeviceId == OPENCL_SOFTWARE_DEVICE_CONFIG_NAME)
{
if(msInstance)
{
......
......@@ -16,6 +16,7 @@
#if HAVE_FEATURE_OPENCL
#include "formulagroup.hxx"
#include "globalnames.hxx"
#endif
namespace {
......@@ -200,7 +201,7 @@ void ScCalcOptionsDialog::fillOpenclList()
{
mpOpenclInfoList->SetUpdateMode(false);
mpOpenclInfoList->Clear();
mpOpenclInfoList->InsertEntry(maSoftware);
SvTreeListEntry* pSoftwareEntry = mpOpenclInfoList->InsertEntry(maSoftware);
OUString aStoredDevice = maConfig.maOpenCLDevice;
......@@ -225,10 +226,12 @@ void ScCalcOptionsDialog::fillOpenclList()
mpOpenclInfoList->SetUpdateMode(true);
mpOpenclInfoList->GetModel()->GetView(0)->SelectAll(false, false);
if(pSelectedEntry)
{
mpOpenclInfoList->GetModel()->GetView(0)->Select(pSelectedEntry);
}
if (pSelectedEntry)
mpOpenclInfoList->Select(pSelectedEntry);
else if (aStoredDevice == OPENCL_SOFTWARE_DEVICE_CONFIG_NAME)
mpOpenclInfoList->Select(pSoftwareEntry);
SelectedDeviceChanged();
}
......@@ -404,7 +407,7 @@ void ScCalcOptionsDialog::SelectedDeviceChanged()
OUString aDevice = dynamic_cast<SvLBoxString*>(pEntry->GetItem(1))->GetText();
// use english string for configuration
if(aDevice == maSoftware)
aDevice = "Software";
aDevice = OPENCL_SOFTWARE_DEVICE_CONFIG_NAME;
maConfig.maOpenCLDevice = aDevice;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment