string const InsetCommandParams::getAsString() const
{
- string b(cmdname);
- b += "|++|" + options + "|++|" + contents;
- return b;
+ return cmdname + "|++|" + contents + "|++|" + options;
}
void InsetCommandParams::setFromString( string const & b )
{
string::size_type idx = b.find("|++|");
- if( idx == string::npos ) {
- cmdname = "";
- options = "";
+ if (idx == string::npos) {
+ cmdname = b;
contents = "";
+ options = "";
return;
}
string tmp = b.substr(idx+4);
idx = tmp.find("|++|");
- if( idx == string::npos ) {
- options = tmp;
+ if (idx == string::npos) {
+ contents = tmp;
+ options = "";
} else {
- options = tmp.substr(0, idx);
- contents = tmp.substr(idx+4);
+ contents = tmp.substr(0, idx);
+ options = tmp.substr(idx+4);
}
}
}
-int InsetCommand::Ascii(Buffer const *, ostream &) const
+int InsetCommand::Ascii(Buffer const *, ostream &, int) const
{
return 0;
}