File Taking-trailing-whitespace-into-account-when-shaping-lines.patch of Package libqt5-qtbase.16542

From a0d3455ee396b1df5d10a0dc1ee84950fc3635a6 Mon Sep 17 00:00:00 2001
From: David Schulz <david.schulz@qt.io>
Date: Fri, 12 Aug 2016 07:08:33 +0200
Subject: [PATCH] Taking trailing whitespace into account when shaping lines

The calculated end position of script lines, consisting of nothing but
trailing spaces, is lower than the start position. This results in not
shaping those script lines.

Task-number: QTBUG-55255
Change-Id: Ib70c1a800d2f70b7f61e3d05c10618e275f45f12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
---
 src/gui/text/qtextengine.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 17a91f5..3b50376 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -922,7 +922,7 @@ void QTextEngine::shapeLine(const QScriptLine &line)
     if (item == -1)
         return;
 
-    const int end = findItem(line.from + line.length - 1, item);
+    const int end = findItem(line.from + line.length + line.trailingSpaces - 1, item);
     for ( ; item <= end; ++item) {
         QScriptItem &si = layoutData->items[item];
         if (si.analysis.flags == QScriptAnalysis::Tab) {
-- 
2.7.4
openSUSE Build Service is sponsored by