Preventive fix inspired from ~

This commit is contained in:
Guillaume Munch 2017-03-10 23:20:29 +01:00
parent b034389e6d
commit 22edb3df96

View File

@ -1361,7 +1361,11 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y,
if (edited == inset && cur.pos() == it->pos) { if (edited == inset && cur.pos() == it->pos) {
// non-editable inset, set cursor after the inset if x is // non-editable inset, set cursor after the inset if x is
// nearer to that position (bug 9628) // nearer to that position (bug 9628)
// TODO: This should be replaced with an improvement of
// Cursor::moveToClosestEdge that handles rtl text. (Which could not
// be tested because of #10569.)
CoordCache::Insets const & insetCache = bv_->coordCache().getInsets(); CoordCache::Insets const & insetCache = bv_->coordCache().getInsets();
if (insetCache.has(inset)) {
Dimension const & dim = insetCache.dim(inset); Dimension const & dim = insetCache.dim(inset);
Point p = insetCache.xy(inset); Point p = insetCache.xy(inset);
bool const is_rtl = text_->isRTL(text_->getPar(pit)); bool const is_rtl = text_->isRTL(text_->getPar(pit));
@ -1375,6 +1379,7 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y,
cur.posForward(); cur.posForward();
} }
} }
}
if (cur.top().text() == text_) if (cur.top().text() == text_)
cur.setCurrentFont(); cur.setCurrentFont();