Fix bug #7518: Assert when selecting in RTL text

If we are in rtl text, we *need* to check whether the first character is a
space. We can't use the rtl variable for this because this is only
computed on the last row.

This bug was introduced in [0a137e31/lyxgit] to fix the computation for
freespacing paragraphs. We better can just check whether the paragraph is
freespacing or not.
This commit is contained in:
Vincent van Ravesteijn 2012-04-29 22:46:17 +02:00
parent 6327993867
commit d7f68078cf

View File

@ -1235,8 +1235,9 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
// if the first character is a separator, and we are in RTL
// text, this character will not be painted on screen
// and thus we should not count it and skip to the next.
if (rtl && par.isSeparator(bidi.vis2log(vc)))
// and thus we should not count it and skip to the next. Only
// in freespacing paragraphs, this first character is painted.
if (!par.isFreeSpacing() && par.isSeparator(bidi.vis2log(vc)))
++vc;
while (vc < end && tmpx <= x) {