]> git.lyx.org Git - features.git/commitdiff
Fix bug #6633: Equations that end in \limits or \nolimits are corrupted on load.
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 2 Apr 2010 15:22:50 +0000 (15:22 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 2 Apr 2010 15:22:50 +0000 (15:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34025 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathParser.cpp

index f80dba73038976e13fe867bad093168c4833c35e..76f3981c3722dad1abf845fd1d9ea9f31fd4fc76 100644 (file)
@@ -1316,11 +1316,15 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                }
 #endif
 
-               else if (t.cs() == "limits")
-                       limits = 1;
-
-               else if (t.cs() == "nolimits")
-                       limits = -1;
+               else if (t.cs() == "limits" || t.cs() == "nolimits") {
+                       CatCode cat = nextToken().cat();
+                       if (cat == catSuper || cat == catSub)
+                               limits = t.cs() == "limits" ? 1 : -1;
+                       else {
+                               MathAtom at = createInsetMath(t.cs(), buf);
+                               cell->push_back(at);
+                       }
+               }
 
                else if (t.cs() == "nonumber") {
                        if (grid.asHullInset())