]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
More 'standard conformant blurb' nonsense.
[lyx.git] / src / text3.C
index 12a6318c62c87d48387aa5234fc9d8465383d9a0..29c8d568133ce15f93f89ed0aa858af383860f8a 100644 (file)
@@ -242,7 +242,7 @@ void LyXText::cursorPrevious()
 
        RowList::iterator rit = cursorRow();
 
-       if (rit == rows().begin()) {
+       if (rit == firstRow()) {
                if (y > 0)
                        bv()->updateScrollbar();
                return;
@@ -275,9 +275,7 @@ void LyXText::cursorPrevious()
 
        LyXCursor cur;
        ParagraphList::iterator pit = cursor.par();
-       if (rit == beginRow(pit))
-               --pit;
-       rit = previousRow(rit);
+       previousRow(pit, rit);
        setCursor(cur, pit, rit->pos(), false);
        if (cur.y() > top_y())
                cursorUp(true);
@@ -304,7 +302,8 @@ void LyXText::cursorNext()
                          + bv()->theLockingInset()->insetInInsetY());
        }
 
-       getRowNearY(y);
+       ParagraphList::iterator dummypit;
+       getRowNearY(y, dummypit);
 
        setCursorFromCoordinates(cursor.x_fix(), y);
        // + bv->workHeight());
@@ -332,9 +331,7 @@ void LyXText::cursorNext()
        }
 
        ParagraphList::iterator pit = cursor.par();
-       if (boost::next(rit) == endRow(pit))
-               ++pit;
-       rit = nextRow(rit);     
+       nextRow(pit, rit);      
        LyXCursor cur;
        setCursor(cur, pit, rit->pos(), false);
        if (cur.y() < top_y() + bv()->workHeight())
@@ -1175,14 +1172,10 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                if (!isInInset() && bv->theLockingInset())
                        break;
                if (cmd.button() == mouse_button::button1) {
-                       if (!isInInset())
-                               bv->screen().toggleSelection(this, bv);
                        cursorHome();
                        selection.cursor = cursor;
                        cursorEnd();
                        setSelection();
-                       if (!isInInset())
-                               bv->screen().toggleSelection(this, bv, false);
                        bv->update();
                        bv->haveSelection(selection.set());
                }
@@ -1194,13 +1187,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                if (!isInInset() && bv->theLockingInset())
                        break;
                if (cmd.button() == mouse_button::button1) {
-                       if (!isInInset()) {
-                               bv->screen().toggleSelection(this, bv);
-                               selectWord(lyx::WHOLE_WORD_STRICT);
-                               bv->screen().toggleSelection(this, bv, false);
-                       } else {
-                               selectWord(lyx::WHOLE_WORD_STRICT);
-                       }
+                       selectWord(lyx::WHOLE_WORD_STRICT);
                        bv->update();
                        bv->haveSelection(selection.set());
                }
@@ -1261,7 +1248,6 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
                bv->text->setSelection();
                bv->update();
-               bv->fitCursor();
                break;
        }
 
@@ -1317,7 +1303,6 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        selection_possible = true;
 
                // Clear the selection
-               bv->screen().toggleSelection(bv->text, bv);
                bv->text->clearSelection();
                bv->update();
                bv->updateScrollbar();
@@ -1438,7 +1423,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        // stack. They don't *have* to
                        // alter the document...
                        // (Joacim)
-                       // ...or maybe the SetCursorParUndo()
+                       // ...or maybe the recordUndo()
                        // below isn't necessary at all anylonger?
                        if (inset_hit->lyxCode() == InsetOld::REF_CODE)
                                recordUndo(bv, Undo::ATOMIC);
@@ -1508,6 +1493,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
        case LFUN_INSET_CAPTION:
 #endif
        case LFUN_INSERT_NOTE:
+       case LFUN_INSERT_BRANCH:
        case LFUN_INSERT_BIBITEM:
        case LFUN_INSET_ERT:
        case LFUN_INSET_FLOAT: