From f10579fc85f53ad0cb71e1949ab3ee3e311c7e7e Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Mon, 22 Jan 2001 20:47:08 +0000 Subject: [PATCH] Cleanup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1368 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/insetcommand.C | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 27ac9d34cd..023f59402a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2001-01-22 Dekel Tsur + + * insetcommand.C (getAsString, setFromString): Cleanup. + 2001-01-21 Dekel Tsur * insetref.C: Add the array InsetRef::types that contains diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index b3ff8cbba3..a1533070a5 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -35,9 +35,7 @@ InsetCommandParams::InsetCommandParams( string const & n, string const InsetCommandParams::getAsString() const { - string b(cmdname); - b += "|++|" + options + "|++|" + contents; - return b; + return cmdname + "|++|" + contents + "|++|" + options; } @@ -45,9 +43,9 @@ void InsetCommandParams::setFromString( string const & b ) { string::size_type idx = b.find("|++|"); if (idx == string::npos) { - cmdname = ""; - options = ""; + cmdname = b; contents = ""; + options = ""; return; } @@ -56,10 +54,11 @@ void InsetCommandParams::setFromString( string const & b ) 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); } } -- 2.39.2