diff --git a/src/mathed/math_boxinset.C b/src/mathed/math_boxinset.C index 3d5f14b6ad..19ccbad82b 100644 --- a/src/mathed/math_boxinset.C +++ b/src/mathed/math_boxinset.C @@ -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_; +} diff --git a/src/mathed/math_boxinset.h b/src/mathed/math_boxinset.h index 59fd02d1ac..07f3440d96 100644 --- a/src/mathed/math_boxinset.h +++ b/src/mathed/math_boxinset.h @@ -33,6 +33,8 @@ public: void write(WriteStream & os) const; /// void normalize(NormalStream & ns) const; + /// + void infoize(std::ostream & os) const; private: /// diff --git a/src/mathed/math_braceinset.h b/src/mathed/math_braceinset.h index ebfecb6c72..f7b2b98b7c 100644 --- a/src/mathed/math_braceinset.h +++ b/src/mathed/math_braceinset.h @@ -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; /// diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 4fc64187ec..18113f0920 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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"; } diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 515e81f991..965ac0cb65 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -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; } diff --git a/src/mathed/math_parboxinset.C b/src/mathed/math_parboxinset.C index 93ebf41666..ea7ddd55dd 100644 --- a/src/mathed/math_parboxinset.C +++ b/src/mathed/math_parboxinset.C @@ -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_; } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index f015f8c8ba..705c253711 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -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) { diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index 75bc596e9b..40c860d75e 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -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"); } diff --git a/src/mathed/math_sizeinset.C b/src/mathed/math_sizeinset.C index 7fb67920b5..845e16ff9f 100644 --- a/src/mathed/math_sizeinset.C +++ b/src/mathed/math_sizeinset.C @@ -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); } diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index cae5e679a4..c2b1c22350 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -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; ///