[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/unx
Samuel Mehrbrodt
s.mehrbrodt at gmail.com
Fri Mar 28 09:20:35 PDT 2014
vcl/unx/gtk/window/gtksalmenu.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit d6bc8ed3356d88231cca0306790f300517b7fae2
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date: Thu Mar 27 22:49:23 2014 +0100
fdo#50672 Escape underscores in menus for unity
Change-Id: Ibb4647c1ff6c2858fea888efae975e8e5c5011e2
Reviewed-on: https://gerrit.libreoffice.org/8773
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/8783
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index d224704..14ee000 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -552,8 +552,10 @@ void GtkSalMenu::NativeSetEnableItem( gchar* aCommand, gboolean bEnable )
void GtkSalMenu::NativeSetItemText( unsigned nSection, unsigned nItemPos, const OUString& rText )
{
SolarMutexGuard aGuard;
- // Replace the '~' character with '_'.
- OUString aText = rText.replace( '~', '_' );
+ // Escape all underscores so that they don't get interpreted as hotkeys
+ OUString aText = rText.replaceAll( "_", "__" );
+ // Replace the LibreOffice hotkey identifier with an underscore
+ aText = aText.replace( '~', '_' );
OString aConvertedText = OUStringToOString( aText, RTL_TEXTENCODING_UTF8 );
// Update item text only when necessary.
More information about the Libreoffice-commits
mailing list