]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macrotemplate.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / mathed / math_macrotemplate.C
index f200c46cd5a6478b4850803a5d518743529790a0..da2d4ff52f750797612392bbe76bf18e891c4e07 100644 (file)
@@ -1,3 +1,4 @@
+#include <config.h>
 
 #include "math_macrotemplate.h"
 #include "math_mathmlstream.h"
@@ -5,6 +6,9 @@
 #include "frontends/Painter.h"
 #include "debug.h"
 
+using std::auto_ptr;
+using std::endl;
+
 
 MathMacroTemplate::MathMacroTemplate()
        : MathNestInset(2), numargs_(0), name_(), type_("newcommand")
@@ -30,17 +34,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 +94,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