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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 25 07:23:57 UTC 2019


 dbaccess/source/ui/control/curledit.cxx |    2 +-
 include/vcl/weld.hxx                    |    2 ++
 vcl/source/app/salvtables.cxx           |    5 +++++
 vcl/unx/gtk3/gtk3gtkinst.cxx            |    5 +++++
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 1c6bac6e003e9f280a29cc83974bdfb3d06b24a9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jun 23 16:09:24 2019 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Jun 25 09:23:22 2019 +0200

    Resolves: tdf#125168 label mnemonic appearing in database url
    
    Change-Id: I39531ae2a656c16c7355d73b76cb918d3535f7b0
    Reviewed-on: https://gerrit.libreoffice.org/74604
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx
index 7c8df5e88e21..bca982b7c64e 100644
--- a/dbaccess/source/ui/control/curledit.cxx
+++ b/dbaccess/source/ui/control/curledit.cxx
@@ -79,7 +79,7 @@ void OConnectionURLEdit::SetText(const OUString& _rStr, const Selection& /*_rNew
 
 OUString OConnectionURLEdit::GetText() const
 {
-    return m_xForcedPrefix->get_label() + m_xEntry->get_text();
+    return m_xForcedPrefix->strip_mnemonic(m_xForcedPrefix->get_label()) + m_xEntry->get_text();
 }
 
 void OConnectionURLEdit::ShowPrefix(bool _bShowPrefix)
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a124cd09786d..af862d4cb91e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -147,6 +147,8 @@ public:
     //parents
     virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) = 0;
 
+    virtual OUString strip_mnemonic(const OUString& rLabel) const = 0;
+
     virtual ~Widget() {}
 };
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index afb51ee80791..88e1b1da61e1 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -556,6 +556,11 @@ public:
 
     virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override;
 
+    virtual OUString strip_mnemonic(const OUString &rLabel) const override
+    {
+        return rLabel.replaceFirst("~", "");
+    }
+
     SystemWindow* getSystemWindow()
     {
         return m_xWidget->GetSystemWindow();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 5123db7c9f2e..9831762f4a43 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1668,6 +1668,11 @@ public:
     }
 
     virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override;
+
+    virtual OUString strip_mnemonic(const OUString &rLabel) const override
+    {
+        return rLabel.replaceFirst("_", "");
+    }
 };
 
 namespace


More information about the Libreoffice-commits mailing list