summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-06 11:36:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-06 11:40:39 +0000
commitdeaa86b263e47965eeb67ebb179023bdf5ba82c2 (patch)
tree0b51067775e857f620d4f3e498d93e436cc9e12c /sw
parent99338b4b11fab0a857029d35edf6421be05353c7 (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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/porfld.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index d28992fbd079..1ede147f5ef7 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -242,7 +242,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 );
@@ -272,8 +274,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#