summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-14 18:23:25 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-14 18:27:39 +0200
commit5c4a9b1e2adf62a5805c02b20bfbcd62b3533e6d (patch)
tree84c6b869104cb1cde0545b048a24012d692138a7 /sc
parentf9da47eb6a9affb7bb42eafe6637b8059a3b0015 (diff)
Handle the 'New' and 'Delete' buttons
Change-Id: I1d5d6d70e9ac8d95b1189346fdab29ded39745bf
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx38
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.hxx2
2 files changed, 40 insertions, 0 deletions
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 6492b1a53597..4aafd8c95095 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -225,6 +225,9 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
aLink = LINK(this, ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl);
mpOpenCLWhiteAndBlackListBox->SetSelectHdl(aLink);
+ mpListNewButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, ListNewClickHdl));
+ mpListDeleteButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, ListDeleteClickHdl));
+
aLink = LINK(this, ScCalcOptionsDialog, BtnToggleHdl);
mpBtnTrue->SetToggleHdl(aLink); // Set handler only to the 'True' button.
@@ -913,4 +916,39 @@ IMPL_LINK(ScCalcOptionsDialog, OpenCLWhiteAndBlackListSelHdl, Control*, )
return 0;
}
+IMPL_LINK( ScCalcOptionsDialog, ListNewClickHdl, PushButton*, )
+{
+ ScCalcConfig::OpenCLImplMatcher aEmpty;
+ ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList());
+
+ mpOS->SetText("");
+ mpOSVersion->SetText("");
+ mpPlatformVendor->SetText("");
+ mpDevice->SetText("");
+ mpDriverVersionMin->SetText("");
+ mpDriverVersionMax->SetText("");
+
+ rSet.insert(aEmpty);
+#if HAVE_FEATURE_OPENCL
+ fillListBox(mpOpenCLWhiteAndBlackListBox, rSet);
+ mpOpenCLWhiteAndBlackListBox->SelectEntry(format(aEmpty));
+#endif
+ return 0;
+}
+
+IMPL_LINK( ScCalcOptionsDialog, ListDeleteClickHdl, PushButton*, )
+{
+ if (mpOpenCLWhiteAndBlackListBox->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ return 0;
+
+ ScCalcConfig::OpenCLImplMatcherSet& rSet(CurrentWhiteOrBlackList());
+ const ScCalcConfig::OpenCLImplMatcher& rImpl(CurrentWhiteOrBlackListEntry());
+
+#if HAVE_FEATURE_OPENCL
+ rSet.erase(rImpl);
+ fillListBox(mpOpenCLWhiteAndBlackListBox, rSet);
+#endif
+ return 0;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 25d397d4f495..32e7f42cfd9f 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -41,6 +41,8 @@ public:
DECL_LINK( NumModifiedHdl, void * );
DECL_LINK( EditModifiedHdl, Control * );
DECL_LINK( OpenCLWhiteAndBlackListSelHdl, Control* );
+ DECL_LINK( ListNewClickHdl, PushButton* );
+ DECL_LINK( ListDeleteClickHdl, PushButton* );
const ScCalcConfig& GetConfig() const { return maConfig;}