commit 595c6d0a05945eec5df2820be728362fcda5d127
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Apr 9 11:29:20 2019 +0200

    Fix bold-like characters when selecting bidi text
    
    In painter, restrting paining regions does not really work when region is 
empty.
    
    Fixes bug #11198.
    
    (cherry picked from commit f9da28428a75f3e60920ec983ff52bbbf2e6d683)
---
 src/frontends/qt4/GuiPainter.cpp |    6 +++++-
 status.23x                       |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp
index b0b1ec1..c635c6f 100644
--- a/src/frontends/qt4/GuiPainter.cpp
+++ b/src/frontends/qt4/GuiPainter.cpp
@@ -489,7 +489,11 @@ void GuiPainter::text(int x, int y, docstring const & str, 
Font const & f,
        int const height = fm.maxAscent() + fm.maxDescent();
        int xmin = fm.pos2x(str, from, dir == RtL, wordspacing);
        int xmax = fm.pos2x(str, to, dir == RtL, wordspacing);
-       if (xmin > xmax)
+       // Avoid this case, since it would make the `other' text spill in some 
cases
+       if (xmin == xmax) {
+               text(x, y, str, fi, dir, wordspacing, tw);
+               return;
+       } else if (xmin > xmax)
                swap(xmin, xmax);
 
        // First the part in other color
diff --git a/status.23x b/status.23x
index bd7053e..5814ac9 100644
--- a/status.23x
+++ b/status.23x
@@ -184,6 +184,8 @@ What's new
 
 - Fix left/right border UI when toggling formal table style (bug 9835).
 
+- Fix bold-like characters when selecting bidi text (bug 11198).
+
 
 * INTERNALS
 

Reply via email to