[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - include/vcl vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Jun 2 15:33:12 UTC 2019


 include/vcl/fixedhyper.hxx    |    1 +
 vcl/source/app/salvtables.cxx |    7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit c5e383ea5bbbaecd3d745470edbe73bba48de9d3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jun 2 15:18:14 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jun 2 17:32:24 2019 +0200

    Resolves: tdf#125270 clicking LinkButton should launch link
    
    The gtk one does, but the gen one overwrite the default
    handler instead of adding to it
    
    Change-Id: I40c760821cb46283c00624797e97d601babd6200
    Reviewed-on: https://gerrit.libreoffice.org/73340
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/fixedhyper.hxx b/include/vcl/fixedhyper.hxx
index da1e8ea84fbb..b46a37a2688d 100644
--- a/include/vcl/fixedhyper.hxx
+++ b/include/vcl/fixedhyper.hxx
@@ -94,6 +94,7 @@ class VCL_DLLPUBLIC FixedHyperlink : public FixedText
             m_aClickHdl is called if the text is clicked.
         */
         void         SetClickHdl( const Link<FixedHyperlink&,void>& rLink ) { m_aClickHdl = rLink; }
+        const Link<FixedHyperlink&,void>& GetClickHdl() const { return m_aClickHdl; }
 
         // ::FixedHyperbaseLink
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 82ca26bea13d..afca107ef91c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1932,6 +1932,7 @@ class SalInstanceLinkButton : public SalInstanceContainer, public virtual weld::
 {
 private:
     VclPtr<FixedHyperlink> m_xButton;
+    Link<FixedHyperlink&,void> m_aOrigClickHdl;
 
     DECL_LINK(ClickHdl, FixedHyperlink&, void);
 public:
@@ -1939,6 +1940,7 @@ public:
         : SalInstanceContainer(pButton, pBuilder, bTakeOwnership)
         , m_xButton(pButton)
     {
+        m_aOrigClickHdl = m_xButton->GetClickHdl();
         m_xButton->SetClickHdl(LINK(this, SalInstanceLinkButton, ClickHdl));
     }
 
@@ -1964,15 +1966,16 @@ public:
 
     virtual ~SalInstanceLinkButton() override
     {
-        m_xButton->SetClickHdl(Link<FixedHyperlink&,void>());
+        m_xButton->SetClickHdl(m_aOrigClickHdl);
     }
 };
 
 #include <vcl/pngwrite.hxx>
 #include <tools/stream.hxx>
 
-IMPL_LINK_NOARG(SalInstanceLinkButton, ClickHdl, FixedHyperlink&, void)
+IMPL_LINK(SalInstanceLinkButton, ClickHdl, FixedHyperlink&, rButton, void)
 {
+    m_aOrigClickHdl.Call(rButton);
     signal_clicked();
 }
 


More information about the Libreoffice-commits mailing list