diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2018-03-07 23:29:15 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2018-03-08 01:02:08 +0100 |
commit | 7a683c31e090e5a81debadcef025df9cd61c75f0 (patch) | |
tree | 27e97f5357b232b9fead6749d044fd4d5a0d1822 | |
parent | d6b33e49a5e9c51827eda9c5ba16d8daeb27e8af (diff) |
tdf#116157: Always apply Unicode Bidi in editeng
Similar to commit 270d6db63d933b7350dc8543b9b9ebc2133a116e which fixed
the same issue in Writer. Surely having two text engines duplicating the
same bugs sounded like a brilliant idea to someone.
Change-Id: If85315fb00a2c0be78d502df0bfb9b50d9191368
Reviewed-on: https://gerrit.libreoffice.org/50921
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index a79595251755..227ceba90dba 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1909,19 +1909,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) WritingDirectionInfos& rInfos = pParaPortion->aWritingDirectionInfos; rInfos.clear(); - bool bCTL = false; - ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - for (ScriptTypePosInfo & rType : rTypes) - { - if ( rType.nScriptType == i18n::ScriptType::COMPLEX ) - { - bCTL = true; - break; - } - } - - const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/; - if ( ( bCTL || ( nBidiLevel == 1 /*RTL*/ ) ) && pParaPortion->GetNode()->Len() ) + if (pParaPortion->GetNode()->Len()) { const OUString aText = pParaPortion->GetNode()->GetString(); @@ -1931,6 +1919,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) UBiDi* pBidi = ubidi_openSized( aText.getLength(), 0, &nError ); nError = U_ZERO_ERROR; + const UBiDiLevel nBidiLevel = IsRightToLeft(nPara) ? 1 /*RTL*/ : 0 /*LTR*/; ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.getStr()), aText.getLength(), nBidiLevel, nullptr, &nError ); nError = U_ZERO_ERROR; @@ -1954,7 +1943,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) ubidi_close( pBidi ); } - // No infos mean no CTL and default dir is L2R... + // No infos mean ubidi error, default to LTR if ( rInfos.empty() ) rInfos.emplace_back( 0, 0, pParaPortion->GetNode()->Len() ); |