From 5be7e73fde1e08e2416ead7b0d869e5edf6c9361 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 8 Nov 2005 15:12:05 +0000 Subject: [PATCH] don't dereference invalid iterators git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10596 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 5 +++++ src/mathed/math_parser.C | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 2eaf13c8fa..804e5bcc2e 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2005-11-08 Georg Baum + + * 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 * math_nestinset.C: trivial fix to a MSVS warning. diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index cd7fd101b3..a050a512cc 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -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); } -- 2.39.2