mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 05:01:49 +00:00
* src/MenuBackend.cpp (expandFormats): do not add shortcut for
plaintext if it is not correct. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22415 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9e5eebc14c
commit
585ba16d62
@ -549,6 +549,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf)
|
|||||||
if ((*fit)->dummy())
|
if ((*fit)->dummy())
|
||||||
continue;
|
continue;
|
||||||
docstring label = from_utf8((*fit)->prettyname());
|
docstring label = from_utf8((*fit)->prettyname());
|
||||||
|
docstring const shortcut = from_utf8((*fit)->shortcut());
|
||||||
|
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case MenuItem::ImportFormats:
|
case MenuItem::ImportFormats:
|
||||||
@ -570,8 +571,13 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf)
|
|||||||
BOOST_ASSERT(false);
|
BOOST_ASSERT(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(*fit)->shortcut().empty())
|
// FIXME: if we had proper support for translating the
|
||||||
label += char_type('|') + from_utf8((*fit)->shortcut());
|
// format names defined in configure.py, there would
|
||||||
|
// not be a need to check whether the shortcut is
|
||||||
|
// correct. If we add it uncondiitonally, it would
|
||||||
|
// create useless warnings on bad shortcuts
|
||||||
|
if (!shortcut.empty() && contains(label, shortcut))
|
||||||
|
label += char_type('|') + shortcut;
|
||||||
|
|
||||||
if (buf)
|
if (buf)
|
||||||
tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
|
tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
|
||||||
|
Loading…
Reference in New Issue
Block a user