]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathEnv.cpp
listerrors.lyx : Update a link.
[lyx.git] / src / mathed / InsetMathEnv.cpp
index 110d09b2597bda01cbd4fdabc8bc0961efbd28d0..a7fb33c69d408ac0e7aa704b879dd3d19698f5dd 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include <config.h>
 
 #include "InsetMathEnv.h"
+
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathStream.h"
-#include "support/std_ostream.h"
-
 
-namespace lyx {
+#include <ostream>
 
 
-using std::string;
-using std::auto_ptr;
-
+namespace lyx {
 
-InsetMathEnv::InsetMathEnv(docstring const & name)
-       : InsetMathNest(1), name_(name)
+InsetMathEnv::InsetMathEnv(Buffer * buf, docstring const & name)
+       : InsetMathNest(buf, 1), name_(name)
 {}
 
 
-auto_ptr<InsetBase> InsetMathEnv::doClone() const
+Inset * InsetMathEnv::clone() const
 {
-       return auto_ptr<InsetBase>(new InsetMathEnv(*this));
+       return new InsetMathEnv(*this);
 }
 
 
-bool InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        cell(0).metrics(mi, dim);
        metricsMarkers(dim);
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
 }
 
 
@@ -55,6 +48,7 @@ void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathEnv::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}';
 }