diff --git a/src/mathed/math_braceinset.C b/src/mathed/math_braceinset.C index 021334ac63..614666d56e 100644 --- a/src/mathed/math_braceinset.C +++ b/src/mathed/math_braceinset.C @@ -18,6 +18,13 @@ MathBraceInset::MathBraceInset() {} +MathBraceInset::MathBraceInset(MathArray const & ar) + : MathNestInset(1) +{ + cell(0) = ar; +} + + MathInset * MathBraceInset::clone() const { return new MathBraceInset(*this); diff --git a/src/mathed/math_braceinset.h b/src/mathed/math_braceinset.h index f7b2b98b7c..4cb6705957 100644 --- a/src/mathed/math_braceinset.h +++ b/src/mathed/math_braceinset.h @@ -17,6 +17,8 @@ public: /// MathBraceInset(); /// + MathBraceInset(MathArray const & ar); + /// MathInset * clone() const; /// we write extra braces in any case... bool extraBraces() const { return true; } diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 3d306707bf..0b93d3e99e 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -713,12 +713,10 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags, parse_into(ar, FLAG_BRACE_LAST, mathmode); // 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() == 1 && ar[0]->extraBraces()) { + 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 + cell->push_back(MathAtom(new MathBraceInset(ar))); } else if (t.cat() == catEnd) { @@ -1001,10 +999,13 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags, } else if (t.cs() == "label") { + MathArray ar; + parse_into(ar, FLAG_ITEM, false); if (grid.asHullInset()) { - MathArray ar; - parse_into(ar, FLAG_ITEM, false); grid.asHullInset()->label(cellrow, asString(ar)); + } else { + cell->push_back(createMathInset(t.cs())); + cell->push_back(MathAtom(new MathBraceInset(ar))); } } diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index 85cde72adb..05e61ac293 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -101,7 +101,7 @@ void MathSpaceInset::octavize(OctaveStream & os) const void MathSpaceInset::normalize(NormalStream & os) const { - os << "[space " << space_ << "] "; + os << "[space " << int(space_) << ' ' << latex_mathspace[space_] << "] "; }