Wrap flex-insert's argument in quotes, as it could contain spaces. (Do we need to go further, in case it contains quotes? Or do you get what you deserve if you try that?)

Jurgen, OK for branch?


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27698 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-11-24 22:10:38 +00:00
parent 20f3fbd521
commit bf8c0ff40d

View File

@ -847,11 +847,12 @@ void MenuDefinition::expandFlexInsert(
TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin(); TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin();
TextClass::InsetLayouts::const_iterator end = insetLayouts.end(); TextClass::InsetLayouts::const_iterator end = insetLayouts.end();
for (; cit != end; ++cit) { for (; cit != end; ++cit) {
docstring const label = cit->first; if (cit->second.lyxtype() == type) {
if (cit->second.lyxtype() == type) docstring const label = cit->first;
addWithStatusCheck(MenuItem(MenuItem::Command, addWithStatusCheck(MenuItem(MenuItem::Command,
toqstr(translateIfPossible(label)), toqstr(translateIfPossible(label)),
FuncRequest(LFUN_FLEX_INSERT, label))); FuncRequest(LFUN_FLEX_INSERT, '"' + label + '"')));
}
} }
// FIXME This is a little clunky. // FIXME This is a little clunky.
if (items_.empty() && type == InsetLayout::CUSTOM) if (items_.empty() && type == InsetLayout::CUSTOM)