From d5eb253d6a43695e3f0711296365f242b0b42ef7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 10 Aug 2001 13:50:42 +0000 Subject: [PATCH] fix for recent 'column shift' bug perhaps fix for g++3.0 compile problem git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2486 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_accentinset.C | 0 src/mathed/math_accentinset.h | 0 src/mathed/math_gridinset.C | 2 +- src/mathed/math_matrixinset.C | 2 +- src/mathed/math_sizeinset.C | 27 ++++++--------------------- src/mathed/math_sizeinset.h | 10 +++++----- 6 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 src/mathed/math_accentinset.C delete mode 100644 src/mathed/math_accentinset.h diff --git a/src/mathed/math_accentinset.C b/src/mathed/math_accentinset.C deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mathed/math_accentinset.h b/src/mathed/math_accentinset.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 1e2b6a158e..4f86b4be7a 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -251,7 +251,7 @@ string MathGridInset::eolString(int row) const if (row == nrows() - 1) return ""; - if (rowinfo_[row].skip_ != LyXLength()) + if (rowinfo_[row].skip_.value() != 0) return "\\\\[" + rowinfo_[row].skip_.asLatexString() + "]\n"; // make sure an upcoming '[' does not break anything diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index 30b38627c6..d0f082e8f3 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -142,8 +142,8 @@ void MathMatrixInset::write(std::ostream & os, bool fragile) const for (int row = 0; row < nrows(); ++row) { for (int col = 0; col < ncols(); ++col) { - os << eocString(col); cell(index(row, col)).write(os, fragile); + os << eocString(col); } if (n) { if (!label_[row].empty()) diff --git a/src/mathed/math_sizeinset.C b/src/mathed/math_sizeinset.C index 37a19b2aec..8587e57047 100644 --- a/src/mathed/math_sizeinset.C +++ b/src/mathed/math_sizeinset.C @@ -3,30 +3,15 @@ #endif #include "math_sizeinset.h" +#include "math_parser.h" #include "support/LOstream.h" -MathSizeInset::MathSizeInset(MathStyles st) - : MathNestInset(1), style_(st) +MathSizeInset::MathSizeInset(latexkeys const * l) + : MathNestInset(1), key_(l) {} -char const * MathSizeInset::name() const -{ - switch (style_) { - case LM_ST_DISPLAY: - return "displaystyle"; - case LM_ST_TEXT: - return "textstyle"; - case LM_ST_SCRIPT: - return "scriptstyle"; - case LM_ST_SCRIPTSCRIPT: - return "scriptscriptstyle"; - } - return "unknownstyle"; -} - - MathInset * MathSizeInset::clone() const { return new MathSizeInset(*this); @@ -43,7 +28,7 @@ void MathSizeInset::draw(Painter & pain, int x, int y) const void MathSizeInset::metrics(MathStyles /* st */) const { - xcell(0).metrics(style_); + xcell(0).metrics(MathStyles(key_->id)); ascent_ = xcell(0).ascent_; descent_ = xcell(0).descent_; width_ = xcell(0).width_; @@ -52,7 +37,7 @@ void MathSizeInset::metrics(MathStyles /* st */) const void MathSizeInset::write(std::ostream & os, bool fragile) const { - os << "{\\" << name() << " "; + os << "{\\" << key_->name << " "; cell(0).write(os, fragile); os << "}"; } @@ -60,7 +45,7 @@ void MathSizeInset::write(std::ostream & os, bool fragile) const void MathSizeInset::writeNormal(std::ostream & os) const { - os << "[" << name() << " "; + os << "[" << key_->name << " "; cell(0).writeNormal(os); os << "]"; } diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index 15f2b1d031..c72ce5e64e 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -10,13 +10,15 @@ #endif /** An inset for \scriptsize etc - \author André Poenitz + \author André Pönitz */ +class latexkeys; + class MathSizeInset : public MathNestInset { public: /// - explicit MathSizeInset(MathStyles st); + explicit MathSizeInset(latexkeys const * l); /// MathInset * clone() const; /// @@ -29,10 +31,8 @@ public: void writeNormal(std::ostream &) const; private: - /// - char const * name() const; /// - MathStyles style_; + latexkeys const * key_; }; #endif -- 2.39.2