]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macrotemplate.C
bug + spped fixes + small stuff
[lyx.git] / src / mathed / math_macrotemplate.C
index f200c46cd5a6478b4850803a5d518743529790a0..7efaee6fb5267b7b914d6921c80a83a5037cb907 100644 (file)
@@ -1,9 +1,26 @@
+/**
+ * \file math_macrotemplate.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
 
 #include "math_macrotemplate.h"
 #include "math_mathmlstream.h"
 #include "math_parser.h"
 #include "frontends/Painter.h"
 #include "debug.h"
+#include "LColor.h"
+
+
+using std::string;
+using std::auto_ptr;
+using std::endl;
 
 
 MathMacroTemplate::MathMacroTemplate()
@@ -30,17 +47,17 @@ MathMacroTemplate::MathMacroTemplate(std::istream & is)
        MathArray ar;
        mathed_parse_cell(ar, is);
        if (ar.size() != 1 || !ar[0]->asMacroTemplate()) {
-               lyxerr << "cannot read macro from '" << ar << "'\n";
+               lyxerr << "cannot read macro from '" << ar << "'" << endl;
                return;
        }
        operator=( *(ar[0]->asMacroTemplate()) );
 }
 
 
-InsetBase * MathMacroTemplate::clone() const
+auto_ptr<InsetBase> MathMacroTemplate::clone() const
 {
-       //lyxerr << "cloning MacroTemplate!\n";
-       return new MathMacroTemplate(*this);
+       //lyxerr << "cloning MacroTemplate!" << endl;
+       return auto_ptr<InsetBase>(new MathMacroTemplate(*this));
 }
 
 
@@ -90,7 +107,7 @@ void MathMacroTemplate::write(WriteStream & os) const
 {
        if (type_ == "def") {
                os << "\n\\def\\" << name_.c_str();
-               for (int i = 1; i <= numargs_; ++i) 
+               for (int i = 1; i <= numargs_; ++i)
                        os << '#' << i;
        } else {
                // newcommand or renewcommand