]> git.lyx.org Git - features.git/commitdiff
fix \| after \left or \right in mathed
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 2 Mar 2005 14:26:12 +0000 (14:26 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 2 Mar 2005 14:26:12 +0000 (14:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9689 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_parser.C

index 5832bc7368ca3d4746a35ee700418fde94d2a19d..7bb40695334086709b391f0dcc18931ed8b1fb57 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-02  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * math_parser.C (parse1): Don't parse "\|" following a "\left" or
+       "\right" as "|"
+
 2005-02-28  André Pönitz  <poenitz@lyx.org>
 
        * math_nestinset.C (lfunMouseRelease, lfunMouseMotion, lfunMousePress):
index 192e642b8fe435d87671ef74c920bcc031a3c890..6855483c556bf4ea2b542769e7ace234b3cdb9e8 100644 (file)
@@ -1048,11 +1048,16 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
 
                else if (t.cs() == "left") {
                        skipSpaces();
-                       string l = getToken().asString();
+                       Token const & tl = getToken();
+                       // \| and \Vert are equivalent, and MathDelimInset
+                       // can't handle \|
+                       // FIXME: fix this in MathDelimInset itself!
+                       string const l = tl.cs() == "|" ? "Vert" : tl.asString();
                        MathArray ar;
                        parse(ar, FLAG_RIGHT, mode);
                        skipSpaces();
-                       string r = getToken().asString();
+                       Token const & tr = getToken();
+                       string const r = tr.cs() == "|" ? "Vert" : tr.asString();
                        cell->push_back(MathAtom(new MathDelimInset(l, r, ar)));
                }
 
@@ -1083,8 +1088,8 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        }
 
                        else if (name == "split" || name == "cases" ||
-                                        name == "gathered" || name == "aligned" ||
-                                  name == "alignedat") {
+                                name == "gathered" || name == "aligned" ||
+                                name == "alignedat") {
                                cell->push_back(createMathInset(name));
                                parse2(cell->back(), FLAG_END, mode, false);
                        }