bool LyXText::IsBoundary(Buffer const * buf, LyXParagraph * par,
LyXParagraph::size_type pos) const
{
- if (!lyxrc.rtl_support)
- return false; // This is just for speedup
+ if (!lyxrc.rtl_support || pos == 0)
+ return false;
- if (!bidi_InRange(pos - 1))
+ if (!bidi_InRange(pos - 1)) {
+ lyxerr << "LyXText::IsBoundary This shouldn't happen." << endl;
return false;
+ }
bool const rtl = bidi_level(pos - 1) % 2;
- bool rtl2 = rtl;
- if (pos == par->Last())
- rtl2 = par->isRightToLeftPar(buf->params);
- else if (bidi_InRange(pos))
- rtl2 = bidi_level(pos) % 2;
+ bool rtl2 = bidi_InRange(pos)
+ ? bidi_level(pos) % 2
+ : par->isRightToLeftPar(buf->params);
return rtl != rtl2;
}
return false; // This is just for speedup
bool const rtl = font.isVisibleRightToLeft();
- bool rtl2 = rtl;
- if (pos == par->Last())
- rtl2 = par->isRightToLeftPar(buf->params);
- else if (bidi_InRange(pos))
- rtl2 = bidi_level(pos) % 2;
+ bool rtl2 = bidi_InRange(pos)
+ ? bidi_level(pos) % 2
+ : par->isRightToLeftPar(buf->params);
return rtl != rtl2;
}
// tmpinset->update(bview, font, false);
tmpinset->draw(bview, font, offset+row->baseline(), x,
cleared);
+#ifdef SEEMS_TO_BE_NOT_NEEDED
if (status == CHANGED_IN_DRAW) {
UpdateInset(bview, tmpinset);
status = CHANGED_IN_DRAW;
}
+#endif
}
++vpos;
if (lyxrc.auto_number) {
if (current_font.number() == LyXFont::ON) {
if (!isdigit(c) && !strchr("+-/*", c) &&
- !(strchr(".",c) &&
+ !(strchr(".,",c) &&
cursor.pos() >= 1 &&
cursor.pos() < cursor.par()->size() &&
GetFont(bview->buffer(),
cursor.par(),
cursor.pos() - 1,
current_font);
- } else if (strchr(".", c) &&
+ } else if (strchr(".,", c) &&
cursor.pos() >= 2 &&
GetFont(bview->buffer(),
cursor.par(),
SetCursor(bview, cursor.par(), cursor.pos() + 1, false,
cursor.boundary());
+ if (IsBoundary(bview->buffer(), cursor.par(), cursor.pos())
+ != cursor.boundary())
+ SetCursor(bview, cursor.par(), cursor.pos(), false,
+ !cursor.boundary());
if (row->next() && row->next()->par() == row->par())
need_break_row = row->next();
else
// current_font = rawtmpfont;
// real_current_font = realtmpfont;
+ if (IsBoundary(bview->buffer(), cursor.par(), cursor.pos())
+ != cursor.boundary())
+ SetCursor(bview, cursor.par(), cursor.pos(), false,
+ !cursor.boundary());
+
lastpos = cursor.par()->Last();
- if (cursor.pos() == lastpos) {
- if (IsBoundary(bview->buffer(), cursor.par(), cursor.pos()) != cursor.boundary())
- SetCursor(bview, cursor.par(), cursor.pos(), false, !cursor.boundary());
+ if (cursor.pos() == lastpos)
SetCurrentFont(bview);
- }
- // check, wether the last characters font has changed.
+ // check, whether the last characters font has changed.
if (rawparfont !=
cursor.par()->GetFontSettings(bview->buffer()->params, lastpos - 1)) {
RedoHeightOfParagraph(bview, cursor);
for (int i = 1; i <= depth; ++i) {
int const line_x = (LYX_PAPER_MARGIN / 5) *
- (i + minipage) + box_x;
+ (i + minipage) + box_x + x_offset;
pain.line(line_x, y_offset, line_x,
y_offset + row_ptr->height() - 1 - (i - next_depth - 1) * 3,
LColor::depthbar);