]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
The "I want this in now" patch.
[lyx.git] / src / text.C
index ad6f97d3ab9b36fb0d1da8d30c26dfd401a7def0..436f94354e0a80f40afcec271b323a7b44d27e7f 100644 (file)
@@ -87,16 +87,24 @@ void LyXText::updateRowPositions()
 
 int LyXText::top_y() const
 {
-       if (isInInset() || anchor_row_ == rowlist_.end() )
+       if (anchor_row_ == rowlist_.end() )
                return 0;
+
        return anchor_row_->y() + anchor_row_offset_;
 }
 
 
 void LyXText::top_y(int newy)
 {
-       if (rows().empty() || isInInset())
+       if (rows().empty())
+               return;
+
+       if (isInInset()) {
+               anchor_row_ = rows().begin();
+               anchor_row_offset_ = newy;
                return;
+       }
+
        lyxerr[Debug::GUI] << "setting top y = " << newy << endl;
 
        int y = newy;
@@ -2109,8 +2117,6 @@ void LyXText::acceptChange()
        if (!selection.set() && cursor.par()->size())
                return;
 
-       bv()->hideCursor();
-
        if (selection.start.par() == selection.end.par()) {
                LyXCursor & startc = selection.start;
                LyXCursor & endc = selection.end;
@@ -2130,8 +2136,6 @@ void LyXText::rejectChange()
        if (!selection.set() && cursor.par()->size())
                return;
 
-       bv()->hideCursor();
-
        if (selection.start.par() == selection.end.par()) {
                LyXCursor & startc = selection.start;
                LyXCursor & endc = selection.end;
@@ -2207,7 +2211,8 @@ LyXText::selectNextWordToSpellcheck(float & value)
        if (cursor.pos() < cursor.par()->size() &&
            cursor.par()->isInset(cursor.pos())) {
                // lock the inset!
-               cursor.par()->getInset(cursor.pos())->edit(bv());
+               FuncRequest cmd(bv(), LFUN_INSET_EDIT, "left");
+               cursor.par()->getInset(cursor.pos())->localDispatch(cmd);
                // now call us again to do the above trick
                // but obviously we have to start from down below ;)
                return bv()->text->selectNextWordToSpellcheck(value);