From 6a383e5f9b9b818a20472bad51ccd9372d49f13d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 5 Apr 2007 13:49:01 +0000 Subject: [PATCH] Fix for bug 3401. Updated LFUN_CITATION_INSERT to new format. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17733 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyxfunc.C | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lyxfunc.C b/src/lyxfunc.C index ddbf6d5343..fe3af75a66 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1376,13 +1376,14 @@ void LyXFunc::dispatch(FuncRequest const & cmd) string opt1; if (contains(argument, "|")) { arg = token(argument, '|', 0); - opt1 = '[' + token(argument, '|', 1) + ']'; + opt1 = token(argument, '|', 1); } - std::ostringstream os; - os << "citation LatexCommand\n" - << "\\cite" << opt1 << "{" << arg << "}\n" - << "\\end_inset"; - FuncRequest fr(LFUN_INSET_INSERT, os.str()); + InsetCommandParams icp("cite"); + icp["key"] = from_utf8(arg); + if (!opt1.empty()) + icp["before"] = from_utf8(opt1); + string icstr = InsetCommandMailer::params2string("citation", icp); + FuncRequest fr(LFUN_INSET_INSERT, icstr); dispatch(fr); } else dispatch(FuncRequest(LFUN_DIALOG_SHOW, "citation")); -- 2.39.2