]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_sizeinset.C
small up/down tweaking
[lyx.git] / src / mathed / math_sizeinset.C
index 05589b15583d403449f6e009b7918a56a7a5481d..a4cba68316658184d46146929e31789cc302007d 100644 (file)
 #include "math_support.h"
 #include "support/LOstream.h"
 
+using std::atoi;
 
 MathSizeInset::MathSizeInset(latexkeys const * l)
-       : MathNestInset(1), key_(l)
+       : MathNestInset(1), key_(l), style_(MathStyles(atoi(l->extra.c_str())))
 {}
 
 
@@ -25,16 +26,16 @@ MathInset * MathSizeInset::clone() const
 
 void MathSizeInset::metrics(MathMetricsInfo & mi) const
 {
-       //MathStyleChanger dummy(mi.base, MathStyles(key_->id));
-       dim_ = xcell(0).metrics(mi);
+       MathStyleChanger dummy(mi.base, style_);
+       dim_ = cell(0).metrics(mi);
        metricsMarkers2();
 }
 
 
 void MathSizeInset::draw(MathPainterInfo & pi, int x, int y) const
 {
-       //MathStyleChanger dummy(pi.base, MathStyles(key_->id));
-       xcell(0).draw(pi, x + 1, y);
+       MathStyleChanger dummy(pi.base, style_);
+       cell(0).draw(pi, x + 1, y);
        drawMarkers2(pi, x, y);
 }
 
@@ -47,7 +48,7 @@ void MathSizeInset::write(WriteStream & os) const
 
 void MathSizeInset::normalize(NormalStream & os) const
 {
-       os << "[" << key_->name << ' ' << cell(0) << ']';
+       os << '[' << key_->name << ' ' << cell(0) << ']';
 }