Kaydet (Commit) 5690acdb authored tarafından Michael Weghorn's avatar Michael Weghorn

tdf#120453 Preserve literal '&' in Qt menu texts

As described in the QMenuBar documentation,
a single ampersand in a menu item text is used to
set the shortcut for the menu, while "&&" is used to
get a real ampersand character.

Change-Id: Idf510641c8919ff8223114413851cb3ee7d7b4a2
Reviewed-on: https://gerrit.libreoffice.org/62405
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Weghorn <m.weghorn@posteo.de>
üst 5d2ab49c
......@@ -250,7 +250,13 @@ void Qt5Menu::slotMenuTriggered(Qt5MenuItem* pQItem)
}
}
void Qt5Menu::NativeItemText(OUString& rItemText) { rItemText = rItemText.replace('~', '&'); }
void Qt5Menu::NativeItemText(OUString& rItemText)
{
// preserve literal '&'s in menu texts
rItemText = rItemText.replaceAll("&", "&&");
rItemText = rItemText.replace('~', '&');
}
Qt5MenuItem::Qt5MenuItem(const SalItemParams* pItemData)
: mpParentMenu(nullptr)
......
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