sfx2/inc/autoredactdialog.hxx        |    7 ++++++-
 sfx2/source/doc/autoredactdialog.cxx |    8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 687cfd51ac785c2ab2cb8e49dea28aa7f53cbdfb
Author:     Verne-Lai <ve...@ossii.com.tw>
AuthorDate: Thu Oct 14 09:01:58 2021 +0800
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Mon Jan 24 23:03:05 2022 +0100

    tdf#131327 Add double clicked event on auto-redact table
    
    Change-Id: Id927244fcd7e985edadb2b9f9cfdd61ba93066e4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123570
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index fe43eef840f0..28c2c561f60d 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -76,6 +76,11 @@ public:
 
     // Sync data on the targets box with the data on the target
     void setRowData(int nRowIndex, const RedactionTarget* pTarget);
+
+    void connect_row_activated(const Link<weld::TreeView&, bool>& rLink)
+    {
+        m_xControl->connect_row_activated(rLink);
+    };
 };
 
 namespace sfx2
@@ -110,7 +115,7 @@ class SfxAutoRedactDialog final : public SfxDialogController
     DECL_LINK(AddHdl, weld::Button&, void);
     DECL_LINK(EditHdl, weld::Button&, void);
     DECL_LINK(DeleteHdl, weld::Button&, void);
-
+    DECL_LINK(DoubleClickEditHdl, weld::TreeView&, bool);
     DECL_LINK(LoadHdl, sfx2::FileDialogHelper*, void);
     DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void);
 
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index a951217fe665..4acbb8ea7816 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -317,7 +317,12 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, EditHdl, 
weld::Button&, void)
     // And sync the targets box row with the actual target data
     m_xTargetsBox->setRowData(nSelectedRow, pTarget);
 }
-
+IMPL_LINK_NOARG(SfxAutoRedactDialog, DoubleClickEditHdl, weld::TreeView&, bool)
+{
+    if (m_xEditBtn->get_sensitive())
+        m_xEditBtn->clicked();
+    return true;
+}
 IMPL_LINK_NOARG(SfxAutoRedactDialog, DeleteHdl, weld::Button&, void)
 {
     std::vector<int> aSelectedRows = m_xTargetsBox->get_selected_rows();
@@ -576,6 +581,7 @@ SfxAutoRedactDialog::SfxAutoRedactDialog(weld::Window* 
pParent)
     m_xAddBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, AddHdl));
     m_xEditBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, EditHdl));
     m_xDeleteBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, DeleteHdl));
+    m_xTargetsBox->connect_row_activated(LINK(this, SfxAutoRedactDialog, 
DoubleClickEditHdl));
 }
 
 SfxAutoRedactDialog::~SfxAutoRedactDialog()

Reply via email to