Jean-Marc Lasgouttes wrote:

> As you suspected the problem is in the array environments. I kept
> both, since they both lead to a crash.

I believe I found the problem: Only rowinfo_ in MathGridInset has the size
of nrows + 2, the size of cells_ and cellinfo_ is nrows * ncols.
Therefore I can't simply delete the dummy row, but have to copy the rowinfo
first and then delete the last full row.
Does the attached patch fix the problem? You can apply it if yes, I'll be
traveling the next few days.


Georg
Index: src/mathed/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.531
diff -u -p -r1.531 ChangeLog
--- src/mathed/ChangeLog	2 Nov 2005 20:11:36 -0000	1.531
+++ src/mathed/ChangeLog	3 Nov 2005 16:17:17 -0000
@@ -1,3 +1,6 @@
+	* 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  <[EMAIL PROTECTED]>
 
 	* math_nestinset.C: trivial fix to a MSVS warning.
Index: src/mathed/math_parser.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_parser.C,v
retrieving revision 1.315
diff -u -p -r1.315 math_parser.C
--- src/mathed/math_parser.C	14 Oct 2005 10:50:22 -0000	1.315
+++ src/mathed/math_parser.C	3 Nov 2005 16:17:17 -0000
@@ -181,9 +181,11 @@ void delEmptyLastRow(MathGridInset & gri
 		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);
 }
 
 

Reply via email to