]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommand.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insetcommand.C
index e7ad117674fbdb1ed5bc8554467e9815f917e547..a1533070a59425dd0d069438a63f6525dcd5c3f6 100644 (file)
@@ -35,19 +35,17 @@ InsetCommandParams::InsetCommandParams( string const & n,
 
 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;
        }
 
@@ -55,11 +53,12 @@ void InsetCommandParams::setFromString( string const & b )
        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);
        }
 }