- case BIBITEM_CODE: {
- InsetCommandParams icp(name);
- InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetBibitem(icp);
- }
-
- case BIBTEX_CODE: {
- InsetCommandParams icp(name);
- InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetBibtex(icp);
- }
-
- case CITE_CODE: {
- InsetCommandParams icp("citation");
- InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetCitation(icp);
- }
-
- case ERT_CODE: {
- InsetCollapsable::CollapseStatus st;
- InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
- return new InsetERT(params, st);
- }
-
- case LISTINGS_CODE: {
- InsetListingsParams par;
- InsetListingsMailer::string2params(to_utf8(cmd.argument()), par);
- return new InsetListings(params, par);
- }
-
- case EXTERNAL_CODE: {
- Buffer const & buffer = bv->buffer();
- InsetExternalParams iep;
- InsetExternalMailer::string2params(to_utf8(cmd.argument()), buffer, iep);
- auto_ptr<InsetExternal> inset(new InsetExternal);
- inset->setParams(iep, buffer);
- return inset.release();
- }
-
- case GRAPHICS_CODE: {
- Buffer const & buffer = bv->buffer();
- InsetGraphicsParams igp;
- InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer, igp);
- auto_ptr<InsetGraphics> inset(new InsetGraphics);
- inset->setParams(igp);
- return inset.release();
- }
-
- case HYPERLINK_CODE: {
- InsetCommandParams icp(name);
- InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetHyperlink(icp);
- }
-
- case INCLUDE_CODE: {
- InsetCommandParams iip(name);
- InsetIncludeMailer::string2params(to_utf8(cmd.argument()), iip);
- return new InsetInclude(iip);
- }
-
+ case BIBITEM_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetBibitem(buf, icp);
+ }
+
+ case BIBTEX_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetBibtex(buf, icp);
+ }
+
+ case CITE_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetCitation(icp);
+ }
+
+ case ERT_CODE: {
+ return new InsetERT(buf,
+ InsetERT::string2params(to_utf8(cmd.argument())));
+ }
+
+ case LISTINGS_CODE: {
+ InsetListingsParams par;
+ InsetListings::string2params(to_utf8(cmd.argument()), par);
+ return new InsetListings(buf, par);
+ }
+
+ case EXTERNAL_CODE: {
+ InsetExternalParams iep;
+ InsetExternal::string2params(to_utf8(cmd.argument()), buf, iep);
+ auto_ptr<InsetExternal> inset(new InsetExternal(buf));
+ inset->setBuffer(buf);
+ inset->setParams(iep);
+ return inset.release();
+ }
+
+ case GRAPHICS_CODE: {
+ InsetGraphicsParams igp;
+ InsetGraphics::string2params(to_utf8(cmd.argument()), buf, igp);
+ auto_ptr<InsetGraphics> inset(new InsetGraphics(buf));
+ inset->setParams(igp);
+ return inset.release();
+ }
+
+ case HYPERLINK_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetHyperlink(icp);
+ }
+
+ case INCLUDE_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetInclude(icp);
+ }
+