[Libreoffice-commits] core.git: sw/source
Khaled Hosny
khaledhosny at eglug.org
Thu Apr 27 13:38:11 UTC 2017
sw/source/core/text/porfld.cxx | 2 --
sw/source/core/text/porlay.cxx | 10 ----------
2 files changed, 12 deletions(-)
New commits:
commit e3b7ef45d4364fda15691b5748a9a88bc908afc6
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
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: Ic0423b61d54de937bded95b369dab50e8fdca0df
Reviewed-on: https://gerrit.libreoffice.org/36704
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
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