remove unneeded member

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4600 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-11 10:20:31 +00:00
parent bd6885433a
commit d359dd8fca
5 changed files with 29 additions and 15 deletions

View File

@ -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);
}

View File

@ -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_;
};

View File

@ -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())

View File

@ -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

View File

@ -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);
}
}