+#include <config.h>
#include "math_macrotemplate.h"
#include "math_mathmlstream.h"
#include "frontends/Painter.h"
#include "debug.h"
+using std::auto_ptr;
+using std::endl;
+
MathMacroTemplate::MathMacroTemplate()
: MathNestInset(2), numargs_(0), name_(), type_("newcommand")
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));
}
{
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