From 8b6b06cedc71b9a27b5cb1579af661510bd2bb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 17 Dec 2001 10:25:17 +0000 Subject: [PATCH] bug fix (crash when creating displayed formula after latest cursor changes) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3222 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index f0ef8c9c1e..e9f69acb8b 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -369,11 +369,15 @@ bool positionable(MathCursor::cursor_type const & cursor, void MathCursor::setPos(int x, int y) { - dump("setPos 2"); + dump("setPos 1"); bool res = bruteFind(x, y, formula()->xlow(), formula()->xhigh(), formula()->ylow(), formula()->yhigh()); - lyx::Assert(res); + if (!res) { + // this ccan happen on creation of "math-display" + dump("setPos 1.5"); + first(); + } dump("setPos 2"); }