]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_envinset.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_envinset.C
index 47936fb277b5f716104c79a701f1475fafc5db27..a7e2737be4390db56d926075f1fa079c6da710a0 100644 (file)
@@ -1,12 +1,11 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "math_envinset.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
+#include "support/LOstream.h"
+
+using std::auto_ptr;
 
 
 MathEnvInset::MathEnvInset(string const & name)
@@ -14,25 +13,24 @@ MathEnvInset::MathEnvInset(string const & name)
 {}
 
 
-MathInset * MathEnvInset::clone() const
+auto_ptr<InsetBase> MathEnvInset::clone() const
 {
-       return new MathEnvInset(*this);
+       return auto_ptr<InsetBase>(new MathEnvInset(*this));
 }
 
 
-void MathEnvInset::metrics(MathMetricsInfo & mi) const
+void MathEnvInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       xcell(0).metrics(mi);
-       ascent_  = xcell(0).ascent() + 1;
-       descent_ = xcell(0).descent() + 1;
-       width_   = xcell(0).width() + 2;
+       cell(0).metrics(mi, dim_);
+       metricsMarkers();
+       dim = dim_;
 }
 
 
-void MathEnvInset::draw(MathPainterInfo & pi, int x, int y) const
+void MathEnvInset::draw(PainterInfo & pi, int x, int y) const
 {
-       xcell(0).draw(pi, x + 1, y);
-       drawMarkers2(pi, x, y);
+       cell(0).draw(pi, x + 1, y);
+       drawMarkers(pi, x, y);
 }
 
 
@@ -44,7 +42,7 @@ void MathEnvInset::write(WriteStream & os) const
 
 void MathEnvInset::normalize(NormalStream & os) const
 {
-       os << "[env " << name_ << " " << cell(0) << ']';
+       os << "[env " << name_ << ' ' << cell(0) << ']';
 }