summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-02 09:21:51 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-02 09:21:51 +0200
commit1b9d9a8bb640b7883c143cb39e3024be86528977 (patch)
tree0c16cb8dad80077f07dee6391ec8cf1b71a72d1c
parent0dbf528c2927bf15db6cabbb0b7c26b69b071152 (diff)
Revert "tdf#107204: Make sure we always do Unicode Bidi"
This reverts commit e3b7ef45d4364fda15691b5748a9a88bc908afc6, as it breaks the testTableKeep part of CppunitTest_sw_ww8export on the Jenkins_Callgrind tinderbox (and also for me locally) and there is no fix in progress to address that. See the bug for a comparision of the old/new layout for the problematic testcase. Khaled says it's OK to push this revert till it's clear how to fix the bug without side-effects. Change-Id: I669de98ffa8b519024e332ae468808d7e7243df2
-rw-r--r--sw/source/core/text/porfld.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx10
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 955aaa52f2f5..3821625a238e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -228,6 +228,8 @@ 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 97c11ba5ecb7..2b3fcecc436d 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1184,6 +1184,16 @@ 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 );