From d359dd8fca52c4f0100f7cf4bf636113c5c4e49f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 11 Jul 2002 10:20:31 +0000 Subject: [PATCH] remove unneeded member git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4600 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_boxinset.C | 11 +++++++---- src/mathed/math_boxinset.h | 6 ++---- src/mathed/math_nestinset.C | 15 +++++++++++++++ src/mathed/math_nestinset.h | 4 ++++ src/mathed/math_parser.C | 8 +------- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/mathed/math_boxinset.C b/src/mathed/math_boxinset.C index 3c675a6028..817f2022f8 100644 --- a/src/mathed/math_boxinset.C +++ b/src/mathed/math_boxinset.C @@ -12,7 +12,7 @@ MathBoxInset::MathBoxInset(string const & name) - : MathGridInset(1, 1), name_(name) + : MathNestInset(1), name_(name) {} @@ -45,15 +45,18 @@ void MathBoxInset::rebreak() void MathBoxInset::metrics(MathMetricsInfo & mi) const { MathFontSetChanger dummy(mi.base, "textnormal"); - MathGridInset::metrics(mi); + xcell(0).metrics(mi); + ascent_ = xcell(0).ascent() + 1; + descent_ = xcell(0).descent() + 1; + width_ = xcell(0).width() + 2; } void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const { MathFontSetChanger dummy(pi.base, "textnormal"); - MathGridInset::draw(pi, x, y); - mathed_draw_framebox(pi, x, y, this); + xcell(0).draw(pi, x, y); + drawMarkers2(pi, x + 1, y); } diff --git a/src/mathed/math_boxinset.h b/src/mathed/math_boxinset.h index 07f3440d96..dca47ceb06 100644 --- a/src/mathed/math_boxinset.h +++ b/src/mathed/math_boxinset.h @@ -2,7 +2,7 @@ #ifndef MATH_BOXINSET_H #define MATH_BOXINSET_H -#include "math_gridinset.h" +#include "math_nestinset.h" #include "LString.h" #ifdef __GNUG__ @@ -13,7 +13,7 @@ class LyXFont; /// Support for \\mbox -class MathBoxInset : public MathGridInset { +class MathBoxInset : public MathNestInset { public: /// explicit MathBoxInset(string const & name); @@ -37,8 +37,6 @@ public: void infoize(std::ostream & os) const; private: - /// - mutable MathMetricsInfo mi_; /// string name_; }; diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 91f11b36c9..a4e822ab30 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -63,6 +63,21 @@ void MathNestInset::metrics(MathMetricsInfo const & mi) const } +void MathNestInset::metricsMarkers() const +{ + descent_ += 1; + width_ += 2; +} + + +void MathNestInset::metricsMarkers2() const +{ + ascent_ += 1; + descent_ += 1; + width_ += 2; +} + + bool MathNestInset::idxNext(idx_type & idx, pos_type & pos) const { if (idx + 1 >= nargs()) diff --git a/src/mathed/math_nestinset.h b/src/mathed/math_nestinset.h index e9b578f0b3..dfe7c3f0e3 100644 --- a/src/mathed/math_nestinset.h +++ b/src/mathed/math_nestinset.h @@ -22,6 +22,10 @@ public: /// the size is usuall some sort of convex hull of the cells void metrics(MathMetricsInfo const & mi) const; + /// add space for markers + void metricsMarkers() const; + /// add space for markers + void metricsMarkers2() const; /// draw background if locked void draw(MathPainterInfo & pi, int x, int y) const; /// draw two angular markers diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index e4cf20698e..538e5c0d81 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1062,12 +1062,6 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags, return; } - else if (l->inset == "mbox") { - // switch to text mode - cell->push_back(createMathInset(t.cs())); - parse_into(cell->back()->cell(0), FLAG_ITEM, mathmode); - } - else if (l->inset == "style") { cell->push_back(createMathInset(t.cs())); parse_into(cell->back()->cell(0), flags, mathmode); @@ -1088,7 +1082,7 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags, else { MathAtom p = createMathInset(t.cs()); for (MathInset::idx_type i = 0; i < p->nargs(); ++i) - parse_into(p->cell(i), FLAG_ITEM, l->extra == "mathmode"); + parse_into(p->cell(i), FLAG_ITEM, l->extra != "forcetext"); cell->push_back(p); } } -- 2.39.5