diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-06 11:36:03 +0000 |
---|---|---|
committer | Lior Kaplan <kaplanlior@gmail.com> | 2012-11-12 22:17:43 +0200 |
commit | 9d8d8c8432ceb146bc88e4cfed9011208a53db8a (patch) | |
tree | ec968793e7675eaaaf2892e5d86d5463396a1127 /sw | |
parent | 81d9ca8be4f3abdbd4214110f07a34bd6246f7d8 (diff) |
Resolves: fdo#56554 hyphen in RTL date field split RTL processing
If we split a range into complex and non-complex, and then decide
that the non-complex range is RTL after all, then extend the
original complex range to cover the additional RTL sequence.
Which keeps the full chunk together to be processed correctly
Change-Id: I66a5d585cb22fdb5b6c1de2a8665a9c2c9134f88
(cherry picked from commit deaa86b263e47965eeb67ebb179023bdf5ba82c2)
Signed-off-by: Lior Kaplan <kaplanlior@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/porfld.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 9ac6a6429f52..a53d05f6e3ee 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -244,7 +244,9 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) const sal_uInt8 nFldDir = ( IsNumberPortion() || IsFtnNumPortion() ) ? rSI.GetDefaultDir() : rSI.DirType( IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx() ); - if ( UBIDI_RTL == nFldDir ) + + bool bPerformUBA = UBIDI_LTR != nFldDir ? true : i18n::ScriptType::COMPLEX == nScript; + if (bPerformUBA) { UErrorCode nError = U_ZERO_ERROR; UBiDi* pBidi = ubidi_openSized( aTxt.Len(), 0, &nError ); @@ -274,8 +276,16 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) } } - if ( nCurrDir == UBIDI_RTL ) + if (nCurrDir == UBIDI_RTL) + { nTmp = SW_CTL; + //If we decided that this range was RTL after all and the + //previous range was complex but clipped to the start of this + //range, then extend it to be complex over the additional RTL + //range + if (nScript == i18n::ScriptType::COMPLEX) + nNextScriptChg = nNextDirChg; + } } // #i98418# |