[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl sc/source vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 16 08:31:33 UTC 2020


 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 01ebd67c8c3ec0c718b900b282da91c25f4399af
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 15 15:59:36 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Dec 16 09:31:00 2020 +0100

    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>

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 20f219154ee1..496f1e718f7c 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1108,6 +1108,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 19fd26559da2..6da55820aaab 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 14bce8af57ab..f6e8cc0c5ed6 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 2edbbcdd176f..62e6c2b660fd 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -105,6 +105,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