string const InsetCommandParams::getAsString() const
{
- string b(cmdname);
- b += "|++|" + options + "|++|" + contents;
- return b;
+ return cmdname + "|++|" + contents + "|++|" + options;
}
{
string::size_type idx = b.find("|++|");
if (idx == string::npos) {
- cmdname = "";
- options = "";
+ cmdname = b;
contents = "";
+ options = "";
return;
}
idx = tmp.find("|++|");
if (idx == string::npos) {
- options = tmp;
+ contents = tmp;
+ options = "";
} else {
- options = tmp.substr(0, idx);
- contents = tmp.substr(idx+4);
+ contents = tmp.substr(0, idx);
+ options = tmp.substr(idx+4);
}
}