Lines 76-81
Link Here
|
76 |
|
76 |
|
77 |
//#ifdef BIDI |
77 |
//#ifdef BIDI |
78 |
#include <unicode/ubidi.h> |
78 |
#include <unicode/ubidi.h> |
|
|
79 |
#include <unicode/uchar.h> |
80 |
|
79 |
|
81 |
|
80 |
sal_Bool isAlefChar ( xub_Unicode cCh ) |
82 |
sal_Bool isAlefChar ( xub_Unicode cCh ) |
81 |
{ |
83 |
{ |
Lines 1263-1269
Link Here
|
1263 |
// #i16354# Change script type for RTL text to CTL. |
1265 |
// #i16354# Change script type for RTL text to CTL. |
1264 |
for ( USHORT nDirIdx = 0; nDirIdx < aDirChg.Count(); ++nDirIdx ) |
1266 |
for ( USHORT nDirIdx = 0; nDirIdx < aDirChg.Count(); ++nDirIdx ) |
1265 |
{ |
1267 |
{ |
1266 |
if ( GetDirType( nDirIdx ) == UBIDI_RTL ) |
1268 |
if ( GetDirType( nDirIdx ) == UBIDI_RTL || |
|
|
1269 |
// #i89825# change the script type also to CTL |
1270 |
// if there is no strong LTR char in the LTR run (numbers) |
1271 |
( !HasStrongLTR ( rTxt, nDirIdx ) && ( nDirIdx || nDefaultDir == UBIDI_RTL ))) |
1267 |
{ |
1272 |
{ |
1268 |
// nStart ist start of RTL run: |
1273 |
// nStart ist start of RTL run: |
1269 |
const xub_StrLen nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0; |
1274 |
const xub_StrLen nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0; |
Lines 1328-1333
Link Here
|
1328 |
} |
1333 |
} |
1329 |
} |
1334 |
} |
1330 |
|
1335 |
|
|
|
1336 |
bool SwScriptInfo::HasStrongLTR ( const String& rTxt, xub_StrLen nDirIdx ) |
1337 |
{ |
1338 |
// nStart is start of run: |
1339 |
const xub_StrLen nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0; |
1340 |
// nEnd is end of run: |
1341 |
const xub_StrLen nEnd = GetDirChg( nDirIdx ); |
1342 |
|
1343 |
for ( xub_StrLen nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx ) |
1344 |
{ |
1345 |
UCharDirection nCharDir = u_charDirection ( rTxt.GetChar ( nCharIdx )); |
1346 |
|
1347 |
if ( nCharDir == U_LEFT_TO_RIGHT || |
1348 |
nCharDir==U_LEFT_TO_RIGHT_EMBEDDING || |
1349 |
nCharDir == U_LEFT_TO_RIGHT_OVERRIDE ) |
1350 |
return true; |
1351 |
} |
1352 |
return false; |
1353 |
} |
1354 |
|
1331 |
void SwScriptInfo::UpdateBidiInfo( const String& rTxt ) |
1355 |
void SwScriptInfo::UpdateBidiInfo( const String& rTxt ) |
1332 |
{ |
1356 |
{ |
1333 |
// remove invalid entries from direction information arrays |
1357 |
// remove invalid entries from direction information arrays |