From bf8c0ff40d9804377791a98415cd2ba1f4e86646 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 24 Nov 2008 22:10:38 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/Menus.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 592678cf6a..934f6dd11e 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -847,11 +847,12 @@ void MenuDefinition::expandFlexInsert( TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin(); TextClass::InsetLayouts::const_iterator end = insetLayouts.end(); 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, toqstr(translateIfPossible(label)), - FuncRequest(LFUN_FLEX_INSERT, label))); + FuncRequest(LFUN_FLEX_INSERT, '"' + label + '"'))); + } } // FIXME This is a little clunky. if (items_.empty() && type == InsetLayout::CUSTOM) -- 2.39.2