diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2017-04-19 23:40:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-02 09:40:19 +0200 |
commit | 270d6db63d933b7350dc8543b9b9ebc2133a116e (patch) | |
tree | 2761b43731e058949289d6fd6a7172d40dec724e | |
parent | fb3989b6f70b48f4da8ca87e791f6922da56279e (diff) |
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
-rw-r--r-- | sw/source/core/text/porfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 10 |
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 ); |