]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_sizeinset.C
fix #1073
[lyx.git] / src / mathed / math_sizeinset.C
index 02f45c00afb7e25009b49ed99206325ec6d58904..849874214ace2da22f670894a7f74978e10280bf 100644 (file)
@@ -1,17 +1,17 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_sizeinset.h"
 #include "math_parser.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
+#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_(Styles(atoi(l->extra.c_str())))
 {}
 
 
@@ -21,20 +21,19 @@ MathInset * MathSizeInset::clone() const
 }
 
 
-void MathSizeInset::draw(Painter & pain, int x, int y) const
+void MathSizeInset::metrics(MetricsInfo & mi) const
 {
-       xcell(0).draw(pain, x, y);
+       StyleChanger dummy(mi.base, style_);
+       dim_ = cell(0).metrics(mi);
+       metricsMarkers2();
 }
 
 
-void MathSizeInset::metrics(MathMetricsInfo const & mi) const
+void MathSizeInset::draw(PainterInfo & pi, int x, int y) const
 {
-       MathMetricsInfo m = mi;
-       m.style = MathStyles(key_->id);
-       xcell(0).metrics(m);
-       ascent_   = xcell(0).ascent_;
-       descent_  = xcell(0).descent_;
-       width_    = xcell(0).width_;
+       StyleChanger dummy(pi.base, style_);
+       cell(0).draw(pi, x + 1, y);
+       drawMarkers2(pi, x, y);
 }
 
 
@@ -46,5 +45,11 @@ void MathSizeInset::write(WriteStream & os) const
 
 void MathSizeInset::normalize(NormalStream & os) const
 {
-       os << "[" << key_->name << ' ' << cell(0) << ']';
+       os << '[' << key_->name << ' ' << cell(0) << ']';
+}
+
+
+void MathSizeInset::infoize(std::ostream & os) const
+{
+       os << "Size: " << key_->name;
 }