From eb572b63140bbc755961c1025a6535a6ea435a54 Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 15 Apr 2003 00:30:26 +0000 Subject: [PATCH] getChar fix from Alfredo git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6808 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/text2.C | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 87255f9dc0..1202a9e63b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-04-14 Alfredo Braunstein + + * text2.C (beforeFullRowInset): added a bad getchar check, removed + row argument, constify cur argument. + 2003-04-15 Lars Gullik Bjønnes * text2.C (getFont): adjust diff --git a/src/text2.C b/src/text2.C index 8186029897..f31faa8f19 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1987,15 +1987,17 @@ namespace { * and the next row is filled by an inset that spans an entire * row. */ - bool beforeFullRowInset(LyXText & lt, RowList::iterator row, - LyXCursor & cur) { + bool beforeFullRowInset(LyXText & lt, LyXCursor const & cur) { + RowList::iterator row = cur.row(); if (boost::next(row) == lt.rows().end()) return false; Row const & next = *boost::next(row); if (next.pos() != cur.pos() || next.par() != cur.par()) return false; - if (!cur.par()->isInset(cur.pos())) + + if (cur.pos() == cur.par()->size() + || !cur.par()->isInset(cur.pos())) return false; Inset const * inset = cur.par()->getInset(cur.pos()); if (inset->needFullRow() || inset->display()) @@ -2018,7 +2020,7 @@ void LyXText::setCursorFromCoordinates(LyXCursor & cur, int x, int y) cur.y(y + row->baseline()); cur.row(row); - if (beforeFullRowInset(*this, row, cur)) { + if (beforeFullRowInset(*this, cur)) { pos_type last = lastPrintablePos(*this, row); float x = getCursorX(boost::next(row), cur.pos(), last, bound); cur.ix(int(x)); -- 2.39.2