vcl/source/gdi/CommonSalLayout.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 63a4ecc3881596a448d47f564c722ad944ff7e67
Author: Khaled Hosny <khaledho...@eglug.org>
Date:   Sat Apr 21 18:39:30 2018 +0200

    tdf#86399 Correctly set cluster start for RTL runs
    
    A followup for the fix in b1030f75d3e47719ca63ec518f1da75196bead1a (from
    2015) that didn’t work for Arabic because we were setting cluster start
    for RTL runs incorrectly.
    
    I’ve been suffering from this for so long but too lazy to debug it,
    until I saw this pace of code by pure chance and it looked dubious,
    finding where this flag is used and then seeing the comment referring to
    tdf#86399, then WOW I know what is going on!
    
    Change-Id: Ib7850e5a90ed3184738e995885f7f8b459ea2bb9
    Reviewed-on: https://gerrit.libreoffice.org/53261
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledho...@eglug.org>

diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index 463eb255c1dc..c455475ba53d 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -695,6 +695,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint;
                 int32_t nCharPos = pHbGlyphInfos[i].cluster;
                 int32_t nCharCount = 0;
+                bool bInCluster = false;
 
                 // Find the number of characters that make up this glyph.
                 if (!bRightToLeft)
@@ -702,7 +703,10 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                     // If the cluster is the same as previous glyph, then this
                     // already consumed, skip.
                     if (i > 0 && pHbGlyphInfos[i].cluster == pHbGlyphInfos[i - 
1].cluster)
+                    {
                         nCharCount = 0;
+                        bInCluster = true;
+                    }
                     else
                     {
                         // Find the next glyph with a different cluster, or the
@@ -722,7 +726,10 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                     // If the cluster is the same as previous glyph, then this
                     // will be consumed later, skip.
                     if (i < nRunGlyphCount - 1 && pHbGlyphInfos[i].cluster == 
pHbGlyphInfos[i + 1].cluster)
+                    {
                         nCharCount = 0;
+                        bInCluster = true;
+                    }
                     else
                     {
                         // Find the previous glyph with a different cluster, or
@@ -746,10 +753,6 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                         continue;
                 }
 
-                bool bInCluster = false;
-                if (i > 0 && pHbGlyphInfos[i].cluster == pHbGlyphInfos[i - 
1].cluster)
-                    bInCluster = true;
-
                 long nGlyphFlags = 0;
                 if (bRightToLeft)
                     nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to