[Libreoffice-commits] core.git: sc/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 7 17:59:11 UTC 2021


 sc/source/ui/dbgui/dapitype.cxx |   13 +++++++++++++
 sc/source/ui/inc/dapitype.hxx   |    3 +++
 2 files changed, 16 insertions(+)

New commits:
commit 1d9128b6d712669185f402314e5fb57130d4ba5a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 3 14:07:59 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Jan 7 18:58:27 2021 +0100

    jsdialog: make source selector dialog buttons work
    
    Make sure buttons are welded so we will be able to
    execute actions.
    
    Change-Id: I1cb7bdcd80d1cd4d60751940e4d24ecf8e7be1ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107164
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108881
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index 9ce2626bb8c4..15acb8c65553 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -31,12 +31,17 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
     , m_xBtnDatabase(m_xBuilder->weld_radio_button("database"))
     , m_xBtnExternal(m_xBuilder->weld_radio_button("external"))
     , m_xLbNamedRange(m_xBuilder->weld_combo_box("rangelb"))
+    , m_xBtnOk(m_xBuilder->weld_button("ok")) // for LOK jsdialog
+    , m_xBtnCancel(m_xBuilder->weld_button("cancel")) // for LOK jsdialog
 {
     m_xBtnSelection->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnNamedRange->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnDatabase->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
     m_xBtnExternal->connect_toggled( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) );
 
+    m_xBtnOk->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) );
+    m_xBtnCancel->connect_clicked( LINK(this, ScDataPilotSourceTypeDlg, ResponseHdl ) );
+
     if (!bEnableExternal)
         m_xBtnExternal->set_sensitive(false);
 
@@ -53,6 +58,14 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(weld::Window* pParent, bool b
         m_xBtnDatabase->hide();
 }
 
+IMPL_LINK(ScDataPilotSourceTypeDlg, ResponseHdl, weld::Button&, rButton, void)
+{
+    if (&rButton == m_xBtnOk.get())
+        m_xDialog->response(RET_OK);
+    else
+        m_xDialog->response(RET_CANCEL);
+}
+
 ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
 {
 }
diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx
index 436d71c9d7f5..8e65db5bae60 100644
--- a/sc/source/ui/inc/dapitype.hxx
+++ b/sc/source/ui/inc/dapitype.hxx
@@ -30,6 +30,8 @@ private:
     std::unique_ptr<weld::RadioButton> m_xBtnDatabase;
     std::unique_ptr<weld::RadioButton> m_xBtnExternal;
     std::unique_ptr<weld::ComboBox> m_xLbNamedRange;
+    std::unique_ptr<weld::Button> m_xBtnOk;
+    std::unique_ptr<weld::Button> m_xBtnCancel;
 
 public:
     ScDataPilotSourceTypeDlg(weld::Window* pParent, bool bEnableExternal);
@@ -42,6 +44,7 @@ public:
 
 private:
     DECL_LINK(RadioClickHdl, weld::ToggleButton&, void);
+    DECL_LINK(ResponseHdl, weld::Button&, void);
 };
 
 class ScDataPilotServiceDlg : public weld::GenericDialogController


More information about the Libreoffice-commits mailing list