#include "frontends/font_metrics.h"
#include "debug.h"
#include "lyxrc.h"
+#include "Floating.h"
#include "FloatList.h"
#include "language.h"
#include "ParagraphParameters.h"
return;
RowList::iterator rit = cursorRow();
- RowList::iterator next_rit = boost::next(rit);
- RowList::iterator end = boost::next(rit);
ParagraphList::iterator pit = cursor.par();
- pos_type last_pos = lastPos(*pit, rit);
-
- if (next_rit == end) {
- ++last_pos;
- } else {
- if (pit->empty() ||
- (pit->getChar(last_pos) != ' ' && !pit->isNewline(last_pos))) {
- ++last_pos;
- }
- }
-
- setCursor(pit, last_pos);
+ pos_type pos = lastPos(*pit, rit);
+ /* cursor should be before a hard newline only */
+ if (!pit->isNewline(pos))
+ ++pos;
+ setCursor(pit, pos);
}
RowList::iterator row = getRow(pit, pos);
int y = row->y();
- RowList::iterator old_row = row;
- // if we are before the first char of this row and are still in the
- // same paragraph and there is a previous row then put the cursor on
- // the end of the previous row
- cur.iy(y + row->baseline());
-
// y is now the beginning of the cursor row
y += row->baseline();
// y is now the cursor baseline
cur.y(y);
- pos_type last = lastPrintablePos(*pit, old_row);
+ pos_type last = lastPrintablePos(*pit, row);
// None of these should happen, but we're scaredy-cats
if (pos > pit->size()) {
float x = getCursorX(pit, row, pos, last, boundary);
cur.x(int(x));
cur.x_fix(cur.x());
- if (old_row != row) {
- x = getCursorX(pit, old_row, pos, last, boundary);
- cur.ix(int(x));
- } else
- cur.ix(cur.x());
}
cur.x(x);
cur.y(y + rit->baseline());
- cur.iy(cur.y());
- cur.ix(cur.x());
-
cur.boundary(bound);
}
setCursorFromCoordinates(x, y);
if (!selecting) {
int topy = bv_owner->top_y();
- int y1 = cursor.iy() - topy;
+ int y1 = cursor.y() - topy;
int y2 = y1;
y -= topy;
InsetOld * inset_hit = checkInsetHit(x, y1);
setCursorFromCoordinates(x, y);
if (!selecting && cursorRow() == cursorIRow()) {
int topy = bv_owner->top_y();
- int y1 = cursor.iy() - topy;
+ int y1 = cursor.y() - topy;
int y2 = y1;
y -= topy;
InsetOld * inset_hit = checkInsetHit(x, y1);