getChar fix from Alfredo

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6808 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-04-15 00:30:26 +00:00
parent 6519ce1be5
commit eb572b6314
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2003-04-14 Alfredo Braunstein <abraunst@libero.it>
* text2.C (beforeFullRowInset): added a bad getchar check, removed
row argument, constify cur argument.
2003-04-15 Lars Gullik Bjønnes <larsbj@gullik.net>
* text2.C (getFont): adjust

View File

@ -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));