From 1a696271da9e41ef9f3de8543914b24400735541 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 17 Jul 2002 15:57:03 +0000 Subject: [PATCH] honor \displaystyle etc on screen git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4684 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_hullinset.C | 22 ++++++---------------- src/mathed/math_hullinset.h | 2 -- src/mathed/math_sizeinset.C | 7 ++++--- src/mathed/math_sizeinset.h | 2 ++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 9dc0bdbb8b..cf02d2e5f2 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -94,19 +94,13 @@ MathHullInset::MathHullInset(string const & type) setDefaults(); } - +/* MathHullInset::MathHullInset(string const & type, MathGridInset const & grid) : MathGridInset(grid), type_(type), nonum_(1), label_(1) { setDefaults(); } - - -MathHullInset::MathHullInset(string const & type, col_type cols) - : MathGridInset(cols, 1), type_(type), nonum_(1), label_(1) -{ - setDefaults(); -} +*/ MathInset * MathHullInset::clone() const @@ -354,11 +348,11 @@ void MathHullInset::header_write(WriteStream & os) const else if (type_ == "alignat" || type_ == "xalignat") os << "\\begin{" << type_ << star(n) << "}" - << "{" << static_cast(ncols()/2) << "}\n"; + << "{" << static_cast((ncols() + 1)/2) << "}\n"; else if (type_ == "xxalignat") os << "\\begin{" << type_ << "}" - << "{" << static_cast(ncols()/2) << "}\n"; + << "{" << static_cast((ncols() + 1)/2) << "}\n"; else if (type_ == "multline" || type_ == "gather") os << "\\begin{" << type_ << "}\n"; @@ -427,19 +421,15 @@ void MathHullInset::addFancyCol(col_type col) addFancyCol(col); } - else if (type_ == "alignat" || type_ == "xalignat" || type_ == "xxalignat") { + else if (type_ == "alignat" || type_ == "xalignat" || type_ == "xxalignat") MathGridInset::addCol(col); - MathGridInset::addCol(col + 1); - } } void MathHullInset::delFancyCol(col_type col) { - if (type_ == "alignat" || type_ == "xalignat" || type_ == "xxalignat") { - MathGridInset::delCol(col + 1); + if (type_ == "alignat" || type_ == "xalignat" || type_ == "xxalignat") MathGridInset::delCol(col); - } } diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index 63b38f91e0..33f5fccdec 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -23,8 +23,6 @@ public: /// MathHullInset(string const & type, MathGridInset const & grid); /// - MathHullInset(string const & type, col_type cols); - /// MathInset * clone() const; /// void metrics(MathMetricsInfo & mi) const; diff --git a/src/mathed/math_sizeinset.C b/src/mathed/math_sizeinset.C index 05589b1558..f649a88cc9 100644 --- a/src/mathed/math_sizeinset.C +++ b/src/mathed/math_sizeinset.C @@ -11,9 +11,10 @@ #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,7 +26,7 @@ MathInset * MathSizeInset::clone() const void MathSizeInset::metrics(MathMetricsInfo & mi) const { - //MathStyleChanger dummy(mi.base, MathStyles(key_->id)); + MathStyleChanger dummy(mi.base, style_); dim_ = xcell(0).metrics(mi); metricsMarkers2(); } @@ -33,7 +34,7 @@ void MathSizeInset::metrics(MathMetricsInfo & mi) const void MathSizeInset::draw(MathPainterInfo & pi, int x, int y) const { - //MathStyleChanger dummy(pi.base, MathStyles(key_->id)); + MathStyleChanger dummy(pi.base, style_); xcell(0).draw(pi, x + 1, y); drawMarkers2(pi, x, y); } diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index c2b1c22350..7d52d63170 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -37,6 +37,8 @@ public: private: /// latexkeys const * key_; + /// + MathStyles const style_; }; #endif -- 2.39.2