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

Khaled Hosny khaledhosny at eglug.org
Tue May 2 07:40:48 UTC 2017


 sw/source/core/text/porfld.cxx |    2 --
 sw/source/core/text/porlay.cxx |   10 ----------
 2 files changed, 12 deletions(-)

New commits:
commit 270d6db63d933b7350dc8543b9b9ebc2133a116e
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Wed Apr 19 23:40:04 2017 +0200

    tdf#107204: Make sure we always do Unicode Bidi, take two
    
    [ Now that the side-effect will be fixed by
    <https://gerrit.libreoffice.org/#/c/37050/>.]
    
    Writer seems to have an “optimization” that only applies bidi algorithm
    if the text direction is nor LTR and there is some characters that we
    classify as complex script. This is a very simplistic optimization as
    evidenced by the bug above. We certainly don't want to skip bidi the
    text differently based on the default direction (whatever that means),
    and not all RTL scripts are complex ones, even if they are we might be
    behind Unicode in our script classification.
    
    Just trust that bidi algorithm does the right thing and don’t do
    premature optimization. If this turns out to be a real performance
    issue, we will need to find a better optimization.
    
    Change-Id: I276e2ae0ac92fb51d2e37ef2ad0b11efc6b441ef

diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 3821625a238e..955aaa52f2f5 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -228,8 +228,6 @@ void SwFieldPortion::CheckScript( const SwTextSizeInfo &rInf )
                              rSI.GetDefaultDir() :
                              rSI.DirType( IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx() );
 
-        bool bPerformUBA = UBIDI_LTR != nFieldDir || i18n::ScriptType::COMPLEX == nScript;
-        if (bPerformUBA)
         {
             UErrorCode nError = U_ZERO_ERROR;
             UBiDi* pBidi = ubidi_openSized( aText.getLength(), 0, &nError );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 2b3fcecc436d..97c11ba5ecb7 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1184,16 +1184,6 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL )
     aDirectionChanges.clear();
 
     // Perform Unicode Bidi Algorithm for text direction information
-    bool bPerformUBA = UBIDI_LTR != nDefaultDir;
-    nCnt = 0;
-    while( !bPerformUBA && nCnt < CountScriptChg() )
-    {
-        if ( i18n::ScriptType::COMPLEX == GetScriptType( nCnt++ ) )
-            bPerformUBA = true;
-    }
-
-    // do not call the unicode bidi algorithm if not required
-    if ( bPerformUBA )
     {
         UpdateBidiInfo( rText );
 


More information about the Libreoffice-commits mailing list