diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-06-23 16:09:24 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2019-06-25 09:23:22 +0200 |
commit | 1c6bac6e003e9f280a29cc83974bdfb3d06b24a9 (patch) | |
tree | f7e8adb50dccff2d4e7dc880528ebd4be8170d88 | |
parent | 1914932e2fd0598508823464765f3b1ac31236a1 (diff) |
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@ubuntu.com>
-rw-r--r-- | dbaccess/source/ui/control/curledit.cxx | 2 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 5 |
4 files changed, 13 insertions, 1 deletions
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 |