]> git.lyx.org Git - features.git/commitdiff
Fix bug #7518: Assert when selecting in RTL text
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Apr 2012 20:46:17 +0000 (22:46 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 1 May 2012 09:45:58 +0000 (11:45 +0200)
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.

(cherry picked from commit d7f68078cf3bbf3ea7f5d2b3ac5c7e73555c4681)

src/TextMetrics.cpp
status.20x

index ecc9e5219487d3015fde15ecb0d6aaf336fcb139..d9800e379ad34f96203085d67a01b254dda41027 100644 (file)
@@ -1230,8 +1230,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) {
index 0959093c53f18d4889347e13bb6a6d87a89998ab..9a937603231a262cd05c5b805e1f1ee290692f54 100644 (file)
@@ -107,6 +107,8 @@ What's new
 - Fixed crash when modifying or pasting an equation label and there
   are references to that label in math (bug 8095).
 
+- Fixed assertion on selection of insets in RTL text (bug 7518).
+
 - Don't reset the selected format each time we click into a new paragraph
   in View->Source (bug 7997).