]> git.lyx.org Git - features.git/commitdiff
don't dereference invalid iterators
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 8 Nov 2005 15:12:05 +0000 (15:12 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 8 Nov 2005 15:12:05 +0000 (15:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10596 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 2eaf13c8fa92a606b485d93d4aee24458521899c..804e5bcc2e8cd816d14c169e3c142696396fd3cc 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-08  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * math_parser.C (delEmptyLastRow): Don't delete the dummy row, but
+       the last full row, since the dummy row has only rowinfo
+
 2005-11-02  Angus Leeming  <leeming@lyx.org>
 
        * math_nestinset.C: trivial fix to a MSVS warning.
index cd7fd101b3078d6aed2b4b6634187cbbe8a117cf..a050a512cc55c5cccaddb4fdefd1d4c384768359 100644 (file)
@@ -181,9 +181,11 @@ void delEmptyLastRow(MathGridInset & grid)
                if (!grid.cell(grid.index(row, col)).empty())
                        return;
        }
-       // Remove the dummy row, so that the previous last row (that would
-       // contain the last hline in the example above) becomes the dummy row.
-       grid.delRow(row + 1);
+       // Copy the row information of the empty row (which would contain the
+       // last hline in the example above) to the dummy row and delete the
+       // empty row.
+       grid.rowinfo(row + 1) = grid.rowinfo(row);
+       grid.delRow(row);
 }