[Libreoffice-commits] .: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Nov 6 03:40:59 PST 2012
sw/source/core/text/porfld.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit deaa86b263e47965eeb67ebb179023bdf5ba82c2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 6 11:36:03 2012 +0000
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
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index d28992f..1ede147 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#
More information about the Libreoffice-commits
mailing list