diff options
author | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-03-27 22:49:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 11:04:54 +0000 |
commit | f6bcdc5ae6da9cb9b13bdc3551bef917d8b0362d (patch) | |
tree | 8690afbb63d034fde5ffaf478cb2b68a48436192 | |
parent | 06a4698850a1d9d1d4db703dc42852b0d36f6acd (diff) |
fdo-50672 Escape underscores in menus for unity
Change-Id: Ibb4647c1ff6c2858fea888efae975e8e5c5011e2
Reviewed-on: https://gerrit.libreoffice.org/8773
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index 48dd2255f58a..d63fdd31c16a 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -548,8 +548,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. |