Kaydet (Commit) f6bcdc5a authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Caolán McNamara

fdo-50672 Escape underscores in menus for unity

Change-Id: Ibb4647c1ff6c2858fea888efae975e8e5c5011e2
Reviewed-on: https://gerrit.libreoffice.org/8773Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 06a46988
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment