]> git.lyx.org Git - features.git/commitdiff
getChar fix from Alfredo
authorJohn Levon <levon@movementarian.org>
Tue, 15 Apr 2003 00:30:26 +0000 (00:30 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 15 Apr 2003 00:30:26 +0000 (00:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6808 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index 87255f9dc0637e0d8241f93f0a374c303956a846..1202a9e63b7059b0bcf533f8954c4b68f4b7eda9 100644 (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
index 8186029897a7175f3bac2a343468ef8f881a0a02..f31faa8f19331c723d81a138234fe71ae3109415 100644 (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));