more cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4578 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-10 07:15:36 +00:00
parent fa77b206ab
commit 251a7ae90a
10 changed files with 25 additions and 13 deletions

View File

@ -54,3 +54,9 @@ void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
MathGridInset::draw(pi, x, y);
mathed_draw_framebox(pi, x, y, this);
}
void MathBoxInset::infoize(std::ostream & os) const
{
os << "Box: " << name_;
}

View File

@ -33,6 +33,8 @@ public:
void write(WriteStream & os) const;
///
void normalize(NormalStream & ns) const;
///
void infoize(std::ostream & os) const;
private:
///

View File

@ -18,8 +18,8 @@ public:
MathBraceInset();
///
MathInset * clone() const;
///
MathBraceInset * asBraceInset() { return this; }
/// we write extra braces in any case...
bool extraBraces() const { return true; }
///
void draw(MathPainterInfo &, int x, int y) const;
///

View File

@ -727,7 +727,7 @@ void MathCursor::getPos(int & x, int & y)
if (array().empty())
x += 2;
y = xarray().yo();
lyxerr << "getPos: " << x << " " << y << "\n";
//lyxerr << "getPos: " << x << " " << y << "\n";
}

View File

@ -49,7 +49,6 @@ inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset.
class MathArrayInset;
class MathAMSArrayInset;
class MathBraceInset;
class MathBoxInset;
class MathCharInset;
class MathDelimInset;
@ -195,7 +194,6 @@ public:
/// identifies certain types of insets
virtual MathAMSArrayInset * asAMSArrayInset() { return 0; }
virtual MathArrayInset * asArrayInset() { return 0; }
virtual MathBraceInset * asBraceInset() { return 0; }
virtual MathBoxInset * asBoxInset() { return 0; }
virtual MathBoxInset const * asBoxInset() const { return 0; }
virtual MathCharInset const * asCharInset() const { return 0; }
@ -228,6 +226,8 @@ public:
virtual bool isActive() const { return nargs() > 0; }
/// is the a relational operator (used for splitting equations)
virtual bool isRelOp() const { return false; }
/// will this get written as a single block in {..}
virtual bool extraBraces() const { return false; }
/// return the content as char if the inset is able to do so
virtual char getChar() const { return 0; }

View File

@ -136,6 +136,6 @@ void MathParboxInset::write(WriteStream & os) const
void MathParboxInset::infoize(std::ostream & os) const
{
os << "Box: Parbox " << tex_width_ << ' ';
os << "Box: Parbox " << tex_width_;
}

View File

@ -711,12 +711,14 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags,
else if (t.cat() == catBegin) {
MathArray ar;
parse_into(ar, FLAG_BRACE_LAST, mathmode);
// reduce multiple nesting levels to a single one
// do not create a BraceInset if they were written by LyX
// this helps to keep the annoyance of "a choose b" to a minimum
if (ar.size() && ar.front()->asBraceInset())
ar = ar.front()->asBraceInset()->cell(0);
cell->push_back(MathAtom(new MathBraceInset));
cell->back()->cell(0).swap(ar);
if (ar.size() == 1 && ar[0]->extraBraces()) {
cell->push_back(ar);
} else {
cell->push_back(MathAtom(new MathBraceInset));
cell->back()->cell(0).swap(ar);
}
}
else if (t.cat() == catEnd) {

View File

@ -463,5 +463,5 @@ void MathScriptInset::octavize2(MathInset const * nuc, OctaveStream & os) const
void MathScriptInset::infoize(std::ostream & os) const
{
if (limits_)
os << (limits_ == 1 ? "Displayed limits " : "Inlined limits ");
os << (limits_ == 1 ? "Displayed limits" : "Inlined limits");
}

View File

@ -37,7 +37,7 @@ void MathSizeInset::draw(MathPainterInfo & pi, int x, int y) const
{
//MathStyleChanger dummy(pi.base, MathStyles(key_->id));
xcell(0).draw(pi, x + 1, y);
mathed_draw_framebox(pi, x, y, this);
drawMarkers2(pi, x, y);
}

View File

@ -20,6 +20,8 @@ public:
explicit MathSizeInset(latexkeys const * l);
///
MathInset * clone() const;
/// we write extra braces in any case...
bool extraBraces() const { return true; }
///
void metrics(MathMetricsInfo & st) const;
///