From c3a3e12319242b01426120983aea1d4d46b6b3e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 28 Jun 2002 09:40:40 +0000 Subject: [PATCH] remove "remove seemingly unneeded {} hack" git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4501 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 5 +++++ src/mathed/math_charinset.h | 2 -- src/mathed/math_inset.h | 2 -- src/mathed/math_parser.C | 24 ++++++------------------ src/mathed/math_sizeinset.h | 2 -- src/mathed/math_symbolinset.h | 2 -- 6 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index d7b9e61c9a..83599121ee 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ + +2002-06-24 André Pönitz + + * math_parser.C: remove "remove seemingly unneeded {} hack" + 2002-06-26 Angus Leeming * formula.C: use lyxerr, not cerr. diff --git a/src/mathed/math_charinset.h b/src/mathed/math_charinset.h index cc24898b2f..22664138f6 100644 --- a/src/mathed/math_charinset.h +++ b/src/mathed/math_charinset.h @@ -40,8 +40,6 @@ public: bool isRelOp() const; /// bool match(MathInset *) const; - /// identifies complicated things that need braces if used as arg - bool needsBraces() const { return false; } private: /// the character diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 0c6fd08548..09a02384c1 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -224,8 +224,6 @@ public: virtual char getChar() const { return 0; } /// identifies things that can get \limits or \nolimits virtual bool takesLimits() const { return false; } - /// identifies complicated things that need braces if used as arg - virtual bool needsBraces() const { return true; } /// virtual void edit(BufferView *, int, int, mouse_button::state) {} diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 3108d61d20..d32e8db26d 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -595,10 +595,10 @@ void Parser::parse_into(MathArray & array, unsigned flags, bool mathmode) parse_into1(grid, flags, mathmode, false); array = grid.cell(0); // remove 'unnecessary' braces: - if (array.size() == 1 && array.back()->asBraceInset()) { - lyxerr << "extra braces removed\n"; - array = array.back()->asBraceInset()->cell(0); - } + //if (array.size() == 1 && array.back()->asBraceInset()) { + // lyxerr << "extra braces removed\n"; + // array = array.back()->asBraceInset()->cell(0); + //} } @@ -693,20 +693,8 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags, else if (t.cat() == catBegin) { MathArray ar; parse_into(ar, FLAG_BRACE_LAST, mathmode); -#ifndef WITH_WARNINGS -#warning this might be wrong in general! -#endif - // ignore braces around simple items - if ((ar.size() == 1 && !ar.front()->needsBraces() - || (ar.size() == 2 && !ar.front()->needsBraces() - && ar.back()->asScriptInset())) - || (ar.size() == 0 && cell->size() == 0)) - { - cell->push_back(ar); - } else { - cell->push_back(MathAtom(new MathBraceInset)); - cell->back()->cell(0).swap(ar); - } + cell->push_back(MathAtom(new MathBraceInset)); + cell->back()->cell(0).swap(ar); } else if (t.cat() == catEnd) { diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index 9870777e3d..a1bc12b49b 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -24,8 +24,6 @@ public: void metrics(MathMetricsInfo & st) const; /// void draw(MathPainterInfo &, int x, int y) const; - /// - bool needsBraces() const { return false; } /// void write(WriteStream & os) const; diff --git a/src/mathed/math_symbolinset.h b/src/mathed/math_symbolinset.h index 22b3f86901..2f7e0a0af9 100644 --- a/src/mathed/math_symbolinset.h +++ b/src/mathed/math_symbolinset.h @@ -37,8 +37,6 @@ public: bool match(MathInset *) const; /// request "external features" void validate(LaTeXFeatures & features) const; - /// identifies complicated things that need braces if used as arg - bool needsBraces() const { return false; } /// void normalize(NormalStream &) const; -- 2.39.2