From 39f06f37c37b1af1207734cdeafd3d324c08da03 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 29 Apr 2012 22:46:17 +0200 Subject: [PATCH] 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. (cherry picked from commit d7f68078cf3bbf3ea7f5d2b3ac5c7e73555c4681) --- src/TextMetrics.cpp | 5 +++-- status.20x | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index ecc9e52194..d9800e379a 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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) { diff --git a/status.20x b/status.20x index 0959093c53..9a93760323 100644 --- a/status.20x +++ b/status.20x @@ -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). -- 2.39.5