Kaydet (Commit) 97a74ee6 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Intermediate commit: start on whitelist/blacklist of OpenCL implementations

Change-Id: I5a6ef8f5e428ec4e62b3fdac8fe3e63f0ae58f1b
üst ef809ce9
...@@ -1389,6 +1389,20 @@ ...@@ -1389,6 +1389,20 @@
</info> </info>
<value/> <value/>
</prop> </prop>
<prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
<info>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
</info>
<value/>
</prop>
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
<info>
<desc>Like OpenCLWhiteList, but for combinations known to be bad.</desc>
</info>
<value separator=";">Windows/*/Intel(R) Corporation/9.17.10.2884;SuperOS/1.0/Big Corp, Inc./2.3\/beta</value>
</prop>
</group> </group>
<group oor:name="Syntax"> <group oor:name="Syntax">
<info> <info>
......
...@@ -52,6 +52,9 @@ struct SC_DLLPUBLIC ScCalcConfig ...@@ -52,6 +52,9 @@ struct SC_DLLPUBLIC ScCalcConfig
sal_Int32 mnOpenCLMinimumFormulaGroupSize; sal_Int32 mnOpenCLMinimumFormulaGroupSize;
std::set<OpCodeEnum> maOpenCLSubsetOpCodes; std::set<OpCodeEnum> maOpenCLSubsetOpCodes;
std::set<OUString> maOpenCLWhiteList;
std::set<OUString> maOpenCLBlackList;
ScCalcConfig(); ScCalcConfig();
void setOpenCLConfigToDefault(); void setOpenCLConfigToDefault();
......
...@@ -38,6 +38,10 @@ void ScCalcConfig::setOpenCLConfigToDefault() ...@@ -38,6 +38,10 @@ void ScCalcConfig::setOpenCLConfigToDefault()
mbOpenCLAutoSelect = true; mbOpenCLAutoSelect = true;
mnOpenCLMinimumFormulaGroupSize = 20; mnOpenCLMinimumFormulaGroupSize = 20;
maOpenCLSubsetOpCodes = {ocMin, ocMax, ocSum, ocAverage, ocSumIfs}; maOpenCLSubsetOpCodes = {ocMin, ocMax, ocSum, ocAverage, ocSumIfs};
maOpenCLBlackList = {
"Windows/*/Intel(R) Corporation/9.17.10.2884",
"SuperOS/1.0/Big Corp, Inc./2.3\\/beta"
};
} }
void ScCalcConfig::reset() void ScCalcConfig::reset()
...@@ -64,7 +68,9 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const ...@@ -64,7 +68,9 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
mbOpenCLAutoSelect == r.mbOpenCLAutoSelect && mbOpenCLAutoSelect == r.mbOpenCLAutoSelect &&
maOpenCLDevice == r.maOpenCLDevice && maOpenCLDevice == r.maOpenCLDevice &&
mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize && mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize &&
maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes; maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes &&
maOpenCLWhiteList == r.maOpenCLWhiteList &&
maOpenCLBlackList == r.maOpenCLBlackList;
} }
bool ScCalcConfig::operator!= (const ScCalcConfig& r) const bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
...@@ -72,6 +78,20 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const ...@@ -72,6 +78,20 @@ bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
return !operator==(r); return !operator==(r);
} }
namespace {
void writeStringSet(std::ostream& rStream, const std::set<OUString>& rSet)
{
for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
{
if (i != rSet.cbegin())
rStream << ",";
rStream << (*i).replaceAll(",", "\\,");
}
}
} // anonymous namespace
std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& rConfig) std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
{ {
rStream << "{" rStream << "{"
...@@ -83,7 +103,13 @@ std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig& ...@@ -83,7 +103,13 @@ std::ostream& SC_DLLPUBLIC operator<<(std::ostream& rStream, const ScCalcConfig&
"OpenCLAutoSelect=" << (rConfig.mbOpenCLAutoSelect?"Y":"N") << "," "OpenCLAutoSelect=" << (rConfig.mbOpenCLAutoSelect?"Y":"N") << ","
"OpenCLDevice='" << rConfig.maOpenCLDevice << "'," "OpenCLDevice='" << rConfig.maOpenCLDevice << "',"
"OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << "," "OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << ","
"OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "}" "OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "},"
"OpenCLWhiteList={";
writeStringSet(rStream, rConfig.maOpenCLWhiteList);
rStream << "},"
"OpenCLBlackList={";
writeStringSet(rStream, rConfig.maOpenCLBlackList);
rStream << "}"
"}"; "}";
return rStream; return rStream;
} }
......
...@@ -203,7 +203,9 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const ...@@ -203,7 +203,9 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
#define SCFORMULAOPT_OPENCL_SUBSET_ONLY 13 #define SCFORMULAOPT_OPENCL_SUBSET_ONLY 13
#define SCFORMULAOPT_OPENCL_MIN_SIZE 14 #define SCFORMULAOPT_OPENCL_MIN_SIZE 14
#define SCFORMULAOPT_OPENCL_SUBSET_OPS 15 #define SCFORMULAOPT_OPENCL_SUBSET_OPS 15
#define SCFORMULAOPT_COUNT 16 #define SCFORMULAOPT_OPENCL_WHITELIST 16
#define SCFORMULAOPT_OPENCL_BLACKLIST 17
#define SCFORMULAOPT_COUNT 18
Sequence<OUString> ScFormulaCfg::GetPropertyNames() Sequence<OUString> ScFormulaCfg::GetPropertyNames()
{ {
...@@ -225,6 +227,8 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames() ...@@ -225,6 +227,8 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
"Calculation/OpenCLSubsetOnly", // SCFORMULAOPT_OPENCL_SUBSET_ONLY "Calculation/OpenCLSubsetOnly", // SCFORMULAOPT_OPENCL_SUBSET_ONLY
"Calculation/OpenCLMinimumDataSize", // SCFORMULAOPT_OPENCL_MIN_SIZE "Calculation/OpenCLMinimumDataSize", // SCFORMULAOPT_OPENCL_MIN_SIZE
"Calculation/OpenCLSubsetOpCodes", // SCFORMULAOPT_OPENCL_SUBSET_OPS "Calculation/OpenCLSubsetOpCodes", // SCFORMULAOPT_OPENCL_SUBSET_OPS
"Calculation/OpenCLWhiteList", // SCFORMULAOPT_OPENCL_WHITELIST
"Calculation/OpenCLBlackList", // SCFORMULAOPT_OPENCL_BLACKLIST
}; };
Sequence<OUString> aNames(SCFORMULAOPT_COUNT); Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
OUString* pNames = aNames.getArray(); OUString* pNames = aNames.getArray();
...@@ -254,6 +258,8 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId() ...@@ -254,6 +258,8 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
SCFORMULAOPT_OPENCL_SUBSET_ONLY, SCFORMULAOPT_OPENCL_SUBSET_ONLY,
SCFORMULAOPT_OPENCL_MIN_SIZE, SCFORMULAOPT_OPENCL_MIN_SIZE,
SCFORMULAOPT_OPENCL_SUBSET_OPS, SCFORMULAOPT_OPENCL_SUBSET_OPS,
SCFORMULAOPT_OPENCL_WHITELIST,
SCFORMULAOPT_OPENCL_BLACKLIST,
}; };
OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync"); OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync");
PropsToIds aPropIdMap; PropsToIds aPropIdMap;
...@@ -270,6 +276,35 @@ ScFormulaCfg::ScFormulaCfg() : ...@@ -270,6 +276,35 @@ ScFormulaCfg::ScFormulaCfg() :
EnableNotification( aNames ); EnableNotification( aNames );
} }
namespace {
css::uno::Sequence<OUString> StringSetToStringSequence(std::set<OUString>& rSet)
{
css::uno::Sequence<OUString> result(rSet.size());
size_t n(0);
for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
{
result[n++] = *i;
}
return result;
}
std::set<OUString> StringSequenceToStringSet(css::uno::Sequence<OUString>& rSequence)
{
std::set<OUString> result;
for (auto i = rSequence.begin(); i != rSequence.end(); ++i)
{
result.insert(*i);
}
return result;
}
} // anonymous namespace
void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames ) void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
{ {
Sequence<Any> aValues = GetProperties(aNames); Sequence<Any> aValues = GetProperties(aNames);
...@@ -512,8 +547,20 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames ) ...@@ -512,8 +547,20 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal); GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
} }
break; break;
default: case SCFORMULAOPT_OPENCL_WHITELIST:
; {
css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] >>= sVal;
GetCalcConfig().maOpenCLWhiteList = StringSequenceToStringSet(sVal);
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] >>= sVal;
GetCalcConfig().maOpenCLBlackList = StringSequenceToStringSet(sVal);
}
break;
} }
} }
} }
...@@ -667,8 +714,18 @@ void ScFormulaCfg::Commit() ...@@ -667,8 +714,18 @@ void ScFormulaCfg::Commit()
pValues[nProp] <<= sVal; pValues[nProp] <<= sVal;
} }
break; break;
default: case SCFORMULAOPT_OPENCL_WHITELIST:
; {
css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] <<= sVal;
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
css::uno::Sequence<OUString> sVal = StringSetToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] <<= sVal;
}
break;
} }
} }
if(bSetOpenCL) if(bSetOpenCL)
......
...@@ -29,7 +29,9 @@ typedef enum { ...@@ -29,7 +29,9 @@ typedef enum {
CALC_OPTION_ENABLE_OPENCL, CALC_OPTION_ENABLE_OPENCL,
CALC_OPTION_ENABLE_OPENCL_SUBSET, CALC_OPTION_ENABLE_OPENCL_SUBSET,
CALC_OPTION_OPENCL_MIN_SIZE, CALC_OPTION_OPENCL_MIN_SIZE,
CALC_OPTION_OPENCL_SUBSET_OPS CALC_OPTION_OPENCL_SUBSET_OPS,
CALC_OPTION_OPENCL_WHITELIST,
CALC_OPTION_OPENCL_BLACKLIST,
} CalcOptionOrder; } CalcOptionOrder;
class OptionString : public SvLBoxString class OptionString : public SvLBoxString
...@@ -141,6 +143,11 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi ...@@ -141,6 +143,11 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
get(mpBtnFalse, "false"); get(mpBtnFalse, "false");
get(mpSpinButton, "spinbutton"); get(mpSpinButton, "spinbutton");
get(mpEditField, "entry"); get(mpEditField, "entry");
get(mpListGrid, "listgrid");
get(mpListBox, "listbox");
get(mpListEditButton, "listbox-edit");
get(mpListNewButton, "listbox-new");
get(mpListDeleteButton, "listbox-delete");
get(mpOpenclInfoList, "opencl_list"); get(mpOpenclInfoList, "opencl_list");
get(mpBtnAutomaticSelectionTrue, "automatic_select_true"); get(mpBtnAutomaticSelectionTrue, "automatic_select_true");
get(mpBtnAutomaticSelectionFalse, "automatic_select_false"); get(mpBtnAutomaticSelectionFalse, "automatic_select_false");
...@@ -151,6 +158,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi ...@@ -151,6 +158,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, NumModifiedHdl)); mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, NumModifiedHdl));
mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
mpListBox->set_height_request(4* mpListBox->GetTextHeight());
mpListBox->SetStyle(mpListBox->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight()); mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight());
mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE); mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
mpOpenclInfoList->SetHighlightRange(); mpOpenclInfoList->SetHighlightRange();
...@@ -185,6 +195,27 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi ...@@ -185,6 +195,27 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
maCaptionOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes")->GetText(); maCaptionOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes")->GetText();
maDescOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes_desc")->GetText(); maDescOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes_desc")->GetText();
maCaptionOpenCLWhiteList = get<vcl::Window>("opencl_whitelist")->GetText();
maDescOpenCLWhiteList = get<vcl::Window>("opencl_whitelist_desc")->GetText();
maCaptionOpenCLBlackList = get<vcl::Window>("opencl_blacklist")->GetText();
maDescOpenCLBlackList = get<vcl::Window>("opencl_blacklist_desc")->GetText();
maCaptionOS = get<vcl::Window>("oslabel")->GetText();
maDescOS = get<vcl::Window>("os_desc")->GetText();
maCaptionOSVersion = get<vcl::Window>("osversionlabel")->GetText();
maDescOSVersion = get<vcl::Window>("osversion_desc")->GetText();
maCaptionOpenCLVendor = get<vcl::Window>("openclvendorlabel")->GetText();
maDescOpenCLVendor = get<vcl::Window>("openclvendor_desc")->GetText();
maCaptionOpenCLDevice = get<vcl::Window>("opencldevicelabel")->GetText();
maDescOpenCLDevice = get<vcl::Window>("opencldevice_desc")->GetText();
maCaptionOpenCLDriverVersion = get<vcl::Window>("opencldriverversionlabel")->GetText();
maDescOpenCLDriverVersion = get<vcl::Window>("opencldriverversion_desc")->GetText();
maSoftware = get<vcl::Window>("software")->GetText(); maSoftware = get<vcl::Window>("software")->GetText();
mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight()); mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight());
...@@ -237,6 +268,16 @@ SvTreeListEntry *ScCalcOptionsDialog::createStringItem(const OUString &rCaption, ...@@ -237,6 +268,16 @@ SvTreeListEntry *ScCalcOptionsDialog::createStringItem(const OUString &rCaption,
return pEntry; return pEntry;
} }
SvTreeListEntry *ScCalcOptionsDialog::createStringListItem(const OUString &rCaption) const
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
pEntry->AddItem(new SvLBoxString(pEntry, 0, OUString()));
pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), false));
OptionString* pItem = new OptionString(rCaption, "");
pEntry->AddItem(pItem);
return pEntry;
}
void ScCalcOptionsDialog::setValueAt(size_t nPos, const OUString &rValue) void ScCalcOptionsDialog::setValueAt(size_t nPos, const OUString &rValue)
{ {
SvTreeList *pModel = mpLbSettings->GetModel(); SvTreeList *pModel = mpLbSettings->GetModel();
...@@ -276,7 +317,7 @@ void ScCalcOptionsDialog::fillOpenCLList() ...@@ -276,7 +317,7 @@ void ScCalcOptionsDialog::fillOpenCLList()
for(std::vector<sc::OpenCLDeviceInfo>::iterator for(std::vector<sc::OpenCLDeviceInfo>::iterator
itr = it->maDevices.begin(), itrEnd = it->maDevices.end(); itr != itrEnd; ++itr) itr = it->maDevices.begin(), itrEnd = it->maDevices.end(); itr != itrEnd; ++itr)
{ {
OUString aDeviceId = it->maVendor + " " + itr->maName; OUString aDeviceId = it->maVendor + " " + itr->maName + " " + itr->maDriver;
SvTreeListEntry* pEntry = mpOpenclInfoList->InsertEntry(aDeviceId); SvTreeListEntry* pEntry = mpOpenclInfoList->InsertEntry(aDeviceId);
if(aDeviceId == aStoredDevice) if(aDeviceId == aStoredDevice)
{ {
...@@ -297,6 +338,23 @@ void ScCalcOptionsDialog::fillOpenCLList() ...@@ -297,6 +338,23 @@ void ScCalcOptionsDialog::fillOpenCLList()
SelectedDeviceChanged(); SelectedDeviceChanged();
} }
namespace {
void fillListBox(ListBox* pListBox, const std::set<OUString>& rSet)
{
pListBox->SetUpdateMode(false);
pListBox->Clear();
for (auto i = rSet.cbegin(); i != rSet.cend(); ++i)
{
pListBox->InsertEntry(*i, LISTBOX_APPEND);
}
pListBox->SetUpdateMode(true);
}
} // anonymous namespace
#endif #endif
namespace { namespace {
...@@ -338,6 +396,8 @@ void ScCalcOptionsDialog::FillOptionsList() ...@@ -338,6 +396,8 @@ void ScCalcOptionsDialog::FillOptionsList()
pModel->Insert(createBoolItem(maCaptionOpenCLSubsetEnabled,maConfig.mbOpenCLSubsetOnly)); pModel->Insert(createBoolItem(maCaptionOpenCLSubsetEnabled,maConfig.mbOpenCLSubsetOnly));
pModel->Insert(createIntegerItem(maCaptionOpenCLMinimumFormulaSize,maConfig.mnOpenCLMinimumFormulaGroupSize)); pModel->Insert(createIntegerItem(maCaptionOpenCLMinimumFormulaSize,maConfig.mnOpenCLMinimumFormulaGroupSize));
pModel->Insert(createStringItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes))); pModel->Insert(createStringItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes)));
pModel->Insert(createStringListItem(maCaptionOpenCLWhiteList));
pModel->Insert(createStringListItem(maCaptionOpenCLBlackList));
fillOpenCLList(); fillOpenCLList();
...@@ -360,6 +420,7 @@ void ScCalcOptionsDialog::SelectionChanged() ...@@ -360,6 +420,7 @@ void ScCalcOptionsDialog::SelectionChanged()
mpBtnFalse->Hide(); mpBtnFalse->Hide();
mpSpinButton->Hide(); mpSpinButton->Hide();
mpEditField->Hide(); mpEditField->Hide();
mpListGrid->Hide();
mpLbOptionEdit->Show(); mpLbOptionEdit->Show();
mpOpenclInfoList->GetParent()->Hide(); mpOpenclInfoList->GetParent()->Hide();
...@@ -394,6 +455,7 @@ void ScCalcOptionsDialog::SelectionChanged() ...@@ -394,6 +455,7 @@ void ScCalcOptionsDialog::SelectionChanged()
mpBtnFalse->Hide(); mpBtnFalse->Hide();
mpSpinButton->Hide(); mpSpinButton->Hide();
mpEditField->Hide(); mpEditField->Hide();
mpListGrid->Hide();
mpLbOptionEdit->Show(); mpLbOptionEdit->Show();
mpOpenclInfoList->GetParent()->Hide(); mpOpenclInfoList->GetParent()->Hide();
...@@ -426,12 +488,12 @@ void ScCalcOptionsDialog::SelectionChanged() ...@@ -426,12 +488,12 @@ void ScCalcOptionsDialog::SelectionChanged()
case CALC_OPTION_ENABLE_OPENCL: case CALC_OPTION_ENABLE_OPENCL:
case CALC_OPTION_ENABLE_OPENCL_SUBSET: case CALC_OPTION_ENABLE_OPENCL_SUBSET:
{ {
// Treat empty string as zero.
mpLbOptionEdit->Hide(); mpLbOptionEdit->Hide();
mpBtnTrue->Show(); mpBtnTrue->Show();
mpBtnFalse->Show(); mpBtnFalse->Show();
mpSpinButton->Hide(); mpSpinButton->Hide();
mpEditField->Hide(); mpEditField->Hide();
mpListGrid->Hide();
bool bValue = false; bool bValue = false;
bool bEnable = true; bool bEnable = true;
...@@ -508,6 +570,7 @@ void ScCalcOptionsDialog::SelectionChanged() ...@@ -508,6 +570,7 @@ void ScCalcOptionsDialog::SelectionChanged()
mpBtnFalse->Hide(); mpBtnFalse->Hide();
mpSpinButton->Show(); mpSpinButton->Show();
mpEditField->Hide(); mpEditField->Hide();
mpListGrid->Hide();
mpOpenclInfoList->GetParent()->Hide(); mpOpenclInfoList->GetParent()->Hide();
mpFtAnnotation->SetText(maDescOpenCLMinimumFormulaSize); mpFtAnnotation->SetText(maDescOpenCLMinimumFormulaSize);
mpSpinButton->SetValue(nValue); mpSpinButton->SetValue(nValue);
...@@ -524,11 +587,37 @@ void ScCalcOptionsDialog::SelectionChanged() ...@@ -524,11 +587,37 @@ void ScCalcOptionsDialog::SelectionChanged()
mpBtnFalse->Hide(); mpBtnFalse->Hide();
mpSpinButton->Hide(); mpSpinButton->Hide();
mpEditField->Show(); mpEditField->Show();
mpListGrid->Hide();
mpOpenclInfoList->GetParent()->Hide(); mpOpenclInfoList->GetParent()->Hide();
mpFtAnnotation->SetText(maDescOpenCLSubsetOpCodes); mpFtAnnotation->SetText(maDescOpenCLSubsetOpCodes);
mpEditField->SetText(sValue); mpEditField->SetText(sValue);
} }
break; break;
// string lists
case CALC_OPTION_OPENCL_WHITELIST:
case CALC_OPTION_OPENCL_BLACKLIST:
{
// SAL _DEBUG(__FILE__ ":" << __LINE__ << ": " << maConfig);
mpLbOptionEdit->Hide();
mpBtnTrue->Hide();
mpBtnFalse->Hide();
mpSpinButton->Hide();
mpEditField->Hide();
mpListGrid->Show();
mpOpenclInfoList->GetParent()->Hide();
if ( nSelectedPos == CALC_OPTION_OPENCL_WHITELIST )
{
mpFtAnnotation->SetText(maDescOpenCLWhiteList);
fillListBox(mpListBox, maConfig.maOpenCLWhiteList);
}
else
{
mpFtAnnotation->SetText(maDescOpenCLBlackList);
fillListBox(mpListBox, maConfig.maOpenCLBlackList);
}
}
break;
} }
} }
...@@ -582,7 +671,9 @@ void ScCalcOptionsDialog::ListOptionValueChanged() ...@@ -582,7 +671,9 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
case CALC_OPTION_ENABLE_OPENCL_SUBSET: case CALC_OPTION_ENABLE_OPENCL_SUBSET:
case CALC_OPTION_OPENCL_MIN_SIZE: case CALC_OPTION_OPENCL_MIN_SIZE:
case CALC_OPTION_OPENCL_SUBSET_OPS: case CALC_OPTION_OPENCL_SUBSET_OPS:
break; case CALC_OPTION_OPENCL_WHITELIST:
case CALC_OPTION_OPENCL_BLACKLIST:
break;
} }
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <svx/checklbx.hxx> #include <svx/checklbx.hxx>
#include <svtools/treelistbox.hxx> #include <svtools/treelistbox.hxx>
...@@ -62,6 +63,7 @@ private: ...@@ -62,6 +63,7 @@ private:
SvTreeListEntry *createBoolItem(const OUString &rCaption, bool bValue) const; SvTreeListEntry *createBoolItem(const OUString &rCaption, bool bValue) const;
SvTreeListEntry *createIntegerItem(const OUString &rCaption, sal_Int32 nValue) const; SvTreeListEntry *createIntegerItem(const OUString &rCaption, sal_Int32 nValue) const;
SvTreeListEntry *createStringItem(const OUString &rCaption, const OUString& sValue) const; SvTreeListEntry *createStringItem(const OUString &rCaption, const OUString& sValue) const;
SvTreeListEntry *createStringListItem(const OUString &rCaption) const;
void setValueAt(size_t nPos, const OUString &rString); void setValueAt(size_t nPos, const OUString &rString);
private: private:
...@@ -72,6 +74,11 @@ private: ...@@ -72,6 +74,11 @@ private:
RadioButton* mpBtnFalse; RadioButton* mpBtnFalse;
NumericField* mpSpinButton; NumericField* mpSpinButton;
Edit* mpEditField; Edit* mpEditField;
VclGrid* mpListGrid;
ListBox* mpListBox;
PushButton* mpListEditButton;
PushButton* mpListNewButton;
PushButton* mpListDeleteButton;
FixedText* mpFtAnnotation; FixedText* mpFtAnnotation;
FixedText* mpFtFrequency; FixedText* mpFtFrequency;
...@@ -116,6 +123,27 @@ private: ...@@ -116,6 +123,27 @@ private:
OUString maCaptionOpenCLSubsetOpCodes; OUString maCaptionOpenCLSubsetOpCodes;
OUString maDescOpenCLSubsetOpCodes; OUString maDescOpenCLSubsetOpCodes;
OUString maCaptionOpenCLWhiteList;
OUString maDescOpenCLWhiteList;
OUString maCaptionOpenCLBlackList;
OUString maDescOpenCLBlackList;
OUString maCaptionOS;
OUString maDescOS;
OUString maCaptionOSVersion;
OUString maDescOSVersion;
OUString maCaptionOpenCLVendor;
OUString maDescOpenCLVendor;
OUString maCaptionOpenCLDevice;
OUString maDescOpenCLDevice;
OUString maCaptionOpenCLDriverVersion;
OUString maDescOpenCLDriverVersion;
OUString maSoftware; OUString maSoftware;
ScCalcConfig maConfig; ScCalcConfig maConfig;
......
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