summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-06-23 16:09:24 +0100
committerAndras Timar <andras.timar@collabora.com>2019-07-06 08:06:46 +0200
commit5989b84c8c8039a86c92f2d4c9260752170e0127 (patch)
tree0e20e844972589a3af727cb7e5638e7ca925ca59
parent538e55f794003f629ae2c6b38d17bbd2f76f3cd6 (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> (cherry picked from commit 1c6bac6e003e9f280a29cc83974bdfb3d06b24a9)
-rw-r--r--dbaccess/source/ui/control/curledit.cxx2
-rw-r--r--include/vcl/weld.hxx2
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx5
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