#include "insets/InsetBibitem.h"
#include "insets/InsetBibtex.h"
+#include "insets/InsetBox.h"
+#include "insets/InsetBranch.h"
#include "insets/InsetCaption.h"
#include "insets/InsetCitation.h"
#include "insets/InsetFlex.h"
#include "insets/InsetFloatList.h"
#include "insets/InsetFoot.h"
#include "insets/InsetGraphics.h"
+#include "insets/InsetHyperlink.h"
#include "insets/InsetInclude.h"
#include "insets/InsetIndex.h"
#include "insets/InsetInfo.h"
-#include "insets/InsetNomencl.h"
#include "insets/InsetLabel.h"
#include "insets/InsetLine.h"
#include "insets/InsetMarginal.h"
#include "insets/InsetNewline.h"
#include "insets/InsetNewpage.h"
+#include "insets/InsetNomencl.h"
#include "insets/InsetNote.h"
-#include "insets/InsetBox.h"
-#include "insets/InsetBranch.h"
-#include "insets/InsetPhantom.h"
#include "insets/InsetOptArg.h"
-#include "insets/InsetNewpage.h"
+#include "insets/InsetPhantom.h"
#include "insets/InsetRef.h"
#include "insets/InsetSpace.h"
#include "insets/InsetTabular.h"
#include "insets/InsetTOC.h"
-#include "insets/InsetHyperlink.h"
#include "insets/InsetVSpace.h"
#include "insets/InsetWrap.h"
string const argument = to_utf8(cmd.argument());
if (params.documentClass().floats().typeExist(argument)) {
auto_ptr<InsetFloat> p(new InsetFloat(buf, argument));
- p->setWide(true, params);
+ p->setWide(true);
return p.release();
}
lyxerr << "Non-existent float type: " << argument << endl;
return 0;
}
- case LFUN_INDEX_INSERT:
- return new InsetIndex(buf);
+ case LFUN_INDEX_INSERT: {
+ docstring arg = cmd.argument();
+ return new InsetIndex(buf, InsetIndexParams(arg));
+ }
case LFUN_NOMENCL_INSERT: {
InsetCommandParams icp(NOMENCL_CODE);
case LFUN_CAPTION_INSERT:
return new InsetCaption(buf);
- case LFUN_INDEX_PRINT:
- return new InsetPrintIndex(InsetCommandParams(INDEX_PRINT_CODE));
+ case LFUN_INDEX_PRINT: {
+ InsetCommandParams icp(INDEX_PRINT_CODE);
+ icp["type"] = cmd.argument();
+ return new InsetPrintIndex(icp);
+ }
- case LFUN_NOMENCL_PRINT:
- return new InsetPrintNomencl(InsetCommandParams(NOMENCL_PRINT_CODE));
+ case LFUN_NOMENCL_PRINT: {
+ InsetCommandParams icp(NOMENCL_PRINT_CODE);
+ icp["set_width"] = from_ascii("auto");
+ return new InsetPrintNomencl(icp);
+ }
case LFUN_TOC_INSERT:
return new InsetTOC(InsetCommandParams(TOC_CODE));
return new InsetInclude(icp);
}
- case INDEX_CODE:
- return new InsetIndex(buf);
+ case INDEX_CODE: {
+ docstring arg = cmd.argument();
+ return new InsetIndex(buf, InsetIndexParams(arg));
+ }
+
+ case INDEX_PRINT_CODE: {
+ InsetCommandParams icp(code);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
+ return new InsetPrintIndex(icp);
+ }
case NOMENCL_CODE: {
InsetCommandParams icp(code);
- InsetCommand::string2params(name, lyx::to_utf8(cmd.argument()), icp);
+ InsetCommand::string2params(name, to_utf8(cmd.argument()), icp);
return new InsetNomencl(icp);
}
else if (name == "hrulefill")
isp.kind = InsetSpaceParams::HRULEFILL;
else if (name == "hspace") {
- if (len.empty() || !isValidLength(len)) {
+ if (len.empty() || !isValidGlueLength(len)) {
lyxerr << "LyX function 'space-insert hspace' "
<< "needs a valid length argument." << endl;
break;
}
isp.kind = InsetSpaceParams::CUSTOM;
- isp.length = Length(len);
+ isp.length = GlueLength(len);
}
else if (name == "hspace*") {
- if (len.empty() || !isValidLength(len)) {
+ if (len.empty() || !isValidGlueLength(len)) {
lyxerr << "LyX function 'space-insert hspace*' "
<< "needs a valid length argument." << endl;
break;
}
isp.kind = InsetSpaceParams::CUSTOM_PROTECTED;
- isp.length = Length(len);
+ isp.length = GlueLength(len);
}
else {
lyxerr << "Wrong argument for LyX function 'space-insert'." << endl;
} else if (tmptok == "Box") {
inset.reset(new InsetBox(buf, tmptok));
} else if (tmptok == "Flex") {
- lex.next();
+ lex.eatLine();
string s = lex.getString();
inset.reset(new InsetFlex(buf, s));
} else if (tmptok == "Branch") {
} else if (tmptok == "Caption") {
inset.reset(new InsetCaption(buf));
} else if (tmptok == "Index") {
- inset.reset(new InsetIndex(buf));
+ inset.reset(new InsetIndex(buf, InsetIndexParams()));
} else if (tmptok == "FloatList") {
inset.reset(new InsetFloatList);
} else if (tmptok == "Info") {