[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - include/vcl sc/source vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 7 19:15:23 UTC 2021


 include/vcl/jsdialog/executor.hxx |    2 ++
 include/vcl/weld.hxx              |    2 ++
 sc/source/ui/dbgui/pvfundlg.cxx   |   38 ++++++++++++++++++++++++++++++++++++++
 sc/source/ui/inc/pvfundlg.hxx     |    8 ++++++++
 vcl/jsdialog/executor.cxx         |    1 +
 5 files changed, 51 insertions(+)

New commits:
commit 54c2cf28ee421d132cd67bc86b27f479b33af883
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 16 09:43:11 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 21:11:57 2021 +0200

    pivot table: make options cancel button working
    
    Change-Id: Ife5b5b09d7fb0879f5c29a5aefeec4746bc0ae56
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107816
    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/+/109099
    Tested-by: Jenkins

diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 45c831e998cd..2d165c04ee68 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -654,7 +654,7 @@ ScDPSubtotalOptDlg::ScDPSubtotalOptDlg(weld::Window* pParent, ScDPObject& rDPObj
     , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft"))
     , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy"))
     , m_xBtnOk(m_xBuilder->weld_button("ok"))
-    , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
+    , m_xBtnCancel(m_xBuilder->weld_button("close"))
     , mrDPObj(rDPObj)
     , maLabelData(rLabelData)
 {
commit 4d5296cb3445a3030d906a7036e1d4d7f3f0bb7a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 15:59:36 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Apr 7 21:11:41 2021 +0200

    jsdialog: make Data field dialog working
    
    Change-Id: Iae4ec2b585272fb09253b6e05ac2a59da2219fd7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107777
    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/+/109098
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index 1e2a0806e3e9..0c7abbf693ca 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -36,6 +36,8 @@ public:
         rToolbar.signal_clicked(rIdent);
     }
 
+    static void trigger_clicked(weld::Button& rButton) { rButton.signal_clicked(); }
+
     static void trigger_click(weld::DrawingArea& rDrawingArea, const Point& rPos)
     {
         rDrawingArea.click(rPos);
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 59f404dab8d2..496b6d489e9d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1299,6 +1299,8 @@ public:
 
 class VCL_DLLPUBLIC Button : virtual public Container
 {
+    friend class ::LOKTrigger;
+
 protected:
     Link<Button&, void> m_aClickHdl;
 
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 1b780164241c..45c831e998cd 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -245,6 +245,8 @@ ScDPFunctionDlg::ScDPFunctionDlg(
     , mxFtBaseItem(m_xBuilder->weld_label("baseitemft"))
     , mxLbBaseItem(m_xBuilder->weld_combo_box("baseitem"))
     , mxBtnOk(m_xBuilder->weld_button("ok"))
+    , mxBtnCancel(m_xBuilder->weld_button("cancel"))
+    , mxExpander(m_xBuilder->weld_expander("expander"))
     , mrLabelVec(rLabelVec)
     , mbEmptyItem(false)
 {
@@ -291,6 +293,9 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
 
 void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
 {
+    mxBtnOk->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) );
+    mxBtnCancel->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) );
+
     // list box
     PivotFunc nFuncMask = (rFuncData.mnFuncMask == PivotFunc::NONE) ? PivotFunc::Sum : rFuncData.mnFuncMask;
     mxLbFunc->SetSelection( nFuncMask );
@@ -438,6 +443,14 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, weld::ComboBox&, rLBox, void )
     }
 }
 
+IMPL_LINK(ScDPFunctionDlg, ButtonClicked, weld::Button&, rButton, void)
+{
+    if (&rButton == mxBtnOk.get())
+        response(RET_OK);
+    else
+        response(RET_CANCEL);
+}
+
 IMPL_LINK_NOARG(ScDPFunctionDlg, DblClickHdl, weld::TreeView&, bool)
 {
     m_xDialog->response(RET_OK);
@@ -459,6 +472,7 @@ ScDPSubtotalDlg::ScDPSubtotalDlg(weld::Widget* pParent, ScDPObject& rDPObj,
     , mxFtName(m_xBuilder->weld_label("name"))
     , mxCbShowAll(m_xBuilder->weld_check_button("showall"))
     , mxBtnOk(m_xBuilder->weld_button("ok"))
+    , mxBtnCancel(m_xBuilder->weld_button("cancel"))
     , mxBtnOptions(m_xBuilder->weld_button("options"))
 {
     mxLbFunc->set_selection_mode(SelectionMode::Multiple);
@@ -496,6 +510,9 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const
 
 void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
 {
+    mxBtnOk->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
+    mxBtnCancel->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
+
     // field name
     mxFtName->set_label(rLabelData.getDisplayName());
 
@@ -525,6 +542,14 @@ void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
     mxBtnOptions->connect_clicked( LINK( this, ScDPSubtotalDlg, ClickHdl ) );
 }
 
+IMPL_LINK(ScDPSubtotalDlg, ButtonClicked, weld::Button&, rButton, void)
+{
+    if (&rButton == mxBtnOk.get())
+        response(RET_OK);
+    else
+        response(RET_CANCEL);
+}
+
 IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::Button&, rBtn, void)
 {
     mxLbFunc->set_sensitive(&rBtn == mxRbUser.get());
@@ -628,6 +653,8 @@ ScDPSubtotalOptDlg::ScDPSubtotalOptDlg(weld::Window* pParent, ScDPObject& rDPObj
     , m_xLbHide(m_xBuilder->weld_tree_view("hideitems"))
     , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft"))
     , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy"))
+    , m_xBtnOk(m_xBuilder->weld_button("ok"))
+    , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
     , mrDPObj(rDPObj)
     , maLabelData(rLabelData)
 {
@@ -693,6 +720,9 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const
 
 void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayout )
 {
+    m_xBtnOk->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
+    m_xBtnCancel->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
+
     // *** SORTING ***
 
     sal_Int32 nSortMode = maLabelData.maSortInfo.Mode;
@@ -823,6 +853,14 @@ sal_Int32 ScDPSubtotalOptDlg::FindListBoxEntry(
     return bFound ? nPos : -1;
 }
 
+IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void)
+{
+    if (&rButton == m_xBtnOk.get())
+        response(RET_OK);
+    else
+        response(RET_CANCEL);
+}
+
 IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Button&, rBtn, void)
 {
     m_xLbSortBy->set_sensitive(&rBtn != m_xRbSortMan.get());
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index 237b6c3f3cf9..6f562f39efa2 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -71,6 +71,7 @@ private:
 
     DECL_LINK(SelectHdl, weld::ComboBox&, void);
     DECL_LINK(DblClickHdl, weld::TreeView&, bool);
+    DECL_LINK(ButtonClicked, weld::Button&, void);
 
 private:
     std::unique_ptr<ScDPFunctionListBox> mxLbFunc;
@@ -81,6 +82,8 @@ private:
     std::unique_ptr<weld::Label>         mxFtBaseItem;
     std::unique_ptr<weld::ComboBox>      mxLbBaseItem;
     std::unique_ptr<weld::Button>        mxBtnOk;
+    std::unique_ptr<weld::Button>        mxBtnCancel;
+    std::unique_ptr<weld::Expander>      mxExpander;
 
     NameMapType          maBaseFieldNameMap; // cache for base field display -> original name.
     NameMapType          maBaseItemNameMap;  // cache for base item display -> original name.
@@ -108,6 +111,7 @@ private:
     DECL_LINK( DblClickHdl, weld::TreeView&, bool );
     DECL_LINK( RadioClickHdl, weld::Button&, void );
     DECL_LINK( ClickHdl, weld::Button&, void );
+    DECL_LINK( ButtonClicked, weld::Button&, void );
 
 private:
     ScDPObject&          mrDPObj;            /// The DataPilot object (for member names).
@@ -123,6 +127,7 @@ private:
     std::unique_ptr<weld::Label>         mxFtName;
     std::unique_ptr<weld::CheckButton>   mxCbShowAll;
     std::unique_ptr<weld::Button>        mxBtnOk;
+    std::unique_ptr<weld::Button>        mxBtnCancel;
     std::unique_ptr<weld::Button>        mxBtnOptions;
 
     std::shared_ptr<ScDPSubtotalOptDlg> mxOptionsDlg;
@@ -149,6 +154,7 @@ private:
     DECL_LINK( RadioClickHdl, weld::Button&, void );
     DECL_LINK( CheckHdl, weld::Button&, void );
     DECL_LINK( SelectHdl, weld::ComboBox&, void );
+    DECL_LINK( ButtonClicked, weld::Button&, void );
 
 private:
     std::unique_ptr<weld::ComboBox>     m_xLbSortBy;
@@ -170,6 +176,8 @@ private:
     std::unique_ptr<weld::TreeView>     m_xLbHide;
     std::unique_ptr<weld::Label>        m_xFtHierarchy;
     std::unique_ptr<weld::ComboBox>     m_xLbHierarchy;
+    std::unique_ptr<weld::Button>       m_xBtnOk;
+    std::unique_ptr<weld::Button>       m_xBtnCancel;
 
     ScDPObject&         mrDPObj;            /// The DataPilot object (for member names).
     ScDPLabelData       maLabelData;        /// Cache for members data.
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 6cd65feb1d6a..c538371a4f2b 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -106,6 +106,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
                 {
                     bool bChecked = rData["data"] == "true";
                     pCheckButton->set_state(bChecked ? TRISTATE_TRUE : TRISTATE_FALSE);
+                    LOKTrigger::trigger_clicked(*static_cast<weld::Button*>(pCheckButton));
                     LOKTrigger::trigger_toggled(*static_cast<weld::ToggleButton*>(pCheckButton));
                     return true;
                 }


More information about the Libreoffice-commits mailing list