vcl/source/outdev/font.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 726baadc33b06b3ac2d6f9a46471bedd8a6cbea5
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Sat Aug 20 16:21:08 2022 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Sat Aug 20 17:24:05 2022 +0200

    Don’t unconditionally validate Kashida at start/end of layout
    
    That was a thinko. The mixed-style-in-one-word case will have the next
    position will be past the end of the layout. A position at the start or
    end of the layout is the first or last letter of a word, and we don’t
    want to unconditionally allow Kashida there.
    
    Change-Id: I0b287fe9cbf200282058fd7f8e81880ff328941d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138589
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.com>

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 8bae1c719e37..af0faea6dd74 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1326,11 +1326,11 @@ sal_Int32 OutputDevice::ValidateKashidas ( const 
OUString& rTxt,
                u_getIntPropertyValue(rTxt[nNextPos], UCHAR_JOINING_TYPE) == 
U_JT_TRANSPARENT)
             nNextPos++;
 
-        // This is the start or end of the layout, it would happen if we
+        // The next position is past end of the layout, it would happen if we
         // changed the text styling in the middle of a word. Since we don’t do
         // apply OpenType features across different layouts, this can’t be an
         // invalid place to insert Kashida.
-        if (nPos == nIdx || nNextPos >= nEnd)
+        if (nNextPos > nEnd)
             continue;
 
         if (!pSalLayout->IsKashidaPosValid(nPos, nNextPos))

Reply via email to