[Libreoffice-commits] core.git: 3 commits - sw/source

Khaled Hosny khaledhosny at eglug.org
Sun Nov 6 20:34:46 UTC 2016


 sw/source/core/text/porlay.cxx |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 7fdb418aea11a4e1f09a04c02d125880925272aa
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Nov 6 22:30:32 2016 +0200

    tdf#65344: Don’t put Kashida before any final char
    
    If we didn’t find any known good position, not inserting Kashida at all
    is better than inserting it randomly.
    
    Change-Id: I075f8414b7f0a0aeb4d27d372c7eae51f4b5c37b

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 1edf156..7bd6706 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1056,10 +1056,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
                     {
                         // remaining right joiners
                         // Reh, Zain, Thal,
-                        if ( isRehChar ( cCh ) ||   // Reh Zain (right joining)
-                                                    // final form may appear in the middle of word
-                             ( 0x60C <= cCh && 0x6FE >= cCh // all others
-                              && nIdx == nWordLen - 1))   // only at end of word
+                        if ( isRehChar ( cCh ) )   // Reh Zain (right joining)
                         {
                             SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
                             // check if character is connectable to previous character,
commit 6723fd9d185c8911d83e6b1fd06476e7c5cefce2
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Nov 6 22:16:07 2016 +0200

    Follow Unicode character names for better or worse
    
    To avoid confusing transliteration.
    
    Change-Id: I0ac1692b469f6f974fe3e5b0cc12a40d6f3a7018

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 30b3cbc..1edf156 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -62,7 +62,7 @@ using namespace i18n::ScriptType;
 #define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), UCHAR_JOINING_GROUP ) == U_JG_##g )
 #define isAinChar(c)        IS_JOINING_GROUP((c), AIN)
 #define isAlefChar(c)       IS_JOINING_GROUP((c), ALEF)
-#define isBaaChar(c)        IS_JOINING_GROUP((c), BEH)
+#define isBehChar(c)        IS_JOINING_GROUP((c), BEH)
 #define isDalChar(c)        IS_JOINING_GROUP((c), DAL)
 #define isFehChar(c)        IS_JOINING_GROUP((c), FEH)
 #define isGafChar(c)        IS_JOINING_GROUP((c), GAF)
@@ -1010,10 +1010,10 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
                     }
 
                     // 5. Priority:
-                    // before media Bah
+                    // before medial Beh
                     if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 1 )
                     {
-                        if ( isBaaChar ( cCh )) // Bah
+                        if ( isBehChar ( cCh )) // Beh
                         {
                             // check if next character is Reh, Yeh or Alef Maksura
                             sal_Unicode cNextCh = rWord[ nIdx + 1 ];
@@ -1031,7 +1031,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
                     }
 
                     // 6. Priority:
-                    // before the final form of Waw, Ain, Qaf and Fa
+                    // before the final form of Waw, Ain, Qaf and Feh
                     if ( nPriorityLevel >= 5 && nIdx > 0 )
                     {
                         if ( isWawChar ( cCh )   || // Wav (right joining)
commit 4920ee168fd210483c7f404cc2b41a00a265139f
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Sun Nov 6 22:06:44 2016 +0200

    Insert Kasida before final Heh not Hah
    
    This code seems to follow the algorithm described in:
    https://www.microsoft.com/middleeast/msdn/JustifyingText-CSS.aspx
    
    But there seem to be a confusion due to the transliteration used there,
    Haa can be the standard Arabic name for U+0647 ARABIC LETTER HEH or
    U+062D ARABIC LETTER HAH. The code is using the later, but I’m pretty
    sure it is the former given that the other character in this priority is
    Teh Marbuta, which is a Heh-like character. Also before final Hah is a
    bad place for kashida.
    
    Change-Id: I9ad3fc432ac58f0e45c562a6b44ac5cbe751c3bf

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7850763..30b3cbc 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -66,7 +66,7 @@ using namespace i18n::ScriptType;
 #define isDalChar(c)        IS_JOINING_GROUP((c), DAL)
 #define isFehChar(c)        IS_JOINING_GROUP((c), FEH)
 #define isGafChar(c)        IS_JOINING_GROUP((c), GAF)
-#define isHahChar(c)        IS_JOINING_GROUP((c), HAH)
+#define isHehChar(c)        IS_JOINING_GROUP((c), HEH)
 #define isKafChar(c)        IS_JOINING_GROUP((c), KAF)
 #define isLamChar(c)        IS_JOINING_GROUP((c), LAM)
 #define isQafChar(c)        IS_JOINING_GROUP((c), QAF)
@@ -971,12 +971,12 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
                     }
 
                     // 3. Priority:
-                    // before final form of Teh Marbuta, Hah, Dal
+                    // before final form of Teh Marbuta, Heh, Dal
                     if ( nPriorityLevel >= 2 && nIdx > 0 )
                     {
                         if ( isTehMarbutaChar ( cCh ) || // Teh Marbuta (right joining)
                              isDalChar ( cCh ) ||        // Dal (right joining) final form may appear in the middle of word
-                             ( isHahChar ( cCh ) && nIdx == nWordLen - 1))  // Hah (dual joining) only at end of word
+                             ( isHehChar ( cCh ) && nIdx == nWordLen - 1))  // Heh (dual joining) only at end of word
                         {
 
                             SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );


More information about the Libreoffice-commits mailing list