]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommandparams.C
fix #832
[lyx.git] / src / insets / insetcommandparams.C
index 5da44d6bf9c5abc94ac597abdf678e89c8b4e444..82a4056cbee398a65c25c7ba5a328873b6429133 100644 (file)
@@ -1,16 +1,15 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file insetcommandparams.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Angus Leeming
  *
- *          Copyright 2002-2002 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
+#include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetcommandparams.h"
 #include "lyxlex.h"
@@ -33,36 +32,6 @@ InsetCommandParams::InsetCommandParams(string const & n,
 {}
 
 
-string const InsetCommandParams::getAsString() const
-{
-       return cmdname + "|++|" + contents + "|++|" + options;
-}
-
-
-void InsetCommandParams::setFromString(string const & b)
-{
-       string::size_type idx = b.find("|++|");
-       if (idx == string::npos) {
-               cmdname = b;
-               contents = "";
-               options = "";
-               return;
-       }
-
-       cmdname = b.substr(0, idx);
-       string tmp = b.substr(idx+4);
-
-       idx = tmp.find("|++|");
-       if (idx == string::npos) {
-               contents = tmp;
-               options = "";
-       } else {
-               contents  = tmp.substr(0, idx);
-               options = tmp.substr(idx+4);
-       }
-}
-
-
 void InsetCommandParams::scanCommand(string const & cmd)
 {
        string tcmdname, toptions, tcontents;
@@ -162,9 +131,9 @@ void InsetCommandParams::write(ostream & os) const
 string const InsetCommandParams::getCommand() const
 {
        string s;
-       if (!getCmdName().empty()) s += "\\"+getCmdName();
-       if (!getOptions().empty()) s += "["+getOptions()+']';
-       s += "{"+getContents()+'}';
+       if (!getCmdName().empty()) s += '\\' + getCmdName();
+       if (!getOptions().empty()) s += '[' + getOptions() + ']';
+       s += '{' + getContents() + '}';
        return s;
 }