]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_binominset.C
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_binominset.C
index a9f419a4922945bdedcfa3c984a0217f0c682ba6..35d1e7dbc9569e5ab52da2e26a3442534325c12b 100644 (file)
@@ -1,10 +1,13 @@
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
 #include "math_binominset.h"
-#include "support.h"
+#include "math_support.h"
 #include "support/LOstream.h"
+#include "math_mathmlstream.h"
 
 
 MathBinomInset::MathBinomInset()
@@ -30,10 +33,10 @@ int MathBinomInset::dw() const
 
 void MathBinomInset::metrics(MathMetricsInfo const & st) const
 {
-       size_ = st;
-       smallerStyleFrac(size_);
-       xcell(0).metrics(size_);
-       xcell(1).metrics(size_);
+       MathMetricsInfo mi = st;
+       smallerStyleFrac(mi);
+       xcell(0).metrics(mi);
+       xcell(1).metrics(mi);
        ascent_  = xcell(0).height() + 4 + 5;
        descent_ = xcell(1).height() + 4 - 5; 
        width_   = std::max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4; 
@@ -42,8 +45,6 @@ void MathBinomInset::metrics(MathMetricsInfo const & st) const
 
 void MathBinomInset::draw(Painter & pain, int x, int y) const
 {
-       xo(x);
-       yo(y);
        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);
@@ -52,17 +53,13 @@ void MathBinomInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathBinomInset::write(MathWriteInfo & os) const
+void MathBinomInset::write(WriteStream & os) const
 {
        os << '{' << cell(0) << " \\choose " << cell(1) << '}';
 }
 
 
-void MathBinomInset::writeNormal(std::ostream & os) const
+void MathBinomInset::normalize(NormalStream & os) const
 {
-       os << "[binom ";
-       cell(0).writeNormal(os);
-       os << " ";
-       cell(1).writeNormal(os);
-       os << "] ";
+       os << "[binom " << cell(0) << ' ' << cell(1) << ']';
 }