[Libreoffice-commits] core.git: include/vcl vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Wed Mar 21 15:08:55 UTC 2018


 include/vcl/weld.hxx          |    3 ++-
 vcl/source/app/salvtables.cxx |    3 ++-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |    6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 8d55371997dd1e98a602b397fa86f20481119047
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 21 11:01:31 2018 +0000

    add optional helpid to add_button
    
    Change-Id: I9606d0788c78397feb0840463991c5498e759b5a
    Reviewed-on: https://gerrit.libreoffice.org/51703
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1d0e3f390076..58b0ddd80284 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -135,7 +135,8 @@ private:
 public:
     virtual int run() = 0;
     virtual void response(int response) = 0;
-    virtual void add_button(const OUString& rText, int response) = 0;
+    virtual void add_button(const OUString& rText, int response, const OString& rHelpId = OString())
+        = 0;
     virtual void set_default_response(int response) = 0;
 };
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 63db48d4a1de..52ff2baf67a7 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -468,11 +468,12 @@ public:
         m_xDialog->EndDialog(nResponse);
     }
 
-    virtual void add_button(const OUString& rText, int nResponse) override
+    virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId) override
     {
         VclButtonBox* pBox = m_xDialog->get_action_area();
         VclPtr<PushButton> xButton(VclPtr<PushButton>::Create(pBox, WB_CLIPCHILDREN|WB_CENTER|WB_VCENTER));
         xButton->SetText(rText);
+        xButton->SetHelpId(rHelpId);
         xButton->Show();
         m_xDialog->add_button(xButton, nResponse, true);
     }
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 3c825d167061..49581bb180e8 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1635,9 +1635,11 @@ public:
         gtk_dialog_response(m_pDialog, VclToGtk(nResponse));
     }
 
-    virtual void add_button(const OUString& rText, int nResponse) override
+    virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId) override
     {
-        gtk_dialog_add_button(m_pDialog, MapToGtkAccelerator(rText).getStr(), VclToGtk(nResponse));
+        GtkWidget* pWidget = gtk_dialog_add_button(m_pDialog, MapToGtkAccelerator(rText).getStr(), VclToGtk(nResponse));
+        if (!rHelpId.isEmpty())
+            ::set_help_id(pWidget, rHelpId);
     }
 
     virtual void set_default_response(int nResponse) override


More information about the Libreoffice-commits mailing list