#include "counters.h"
#include "CutAndPaste.h"
#include "debug.h"
+#include "dispatchresult.h"
#include "errorlist.h"
#include "Floating.h"
#include "FloatList.h"
LyXText::LyXText(BufferView * bv, InsetText * inset, bool ininset,
ParagraphList & paragraphs)
- : height(0), width(0), anchor_y_(0),
+ : height(0), width(0),
inset_owner(inset), the_locking_inset(0), bv_owner(bv),
in_inset_(ininset), paragraphs_(¶graphs),
cache_pos_(-1)
width = 0;
height = 0;
-
- anchor_y_ = 0;
cache_pos_ = -1;
current_font = getFont(beg, 0);
// If there is a change in the language the implicit word selection
// is disabled.
LyXCursor resetCursor = cursor;
- bool implicitSelection = (font.language() == ignore_language
- && font.number() == LyXFont::IGNORE)
- ? selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT) : false;
+ bool implicitSelection =
+ font.language() == ignore_language
+ && font.number() == LyXFont::IGNORE
+ && selectWordWhenUnderCursor(lyx::WHOLE_WORD_STRICT);
// Set font
setFont(font, toggleall);
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());
}
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)
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) {
#else
lyxerr << "cursorUp: y " << cursor.y() << " bl: " <<
crow.baseline() << endl;
- setCursorFromCoordinates(cursor.x_fix(),
+ setCursorFromCoordinates(bv()->x_target(),
cursor.y() - crow.baseline() - 1);
#endif
}
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) {
}
}
#else
- setCursorFromCoordinates(cursor.x_fix(),
+ setCursorFromCoordinates(bv()->x_target(),
cursor.y() - crow.baseline() + crow.height() + 1);
#endif
}
// we can't possibly have deleted a paragraph before this point
bool deleted = false;
- if (old_pit->empty() ||
- (old_pit->size() == 1 && old_pit->isLineSeparator(0))) {
+ if (old_pit->empty()
+ || (old_pit->size() == 1 && old_pit->isLineSeparator(0))) {
// ok, we will delete something
LyXCursor tmpcursor;
selection.cursor = cursor;
}
}
- if (!deleted) {
- if (old_pit->stripLeadingSpaces()) {
- redoParagraph(old_pit);
- // correct cursor y
- setCursorIntern(cursor.par(), cursor.pos());
- selection.cursor = cursor;
- }
+
+ if (deleted)
+ return true;
+
+ if (old_pit->stripLeadingSpaces()) {
+ redoParagraph(old_pit);
+ // correct cursor y
+ setCursorIntern(cursor.par(), cursor.pos());
+ selection.cursor = cursor;
}
- return deleted;
+ return false;
}
int defaultRowHeight()
{
LyXFont const font(LyXFont::ALL_SANE);
- return int(font_metrics::maxAscent(font)
- + font_metrics::maxDescent(font) * 1.5);
+ return int(font_metrics::maxHeight(font) * 1.2);
}