+ isp.kind = InsetSpaceParams::NEGTHIN;
+ else if (isp.math && name == "negmedspace")
+ isp.kind = InsetSpaceParams::NEGMEDIUM;
+ else if (isp.math && name == "negthickspace")
+ isp.kind = InsetSpaceParams::NEGTHICK;
+ else if (name == "hfill")
+ isp.kind = InsetSpaceParams::HFILL;
+ else if (name == "hfill*")
+ isp.kind = InsetSpaceParams::HFILL_PROTECTED;
+ else if (name == "dotfill")
+ isp.kind = InsetSpaceParams::DOTFILL;
+ else if (name == "hrulefill")
+ isp.kind = InsetSpaceParams::HRULEFILL;
+ else if (name == "hspace") {
+ if (len.empty() || !isValidGlueLength(len)) {
+ lyxerr << "LyX function 'space-insert hspace' "
+ << "needs a valid length argument." << endl;
+ break;
+ }
+ isp.kind = InsetSpaceParams::CUSTOM;
+ isp.length = GlueLength(len);
+ }
+ else if (name == "hspace*") {
+ 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 = GlueLength(len);
+ }
+ else {
+ lyxerr << "Wrong argument for LyX function 'space-insert'." << endl;
+ break;
+ }
+ return new InsetSpace(isp);