]> git.lyx.org Git - features.git/commitdiff
Fix for bug 3401. Updated LFUN_CITATION_INSERT to new format.
authorRichard Heck <rgheck@comcast.net>
Thu, 5 Apr 2007 13:49:01 +0000 (13:49 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 5 Apr 2007 13:49:01 +0000 (13:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17733 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxfunc.C

index ddbf6d53430d2479587f6d85485b8f8f4e7644b0..fe3af75a6625a0212b7e597e98a640ab7e1e0549 100644 (file)
@@ -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"));