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
This commit is contained in:
Richard Heck 2007-04-05 13:49:01 +00:00
parent 096b63170a
commit 6a383e5f9b

View File

@ -1376,13 +1376,14 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
string opt1; string opt1;
if (contains(argument, "|")) { if (contains(argument, "|")) {
arg = token(argument, '|', 0); arg = token(argument, '|', 0);
opt1 = '[' + token(argument, '|', 1) + ']'; opt1 = token(argument, '|', 1);
} }
std::ostringstream os; InsetCommandParams icp("cite");
os << "citation LatexCommand\n" icp["key"] = from_utf8(arg);
<< "\\cite" << opt1 << "{" << arg << "}\n" if (!opt1.empty())
<< "\\end_inset"; icp["before"] = from_utf8(opt1);
FuncRequest fr(LFUN_INSET_INSERT, os.str()); string icstr = InsetCommandMailer::params2string("citation", icp);
FuncRequest fr(LFUN_INSET_INSERT, icstr);
dispatch(fr); dispatch(fr);
} else } else
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "citation")); dispatch(FuncRequest(LFUN_DIALOG_SHOW, "citation"));