#include "support/lstrings.h"
#include "support/ExceptionMessage.h"
-#include <boost/assert.hpp>
+#include "support/lassert.h"
#include <sstream>
case LFUN_FLEX_INSERT: {
string s = cmd.getArg(0);
- return new InsetFlex(buf, buf.params().documentClassPtr(), s);
+ return new InsetFlex(buf, s);
}
case LFUN_NOTE_INSERT: {
return new InsetOptArg(buf);
case LFUN_BIBITEM_INSERT:
- return new InsetBibitem(InsetCommandParams(BIBITEM_CODE));
+ return new InsetBibitem(buf, InsetCommandParams(BIBITEM_CODE));
case LFUN_FLOAT_INSERT: {
// check if the float type exists
case LFUN_ENVIRONMENT_INSERT:
return new InsetEnvironment(buf, cmd.argument());
- case LFUN_INFO_INSERT:
- return new InsetInfo(buf, to_utf8(cmd.argument()));
+ case LFUN_INFO_INSERT: {
+ InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument()));
+ inset->updateInfo();
+ return inset;
+ }
case LFUN_INSET_INSERT: {
string const name = cmd.getArg(0);
case BIBITEM_CODE: {
InsetCommandParams icp(code);
InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetBibitem(icp);
+ return new InsetBibitem(buf, icp);
}
case BIBTEX_CODE: {
InsetCommandParams icp(code);
InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
- return new InsetBibtex(icp);
+ return new InsetBibtex(buf, icp);
}
case CITE_CODE: {
}
case ERT_CODE: {
- InsetCollapsable::CollapseStatus st;
- InsetERT::string2params(to_utf8(cmd.argument()), st);
- return new InsetERT(buf, st);
+ return new InsetERT(buf,
+ InsetERT::string2params(to_utf8(cmd.argument())));
}
case LISTINGS_CODE: {
auto_ptr<Inset> inset;
- lex.next();
- string tmptok = lex.getString();
+ string tmptok;
+ lex >> tmptok;
// test the different insets
switch (code) {
case BIBITEM_CODE:
- inset.reset(new InsetBibitem(inscmd));
+ inset.reset(new InsetBibitem(buf, inscmd));
break;
case BIBTEX_CODE:
- inset.reset(new InsetBibtex(inscmd));
+ inset.reset(new InsetBibtex(buf, inscmd));
break;
case CITE_CODE:
inset.reset(new InsetCitation(inscmd));
inset.reset(new InsetPrintNomencl(inscmd));
break;
case REF_CODE:
- if (!inscmd["name"].empty() || !inscmd["reference"].empty())
- inset.reset(new InsetRef(buf, inscmd));
+ if (inscmd["name"].empty() && inscmd["reference"].empty())
+ return 0;
+ inset.reset(new InsetRef(buf, inscmd));
break;
case TOC_CODE:
inset.reset(new InsetTOC(inscmd));
} else if (tmptok == "Flex") {
lex.next();
string s = lex.getString();
- inset.reset(new InsetFlex(buf,
- buf.params().documentClassPtr(), s));
+ inset.reset(new InsetFlex(buf, s));
} else if (tmptok == "Branch") {
- inset.reset(new InsetBranch(buf,
- InsetBranchParams()));
+ inset.reset(new InsetBranch(buf, InsetBranchParams()));
} else if (tmptok == "Environment") {
lex.next();
inset.reset(new InsetEnvironment(buf, lex.getDocString()));
inset.reset(new InsetERT(buf));
} else if (tmptok == "listings") {
inset.reset(new InsetListings(buf));
- } else if (tmptok == "Space") {
+ } else if (tmptok == "space") {
inset.reset(new InsetSpace);
} else if (tmptok == "Tabular") {
inset.reset(new InsetTabular(buf));