]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulamacro.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / formulamacro.C
index a04e1b09488243a430768fe4e483a6f221b1964e..c11bd1f8b61fd019ba1a5248bed29d35803757da 100644 (file)
 #include "lyxtext.h"
 #include "Lsstream.h"
 
+using namespace lyx::support;
+
 using std::ostream;
+using std::auto_ptr;
 
 extern MathCursor * mathcursor;
 
@@ -48,10 +51,11 @@ InsetFormulaMacro::InsetFormulaMacro()
 }
 
 
-InsetFormulaMacro::InsetFormulaMacro(string const & name, int nargs)
+InsetFormulaMacro::InsetFormulaMacro
+       (string const & name, int nargs, string const & type)
 {
        setInsetName(name);
-       MathMacroTable::create(MathAtom(new MathMacroTemplate(name, nargs)));
+       MathMacroTable::create(MathAtom(new MathMacroTemplate(name, nargs, type)));
 }
 
 
@@ -62,18 +66,12 @@ InsetFormulaMacro::InsetFormulaMacro(string const & s)
 }
 
 
-Inset * InsetFormulaMacro::clone(Buffer const &) const
+auto_ptr<InsetBase> InsetFormulaMacro::clone() const
 {
-       return new InsetFormulaMacro(*this);
+       return auto_ptr<InsetBase>(new InsetFormulaMacro(*this));
 }
 
 
-// Inset * InsetFormulaMacro::clone(Buffer const &, bool) const
-// {
-//     return new InsetFormulaMacro(*this);
-// }
-
-
 void InsetFormulaMacro::write(Buffer const *, ostream & os) const
 {
        os << "FormulaMacro ";
@@ -154,9 +152,9 @@ MathAtom & InsetFormulaMacro::par()
 }
 
 
-Inset::Code InsetFormulaMacro::lyxCode() const
+InsetOld::Code InsetFormulaMacro::lyxCode() const
 {
-       return Inset::MATHMACRO_CODE;
+       return InsetOld::MATHMACRO_CODE;
 }