]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
the spellcheck cleanup
[lyx.git] / src / text2.C
index feca17135c90655c257335d01b8619ff1a600db0..6b5d4328a010480700d85101f05b9548d01c617a 100644 (file)
@@ -29,6 +29,7 @@
 #include "counters.h"
 #include "CutAndPaste.h"
 #include "debug.h"
+#include "dispatchresult.h"
 #include "errorlist.h"
 #include "Floating.h"
 #include "FloatList.h"
@@ -602,7 +603,7 @@ void LyXText::toggleFree(LyXFont const & font, bool toggleall)
        // If there is a change in the language the implicit word selection
        // is disabled.
        LyXCursor resetCursor = cursor;
-       bool implicitSelection = 
+       bool implicitSelection =
                font.language() == ignore_language
                && font.number() == LyXFont::IGNORE
                && selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT);
@@ -1338,9 +1339,8 @@ void LyXText::setCursor(LyXCursor & cur, paroffset_type par,
                BOOST_ASSERT(false);
        }
        // now get the cursors x position
-       float x = getCursorX(pit, row, pos, boundary);
-       cur.x(int(x));
-       cur.x_fix(cur.x());
+       cur.x(int(getCursorX(pit, row, pos, boundary)));
+       bv()->x_target(cur.x());
 }
 
 
@@ -1354,7 +1354,7 @@ float LyXText::getCursorX(ParagraphList::iterator pit, Row const & row,
        double fill_label_hfill = row.fill_label_hfill();
        pos_type const row_pos  = row.pos();
        pos_type const end = row.endpos();
-       
+
        if (end <= row_pos)
                cursor_vpos = row_pos;
        else if (pos >= end && !boundary)
@@ -1619,7 +1619,7 @@ void LyXText::cursorUp(bool selecting)
        ParagraphList::iterator cpit = cursorPar();
        Row const & crow = *cpit->getRow(cursor.pos());
 #if 1
-       int x = cursor.x_fix();
+       int x = bv()->x_target();
        int y = cursor.y() - crow.baseline() - 1;
        setCursorFromCoordinates(x, y);
        if (!selecting) {
@@ -1636,7 +1636,7 @@ void LyXText::cursorUp(bool selecting)
 #else
        lyxerr << "cursorUp: y " << cursor.y() << " bl: " <<
                crow.baseline() << endl;
-       setCursorFromCoordinates(cursor.x_fix(),
+       setCursorFromCoordinates(bv()->x_target(),
                cursor.y() - crow.baseline() - 1);
 #endif
 }
@@ -1647,7 +1647,7 @@ void LyXText::cursorDown(bool selecting)
        ParagraphList::iterator cpit = cursorPar();
        Row const & crow = *cpit->getRow(cursor.pos());
 #if 1
-       int x = cursor.x_fix();
+       int x = bv()->x_target();
        int y = cursor.y() - crow.baseline() + crow.height() + 1;
        setCursorFromCoordinates(x, y);
        if (!selecting) {
@@ -1662,7 +1662,7 @@ void LyXText::cursorDown(bool selecting)
                }
        }
 #else
-       setCursorFromCoordinates(cursor.x_fix(),
+       setCursorFromCoordinates(bv()->x_target(),
                 cursor.y() - crow.baseline() + crow.height() + 1);
 #endif
 }