From 585ba16d62e84bbc306d7270b16a651dd2a67e63 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 7 Jan 2008 17:13:38 +0000 Subject: [PATCH] * 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 --- src/MenuBackend.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/MenuBackend.cpp b/src/MenuBackend.cpp index 5426b218b4..8d269f3e02 100644 --- a/src/MenuBackend.cpp +++ b/src/MenuBackend.cpp @@ -549,6 +549,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf) if ((*fit)->dummy()) continue; docstring label = from_utf8((*fit)->prettyname()); + docstring const shortcut = from_utf8((*fit)->shortcut()); switch (kind) { case MenuItem::ImportFormats: @@ -570,8 +571,13 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf) BOOST_ASSERT(false); break; } - if (!(*fit)->shortcut().empty()) - label += char_type('|') + from_utf8((*fit)->shortcut()); + // FIXME: if we had proper support for translating the + // 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) tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,