Pretty straightforward. Ok?

btw, any idea about the crashes (unusable -- lyx-xforms crashes on startup
for instance) with --enable-stdlib-debug? Are these real lyx errors or
something is wrong in my setup?

Alfredo

Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2133
diff -u -p -u -r1.2133 ChangeLog
--- ChangeLog	5 Mar 2005 10:59:28 -0000	1.2133
+++ ChangeLog	7 Mar 2005 11:51:27 -0000
@@ -1,3 +1,9 @@
+
+2005-03-07  Alfredo Braunstein  <[EMAIL PROTECTED]>
+
+	* text2.C (cursorUp): get rid of a crash
+	* text.C (x2pos): add an assert
+
 2005-03-05  Johnathan Burchill  <[EMAIL PROTECTED]> 
 
 	* text2.C: fix for stuck cursor when traversing two 
Index: text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.595
diff -u -p -u -r1.595 text.C
--- text.C	25 Feb 2005 11:55:32 -0000	1.595
+++ text.C	7 Mar 2005 11:51:27 -0000
@@ -2215,6 +2215,7 @@ string LyXText::getPossibleLabel(LCursor
 
 pos_type LyXText::x2pos(pit_type pit, int row, int x) const
 {
+	BOOST_ASSERT(row < pars_[pit].rows().size());
 	bool bound = false;
 	Row const & r = pars_[pit].rows()[row];
 	return r.pos() + getColumnNearX(pit, r, x, bound);
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.602
diff -u -p -u -r1.602 text2.C
--- text2.C	5 Mar 2005 10:59:29 -0000	1.602
+++ text2.C	7 Mar 2005 11:51:28 -0000
@@ -988,7 +988,7 @@ bool LyXText::cursorUp(LCursor & cur)
 	} else if (cur.pit() > 0) {
 		--cur.pit();
 		updateNeeded |= setCursor(cur, cur.pit(),
-					  x2pos(cur.pit(), par.rows().size() - 1, x));
+					  x2pos(cur.pit(), cur.paragraph().rows().size() - 1, x));
 	}
 
 	cur.x_target() = x;

Reply via email to