Remove effectively dead code

We haven't displayed any list of OpenCL devices to select from in this
dialog for a long time, so remove the associated code.

Change-Id: Ife0c624a8bfb829bd1e62e0a000c7681d696f40b
This commit is contained in:
Tor Lillqvist
2016-07-27 10:59:00 +03:00
parent c0f1c0da77
commit a92da660cd
3 changed files with 0 additions and 254 deletions

View File

@@ -84,12 +84,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
, mbWriteConfig(bWriteConfig)
{
get(mpTestButton, "test");
get(mpOpenclInfoList, "opencl_list");
get(mpBtnAutomaticSelectionTrue, "automatic_select_true");
get(mpBtnAutomaticSelectionFalse, "automatic_select_false");
get(mpFtFrequency, "frequency");
get(mpFtComputeUnits, "compute_units");
get(mpFtMemory, "memory");
get(mpConversion,"comboConversion");
mpConversion->SelectEntryPos(static_cast<sal_Int32>(rConfig.meStringConversion));
@@ -122,16 +116,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl));
mpOpenclInfoList->set_height_request(4* mpOpenclInfoList->GetTextHeight());
mpOpenclInfoList->SetStyle(mpOpenclInfoList->GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
mpOpenclInfoList->SetHighlightRange();
mpOpenclInfoList->GetParent()->Hide();
mpOpenclInfoList->SetSelectHdl(LINK(this, ScCalcOptionsDialog, DeviceSelHdl));
mpBtnAutomaticSelectionTrue->SetToggleHdl(LINK(this, ScCalcOptionsDialog, BtnAutomaticSelectHdl));
maSoftware = get<vcl::Window>("software")->GetText();
mpTestButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, TestClickHdl));
}
@@ -150,58 +134,9 @@ void ScCalcOptionsDialog::dispose()
mpSpinButton.clear();
mpEditField.clear();
mpTestButton.clear();
mpFtFrequency.clear();
mpFtComputeUnits.clear();
mpFtMemory.clear();
mpOpenclInfoList.clear();
mpBtnAutomaticSelectionTrue.clear();
mpBtnAutomaticSelectionFalse.clear();
ModalDialog::dispose();
}
void ScCalcOptionsDialog::OpenCLAutomaticSelectionChanged()
{
bool bValue = mpBtnAutomaticSelectionTrue->IsChecked();
if(bValue)
mpOpenclInfoList->Disable();
else
mpOpenclInfoList->Enable();
maConfig.mbOpenCLAutoSelect = bValue;
}
void ScCalcOptionsDialog::SelectedDeviceChanged()
{
#if HAVE_FEATURE_OPENCL
SvTreeListEntry* pEntry = mpOpenclInfoList->GetModel()->GetView(0)->FirstSelected();
if(!pEntry)
return;
OpenCLDeviceInfo* pInfo = static_cast<OpenCLDeviceInfo*>(pEntry->GetUserData());
if(pInfo)
{
mpFtFrequency->SetText(OUString::number(pInfo->mnFrequency));
mpFtComputeUnits->SetText(OUString::number(pInfo->mnComputeUnits));
mpFtMemory->SetText(OUString::number(pInfo->mnMemory/1024/1024));
}
else
{
mpFtFrequency->SetText(OUString());
mpFtComputeUnits->SetText(OUString());
mpFtMemory->SetText(OUString());
}
SvLBoxString& rBoxEntry = dynamic_cast<SvLBoxString&>(pEntry->GetItem(1));
OUString aDevice = rBoxEntry.GetText();
// use english string for configuration
if(aDevice == maSoftware)
aDevice = OPENCL_SOFTWARE_DEVICE_CONFIG_NAME;
maConfig.maOpenCLDevice = aDevice;
#endif
}
void ScCalcOptionsDialog::CoupleEmptyAsZeroToStringConversion()
{
switch (maConfig.meStringConversion)
@@ -257,16 +192,6 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, SpinOpenCLMinSizeHdl, Edit&, rEdit, void)
maConfig.mnOpenCLMinimumFormulaGroupSize = static_cast<NumericField&>(rEdit).GetValue();
}
IMPL_LINK_NOARG_TYPED(ScCalcOptionsDialog, BtnAutomaticSelectHdl, RadioButton&, void)
{
OpenCLAutomaticSelectionChanged();
}
IMPL_LINK_NOARG_TYPED(ScCalcOptionsDialog, DeviceSelHdl, SvTreeListBox*, void)
{
SelectedDeviceChanged();
}
IMPL_LINK_TYPED(ScCalcOptionsDialog, EditModifiedHdl, Edit&, rCtrl, void)
{
maConfig.mpOpenCLSubsetOpCodes = ScStringToOpCodeSet(rCtrl.GetText());

View File

@@ -39,7 +39,6 @@ public:
virtual void dispose() override;
DECL_LINK_TYPED( BtnAutomaticSelectHdl, RadioButton&, void );
DECL_LINK_TYPED( DeviceSelHdl, SvTreeListBox*, void );
DECL_LINK_TYPED( EditModifiedHdl, Edit&, void );
DECL_STATIC_LINK_TYPED( ScCalcOptionsDialog, TestClickHdl, Button*, void );
DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void);
@@ -68,16 +67,6 @@ private:
VclPtr<VclMultiLineEdit> mpEditField;
VclPtr<PushButton> mpTestButton;
VclPtr<FixedText> mpFtFrequency;
VclPtr<FixedText> mpFtComputeUnits;
VclPtr<FixedText> mpFtMemory;
VclPtr<SvTreeListBox> mpOpenclInfoList;
VclPtr<RadioButton> mpBtnAutomaticSelectionTrue;
VclPtr<RadioButton> mpBtnAutomaticSelectionFalse;
OUString maSoftware;
ScCalcConfig maConfig;
bool mbSelectedEmptyStringAsZero;

View File

@@ -223,174 +223,6 @@
<property name="vexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid6">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="row_spacing">6</property>
<child>
<object class="svtlo-SvTreeListBox" id="opencl_list:border">
<property name="visible">True</property>
<property name="app_paintable">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Tree List-selection"/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Automatic selection of platform/device:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="automatic_select_true">
<property name="label" translatable="yes">True</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">automatic_select_false</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="automatic_select_false">
<property name="label" translatable="yes">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">automatic_select_true</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="frequency_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Frequency:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="compute_units_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Compute units:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="memory_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Memory (in MB):</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="frequency">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="compute_units">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="memory">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="software">
<property name="can_focus">False</property>
<property name="label" translatable="yes">Internal, software interpreter</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkButton" id="test">
<property name="label" translatable="yes">_Test OpenCL</property>