diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 2fd5b5ac6ce5..9a82eb3dc042 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4294,13 +4294,18 @@ void ImpEditEngine::ImplInitDigitMode(OutputDevice* pOutDev, LanguageType eCurLa void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_uInt16 nIndex ) { + sal_Bool bCTL = sal_False; sal_Bool bR2L = sal_False; if ( nIndex == 0xFFFF ) { + bCTL = HasScriptType( nPara, i18n::ScriptType::COMPLEX ); bR2L = IsRightToLeft( nPara ); } else { + ContentNode* pNode = GetEditDoc().GetObject( nPara ); + short nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); + bCTL = nScriptType == i18n::ScriptType::COMPLEX; // this change was discussed in issue 37190 bR2L = GetRightToLeft( nPara, nIndex + 1) % 2 ? sal_True : sal_False; // it also works for issue 55927 @@ -4309,18 +4314,21 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_uLong nLayoutMode = pOutDev->GetLayoutMode(); // We always use the left postion for DrawText() - // Let VCL do CTL checking - nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED); + nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL); - if ( !bR2L ) + if ( !bCTL && !bR2L) { // No CTL/Bidi checking necessary nLayoutMode |= ( TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG ); } else { - //Use BIDI_STRONG, Stop VCL to perform ubidi algo on text. - nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT | TEXT_LAYOUT_BIDI_STRONG; + // CTL/Bidi checking neccessary + // Don't use BIDI_STRONG, VCL must do some checks. + nLayoutMode &= ~( TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG ); + + if ( bR2L ) + nLayoutMode |= TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_TEXTORIGIN_LEFT; } pOutDev->SetLayoutMode( nLayoutMode ); |