#include "insets/InsetBranch.h"
#include "insets/InsetCaption.h"
#include "insets/InsetCitation.h"
+#include "insets/InsetCounter.h"
#include "insets/InsetFlex.h"
#include "insets/InsetERT.h"
#include "insets/InsetListings.h"
#include "insets/InsetVSpace.h"
#include "insets/InsetWrap.h"
-#include "mathed/MathMacroTemplate.h"
+#include "mathed/InsetMathMacroTemplate.h"
#include "mathed/InsetMathHull.h"
#include "frontends/alert.h"
string const arg2 = cmd.getArg(1);
if (arg1 != "deco") {
LYXERR0("LFUN_IPAMACRO_INSERT: wrong argument");
- return 0;
+ return nullptr;
}
return new InsetIPADeco(buf, arg2);
}
string arg = cmd.getArg(0);
if (arg.empty()) {
LYXERR0("argument-insert needs an argument!");
- return 0;
+ return nullptr;
}
return new InsetArgument(buf, arg);
}
if (argument == "figure" || argument == "table")
return new InsetWrap(buf, argument);
lyxerr << "Non-existent wrapfig type: " << argument << endl;
- return 0;
+ return nullptr;
}
case LFUN_INDEX_INSERT: {
case LFUN_TABULAR_INSERT: {
if (cmd.argument().empty())
- return 0;
+ return nullptr;
istringstream ss(to_utf8(cmd.argument()));
int r = 0, c = 0;
ss >> r >> c;
case LFUN_INFO_INSERT: {
InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument()));
- inset->updateInfo();
return inset;
}
switch (code) {
case NO_CODE:
lyxerr << "No such inset '" << name << "'.";
- return 0;
+ return nullptr;
case BIBITEM_CODE: {
InsetCommandParams icp(code);
return new InsetCitation(buf, icp);
}
+ case COUNTER_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(to_utf8(cmd.argument()), icp);
+ return new InsetCounter(buf, icp);
+ }
+
case ERT_CODE: {
return new InsetERT(buf,
InsetERT::string2params(to_utf8(cmd.argument())));
default:
lyxerr << "Inset '" << name << "' not permitted with LFUN_INSET_INSERT."
<< endl;
- return 0;
+ return nullptr;
}
} //end LFUN_INSET_INSERT
}
return new InsetSpace(isp);
}
- break;
default:
break;
lyx_exit(1);
} else if (message.type_ == WarningException) {
Alert::warning(message.title_, message.details_);
- return 0;
+ return nullptr;
}
}
- return 0;
+ return nullptr;
}
case CITE_CODE:
inset.reset(new InsetCitation(buf, inscmd));
break;
+ case COUNTER_CODE:
+ inset.reset(new InsetCounter(buf, inscmd));
+ break;
case HYPERLINK_CODE:
inset.reset(new InsetHyperlink(buf, inscmd));
break;
break;
case REF_CODE:
if (inscmd["name"].empty() && inscmd["reference"].empty())
- return 0;
+ return nullptr;
inset.reset(new InsetRef(buf, inscmd));
break;
case TOC_CODE:
<< "'" << endl;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
- return 0;
+ return nullptr;
}
inset->setBuffer(*buf);
} else {
} else if (tmptok == "External") {
inset.reset(new InsetExternal(buf));
} else if (tmptok == "FormulaMacro") {
- inset.reset(new MathMacroTemplate(buf));
+ inset.reset(new InsetMathMacroTemplate(buf));
} else if (tmptok == "Formula") {
inset.reset(new InsetMathHull(buf));
} else if (tmptok == "Graphics") {
inset.reset(new InsetFloat(buf, string()));
} else if (tmptok == "Wrap") {
lex.next();
- string tmptok = lex.getString();
- inset.reset(new InsetWrap(buf, tmptok));
+ string tmptok2 = lex.getString();
+ inset.reset(new InsetWrap(buf, tmptok2));
} else if (tmptok == "Caption") {
lex.eatLine();
string s = lex.getString();
<< "'" << endl;
while (lex.isOK() && lex.getString() != "\\end_inset")
lex.next();
- return 0;
+ return nullptr;
}
// Set the buffer reference for proper parsing of some insets
- // (InsetCollapsable for example)
+ // (InsetCollapsible for example)
inset->setBuffer(*buf);
inset->read(lex);
// Set again the buffer for insets that are created inside this inset