]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_binominset.C
use stream-like syntax for LaTeX output
[lyx.git] / src / mathed / math_binominset.C
index c9d0edd7355525526c3ddd640ed46364d3c3c387..1f04084c26370cd542054441b3d4cfca5458f229 100644 (file)
@@ -3,7 +3,6 @@
 #endif
 
 #include "math_binominset.h"
-#include "math_parser.h"
 #include "support.h"
 #include "support/LOstream.h"
 
@@ -29,11 +28,12 @@ int MathBinomInset::dw() const
 }
 
 
-void MathBinomInset::metrics(MathStyles st) const
+void MathBinomInset::metrics(MathMetricsInfo const & st) const
 {
-       size_    = smallerStyleFrac(st);
-       xcell(0).metrics(size_);
-       xcell(1).metrics(size_);
+       MathMetricsInfo m = st;
+       m.size   = smallerStyleFrac(m.size);
+       xcell(0).metrics(m);
+       xcell(1).metrics(m);
        ascent_  = xcell(0).height() + 4 + 5;
        descent_ = xcell(1).height() + 4 - 5; 
        width_   = std::max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4; 
@@ -47,20 +47,14 @@ void MathBinomInset::draw(Painter & pain, int x, int y) const
        int m = x + width() / 2;
        xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 3 - 5);
        xcell(1).draw(pain, m - xcell(1).width() / 2, y + xcell(1).ascent()  + 3 - 5);
-       mathed_draw_deco(pain, x, y - ascent_,
-               dw(), height(), in_word_set("("));
-       mathed_draw_deco(pain, x + width() - dw(), y - ascent_, 
-               dw(), height(), in_word_set(")"));
+       mathed_draw_deco(pain, x, y - ascent_, dw(), height(), "(");
+       mathed_draw_deco(pain, x + width() - dw(), y - ascent_, dw(), height(), ")");
 }
 
 
-void MathBinomInset::write(std::ostream & os, bool fragile) const
+void MathBinomInset::write(MathWriteInfo & os) const
 {
-       os << '{';
-       cell(0).write(os, fragile);
-       os << " \\choose ";
-       cell(1).write(os, fragile);
-       os << '}';
+       os << '{' << cell(0) << " \\choose " << cell(1) << '}';
 }