summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-04-19 23:40:04 +0200
committerEike Rathke <erack@redhat.com>2017-04-27 15:37:41 +0200
commite3b7ef45d4364fda15691b5748a9a88bc908afc6 (patch)
tree759940aaf283876f7276a934b85aa17de19dd321 /sw
parentdaca28debc20f4bddcab8c22e8d3a0ca5a990486 (diff)
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@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/porfld.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx10
2 files changed, 0 insertions, 12 deletions
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 );