summaryrefslogtreecommitdiff
path: root/sw/source/core/text/porlay.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/porlay.cxx')
-rw-r--r--sw/source/core/text/porlay.cxx198
1 files changed, 100 insertions, 98 deletions
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 5a26fe11142d..984b8f3ce580 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -638,8 +638,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
// --> FME 2006-03-01 #i3952#
if ( bHasBlankPortion && bHasOnlyBlankPortions )
{
- USHORT nTmpAscent = GetAscent();
- USHORT nTmpHeight = Height();
+ sal_uInt16 nTmpAscent = GetAscent();
+ sal_uInt16 nTmpHeight = Height();
rLine.GetAttrHandler().GetDefaultAscentAndHeight( rInf.GetVsh(), *rInf.GetOut(), nTmpAscent, nTmpHeight );
SetAscent( nTmpAscent );
Height( nTmpHeight );
@@ -752,10 +752,10 @@ SwScriptInfo::~SwScriptInfo()
* Converts i18n Script Type (LATIN, ASIAN, COMPLEX, WEAK) to
* Sw Script Types (SW_LATIN, SW_CJK, SW_CTL), used to identify the font
*************************************************************************/
-BYTE SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
+sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const SwScriptInfo* pSI )
{
OSL_ENSURE( pTxt || pSI,"How should I determine the script type?" );
- USHORT nScript;
+ sal_uInt16 nScript;
// First we try to use our SwScriptInfo
if ( pSI )
@@ -799,17 +799,16 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
MultiSelection aHiddenMulti( aRange );
CalcHiddenRanges( rNode, aHiddenMulti );
- aHiddenChg.Remove( 0, aHiddenChg.Count() );
- USHORT nHiddenIdx = 0;
- USHORT i = 0;
+ aHiddenChg.clear();
+ sal_uInt16 i = 0;
for( i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
const xub_StrLen nStart = (xub_StrLen)rRange.Min();
const xub_StrLen nEnd = (xub_StrLen)rRange.Max() + 1;
- aHiddenChg.Insert( nStart, nHiddenIdx++ );
- aHiddenChg.Insert( nEnd, nHiddenIdx++ );
+ aHiddenChg.push_back( nStart );
+ aHiddenChg.push_back( nEnd );
}
//
@@ -822,16 +821,16 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nInvalidityPos = STRING_LEN;
// this is the default direction
- nDefaultDir = static_cast<BYTE>(bRTL ? UBIDI_RTL : UBIDI_LTR);
+ nDefaultDir = static_cast<sal_uInt8>(bRTL ? UBIDI_RTL : UBIDI_LTR);
// counter for script info arrays
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
// counter for compression information arrays
- USHORT nCntComp = 0;
+ sal_uInt16 nCntComp = 0;
// counter for kashida array
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
- BYTE nScript = i18n::ScriptType::LATIN;
+ sal_uInt8 nScript = i18n::ScriptType::LATIN;
// compression type
const SwCharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType();
@@ -902,7 +901,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// If we are at the start of a group, we do not trust nScript,
// we better get nScript from the breakiterator:
if ( nChg == nGrpStart )
- nScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
+ nScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
//
// INVALID DATA FROM THE SCRIPT INFO ARRAYS HAS TO BE DELETED:
@@ -912,7 +911,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
aScriptChanges.erase( aScriptChanges.begin() + nCnt, aScriptChanges.end() );
// get the start of the last compression group
- USHORT nLastCompression = nChg;
+ sal_uInt16 nLastCompression = nChg;
if( nCntComp )
{
--nCntComp;
@@ -928,7 +927,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
aCompressionChanges.erase(aCompressionChanges.begin() + nCntComp, aCompressionChanges.end() );
// get the start of the last kashida group
- USHORT nLastKashida = nChg;
+ sal_uInt16 nLastKashida = nChg;
if( nCntKash && i18n::ScriptType::COMPLEX == nScript )
{
--nCntKash;
@@ -936,7 +935,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
// remove invalid entries from kashida array
- aKashida.Remove( nCntKash, aKashida.Count() - nCntKash );
+ aKashida.erase( aKashida.begin() + nCntKash, aKashida.end() );
//
// TAKE CARE OF WEAK CHARACTERS: WE MUST FIND AN APPROPRIATE
@@ -955,7 +954,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if( nEnd > rTxt.Len() )
nEnd = rTxt.Len();
- nScript = (BYTE)GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
OSL_ENSURE( i18n::ScriptType::LATIN == nScript ||
i18n::ScriptType::ASIAN == nScript ||
@@ -964,9 +963,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
nChg = nEnd;
// Get next script type or set to weak in order to exit
- BYTE nNextScript = ( nEnd < rTxt.Len() ) ?
- (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nEnd ) :
- (BYTE)WEAK;
+ sal_uInt8 nNextScript = ( nEnd < rTxt.Len() ) ?
+ (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nEnd ) :
+ (sal_uInt8)WEAK;
if ( nScript != nNextScript )
{
@@ -1039,9 +1038,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( CHARCOMPRESS_NONE != aCompEnum &&
i18n::ScriptType::ASIAN == nScript )
{
- BYTE ePrevState = NONE;
- BYTE eState;
- USHORT nPrevChg = nLastCompression;
+ sal_uInt8 ePrevState = NONE;
+ sal_uInt8 eState;
+ sal_uInt16 nPrevChg = nLastCompression;
while ( nLastCompression < nChg )
{
@@ -1064,7 +1063,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
eState = SPECIAL_RIGHT;
break;
default:
- eState = static_cast<BYTE>( ( 0x3040 <= cChar && 0x3100 > cChar ) ? KANA : NONE );
+ eState = static_cast<sal_uInt8>( ( 0x3040 <= cChar && 0x3100 > cChar ) ? KANA : NONE );
}
// insert range of compressable characters
@@ -1116,7 +1115,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
xub_Unicode cCh;
xub_Unicode cPrevCh = 0;
- USHORT nPriorityLevel = 7; // 0..6 = level found
+ sal_uInt16 nPriorityLevel = 7; // 0..6 = level found
// 7 not found
xub_StrLen nWordLen = rWord.Len();
@@ -1260,12 +1259,15 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
} // end of current word
if ( STRING_LEN != nKashidaPos )
- aKashida.Insert( nKashidaPos, nCntKash++ );
+ {
+ aKashida.insert( aKashida.begin() + nCntKash, nKashidaPos);
+ nCntKash++;
+ }
} // end of kashida search
}
if ( nChg < rTxt.Len() )
- nScript = (BYTE)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
+ nScript = (sal_uInt8)pBreakIt->GetBreakIter()->getScriptType( rTxt, nChg );
nLastCompression = nChg;
nLastKashida = nChg;
@@ -1275,7 +1277,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// check kashida data
long nTmpKashidaPos = -1;
sal_Bool bWrongKash = sal_False;
- for (i = 0; i < aKashida.Count(); ++i )
+ for (i = 0; i < aKashida.size(); ++i )
{
long nCurrKashidaPos = GetKashida( i );
if ( nCurrKashidaPos <= nTmpKashidaPos )
@@ -1309,9 +1311,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
// 1. All text in RTL runs will use the CTL font
// #i89825# change the script type also to CTL (hennerdrewes)
// 2. Text in embedded LTR runs that does not have any strong LTR characters (numbers!)
- for ( USHORT nDirIdx = 0; nDirIdx < aDirectionChanges.size(); ++nDirIdx )
+ for ( sal_uInt32 nDirIdx = 0; nDirIdx < aDirectionChanges.size(); ++nDirIdx )
{
- const BYTE nCurrDirType = GetDirType( nDirIdx );
+ const sal_uInt8 nCurrDirType = GetDirType( nDirIdx );
// nStart ist start of RTL run:
const xub_StrLen nStart = nDirIdx > 0 ? GetDirChg( nDirIdx - 1 ) : 0;
// nEnd is end of RTL run:
@@ -1321,7 +1323,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
( nCurrDirType > UBIDI_LTR && !lcl_HasStrongLTR( rTxt, nStart, nEnd ) ) ) // non-strong text in embedded LTR run
{
// nScriptIdx points into the ScriptArrays:
- USHORT nScriptIdx = 0;
+ size_t nScriptIdx = 0;
// Skip entries in ScriptArray which are not inside the RTL run:
// Make nScriptIdx become the index of the script group with
@@ -1331,7 +1333,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
++nScriptIdx;
const xub_StrLen nStartPosOfGroup = nScriptIdx ? GetScriptChg( nScriptIdx - 1 ) : 0;
- const BYTE nScriptTypeOfGroup = GetScriptType( nScriptIdx );
+ const sal_uInt8 nScriptTypeOfGroup = GetScriptType( nScriptIdx );
OSL_ENSURE( nStartPosOfGroup <= nStart && GetScriptChg( nScriptIdx ) > nStart,
"Script override with CTL font trouble" );
@@ -1359,7 +1361,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
#if OSL_DEBUG_LEVEL > 1
// Check that ScriptChangeInfos are in increasing order of
// position and that we don't have "empty" changes.
- BYTE nLastTyp = i18n::ScriptType::WEAK;
+ sal_uInt8 nLastTyp = i18n::ScriptType::WEAK;
xub_StrLen nLastPos = 0;
for (std::vector<ScriptChangeInfo>::const_iterator i2 = aScriptChanges.begin(); i2 < aScriptChanges.end(); ++i2)
{
@@ -1393,7 +1395,7 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
int32_t nStart = 0;
int32_t nEnd;
UBiDiLevel nCurrDir;
- for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
+ for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
aDirectionChanges.push_back( DirectionChangeInfo(nEnd, nCurrDir) );
@@ -1417,8 +1419,8 @@ void SwScriptInfo::UpdateBidiInfo( const String& rTxt )
xub_StrLen SwScriptInfo::NextScriptChg( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountScriptChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountScriptChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetScriptChg( nX ) )
return GetScriptChg( nX );
@@ -1432,25 +1434,25 @@ xub_StrLen SwScriptInfo::NextScriptChg( const xub_StrLen nPos ) const
* returns the script of the character at the input position
*************************************************************************/
-BYTE SwScriptInfo::ScriptType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::ScriptType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountScriptChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountScriptChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetScriptChg( nX ) )
return GetScriptType( nX );
}
// the default is the application language script
- return (BYTE)GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() );
+ return (sal_uInt8)GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
}
xub_StrLen SwScriptInfo::NextDirChg( const xub_StrLen nPos,
- const BYTE* pLevel ) const
+ const sal_uInt8* pLevel ) const
{
- BYTE nCurrDir = pLevel ? *pLevel : 62;
- USHORT nEnd = CountDirChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt8 nCurrDir = pLevel ? *pLevel : 62;
+ sal_uInt16 nEnd = CountDirChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetDirChg( nX ) &&
( nX + 1 == nEnd || GetDirType( nX + 1 ) <= nCurrDir ) )
@@ -1460,10 +1462,10 @@ xub_StrLen SwScriptInfo::NextDirChg( const xub_StrLen nPos,
return STRING_LEN;
}
-BYTE SwScriptInfo::DirType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::DirType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountDirChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountDirChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
if( nPos < GetDirChg( nX ) )
return GetDirType( nX );
@@ -1477,7 +1479,7 @@ BYTE SwScriptInfo::DirType( const xub_StrLen nPos ) const
* Takes a string and replaced the hidden ranges with cChar.
**************************************************************************/
-USHORT SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar )
{
@@ -1486,7 +1488,7 @@ USHORT SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText,
PositionList aList;
xub_StrLen nHiddenStart;
xub_StrLen nHiddenEnd;
- USHORT nNumOfHiddenChars = 0;
+ sal_uInt16 nNumOfHiddenChars = 0;
GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList );
PositionList::const_reverse_iterator rFirst( aList.end() );
PositionList::const_reverse_iterator rLast( aList.begin() );
@@ -1591,7 +1593,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTxtNode& rNode, xub_StrLen nP
Range aRange( 0, rNode.GetTxt().Len() ? rNode.GetTxt().Len() - 1 : 0 );
MultiSelection aHiddenMulti( aRange );
SwScriptInfo::CalcHiddenRanges( rNode, aHiddenMulti );
- for( USHORT i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
+ for( sal_uInt16 i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
const xub_StrLen nHiddenStart = (xub_StrLen)rRange.Min();
@@ -1609,7 +1611,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTxtNode& rNode, xub_StrLen nP
if ( pList )
{
- for( USHORT i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
+ for( sal_uInt16 i = 0; i < aHiddenMulti.GetRangeCount(); ++i )
{
const Range& rRange = aHiddenMulti.GetRange( i );
pList->push_back( (xub_StrLen)rRange.Min() );
@@ -1634,8 +1636,8 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( xub_StrLen nPos, xub_StrLen& rnStartP
rnStartPos = STRING_LEN;
rnEndPos = 0;
- USHORT nEnd = CountHiddenChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountHiddenChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
const xub_StrLen nHiddenStart = GetHiddenChg( nX++ );
const xub_StrLen nHiddenEnd = GetHiddenChg( nX );
@@ -1652,7 +1654,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( xub_StrLen nPos, xub_StrLen& rnStartP
if ( pList )
{
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
pList->push_back( GetHiddenChg( nX++ ) );
pList->push_back( GetHiddenChg( nX ) );
@@ -1681,10 +1683,10 @@ bool SwScriptInfo::IsInHiddenRange( const SwTxtNode& rNode, xub_StrLen nPos )
* returns the type of the compressed character
*************************************************************************/
-BYTE SwScriptInfo::CompType( const xub_StrLen nPos ) const
+sal_uInt8 SwScriptInfo::CompType( const xub_StrLen nPos ) const
{
- USHORT nEnd = CountCompChg();
- for( USHORT nX = 0; nX < nEnd; ++nX )
+ sal_uInt16 nEnd = CountCompChg();
+ for( sal_uInt16 nX = 0; nX < nEnd; ++nX )
{
xub_StrLen nChg = GetCompStart( nX );
@@ -1704,12 +1706,12 @@ BYTE SwScriptInfo::CompType( const xub_StrLen nPos ) const
* betwenn nStart and nEnd
*************************************************************************/
-USHORT SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
+sal_uInt16 SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
{
- USHORT nCnt = CountCompChg();
+ sal_uInt16 nCnt = CountCompChg();
xub_StrLen nEnd = nStart + nLen;
- for( USHORT nX = 0; nX < nCnt; ++nX )
+ for( sal_uInt16 nX = 0; nX < nCnt; ++nX )
{
xub_StrLen nKanaStart = GetCompStart( nX );
xub_StrLen nKanaEnd = nKanaStart + GetCompLen( nX );
@@ -1729,26 +1731,26 @@ USHORT SwScriptInfo::HasKana( xub_StrLen nStart, const xub_StrLen nLen ) const
*************************************************************************/
long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen nLen,
- const USHORT nCompress, const USHORT nFontHeight,
+ const sal_uInt16 nCompress, const sal_uInt16 nFontHeight,
Point* pPoint ) const
{
OSL_ENSURE( nCompress, "Compression without compression?!" );
OSL_ENSURE( nLen, "Compression without text?!" );
- USHORT nCompCount = CountCompChg();
+ sal_uInt16 nCompCount = CountCompChg();
// In asian typography, there are full width and half width characters.
// Full width punctuation characters can be compressed by 50 %
// to determine this, we compare the font width with 75 % of its height
- USHORT nMinWidth = ( 3 * nFontHeight ) / 4;
+ sal_uInt16 nMinWidth = ( 3 * nFontHeight ) / 4;
- USHORT nCompIdx = HasKana( nIdx, nLen );
+ sal_uInt16 nCompIdx = HasKana( nIdx, nLen );
if ( USHRT_MAX == nCompIdx )
return 0;
xub_StrLen nChg = GetCompStart( nCompIdx );
xub_StrLen nCompLen = GetCompLen( nCompIdx );
- USHORT nI = 0;
+ sal_uInt16 nI = 0;
nLen = nLen + nIdx;
if( nChg > nIdx )
@@ -1766,7 +1768,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
long nLast = nI ? pKernArray[ nI - 1 ] : 0;
do
{
- USHORT nType = GetCompType( nCompIdx );
+ sal_uInt16 nType = GetCompType( nCompIdx );
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE( nType == CompType( nIdx ), "Gimme the right type!" );
#endif
@@ -1849,7 +1851,7 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen
// total number of kashida positions, or the number of kashida positions after some positions
// have been dropped, depending on the state of the aKashidaInvalid array.
-USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
+sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
sal_Int32* pScrArray,
xub_StrLen nStt,
xub_StrLen nLen,
@@ -1862,7 +1864,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
// evaluate kashida informatin in collected in SwScriptInfo
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -1873,7 +1875,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
const xub_StrLen nEnd = nStt + nLen;
- USHORT nCntKashEnd = nCntKash;
+ sal_uInt16 nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
@@ -1882,8 +1884,8 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
nCntKashEnd++;
}
- USHORT nActualKashCount = nCntKashEnd - nCntKash;
- for ( USHORT i = nCntKash; i < nCntKashEnd; ++i )
+ sal_uInt16 nActualKashCount = nCntKashEnd - nCntKash;
+ for ( sal_uInt16 i = nCntKash; i < nCntKashEnd; ++i )
{
if ( nActualKashCount && !IsKashidaValid ( i ) )
--nActualKashCount;
@@ -1905,7 +1907,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
while ( nIdx < nEnd )
{
- USHORT nArrayPos = nIdx - nStt;
+ sal_uInt16 nArrayPos = nIdx - nStt;
// next kashida position
++nCntKash;
@@ -1916,7 +1918,7 @@ USHORT SwScriptInfo::KashidaJustify( sal_Int32* pKernArray,
if ( nIdx > nEnd )
nIdx = nEnd;
- const USHORT nArrayEnd = nIdx - nStt;
+ const sal_uInt16 nArrayEnd = nIdx - nStt;
while ( nArrayPos < nArrayEnd )
{
@@ -1981,7 +1983,7 @@ sal_Bool SwScriptInfo::IsArabicText( const XubString& rTxt, xub_StrLen nStt, xub
sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const
{
- for ( xub_StrLen i = 0; i < aKashidaInvalid.Count(); ++i )
+ for ( size_t i = 0; i < aKashidaInvalid.size(); ++i )
{
if ( aKashidaInvalid [ i ] == nKashPos )
return false;
@@ -1993,13 +1995,13 @@ sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const
* SwScriptInfo::ClearKashidaInvalid()
*************************************************************************/
-void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos )
+void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos )
{
- for ( xub_StrLen i = 0; i < aKashidaInvalid.Count(); ++i )
+ for ( size_t i = 0; i < aKashidaInvalid.size(); ++i )
{
if ( aKashidaInvalid [ i ] == nKashPos )
{
- aKashidaInvalid.Remove (i, 1);
+ aKashidaInvalid.erase ( aKashidaInvalid.begin() + i );
return;
}
}
@@ -2016,7 +2018,7 @@ void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos )
bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, bool bMark, xub_StrLen nMarkCount )
{
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -2055,17 +2057,17 @@ bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen,
void SwScriptInfo::MarkKashidaInvalid ( xub_StrLen nKashPos )
{
- aKashidaInvalid.Insert( nKashPos, aKashidaInvalid.Count() );
+ aKashidaInvalid.push_back( nKashPos );
}
/*************************************************************************
* SwScriptInfo::GetKashidaPositions()
*************************************************************************/
// retrieve the kashida positions in the given text range
-USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
+sal_uInt16 SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
xub_StrLen* pKashidaPosition )
{
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
while( nCntKash < CountKashida() )
{
if ( nStt <= GetKashida( nCntKash ) )
@@ -2076,7 +2078,7 @@ USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
const xub_StrLen nEnd = nStt + nLen;
- USHORT nCntKashEnd = nCntKash;
+ sal_uInt16 nCntKashEnd = nCntKash;
while ( nCntKashEnd < CountKashida() )
{
if ( nEnd <= GetKashida( nCntKashEnd ) )
@@ -2092,8 +2094,8 @@ USHORT SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen,
void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen )
{
- aNoKashidaLine.Insert( nStt, aNoKashidaLine.Count());
- aNoKashidaLineEnd.Insert( nStt+nLen, aNoKashidaLineEnd.Count());
+ aNoKashidaLine.push_back( nStt );
+ aNoKashidaLineEnd.push_back( nStt+nLen );
}
/*************************************************************************
@@ -2103,7 +2105,7 @@ void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen )
bool SwScriptInfo::IsKashidaLine ( xub_StrLen nCharIdx ) const
{
- for( xub_StrLen i = 0; i < aNoKashidaLine.Count(); ++i )
+ for( size_t i = 0; i < aNoKashidaLine.size(); ++i )
{
if( nCharIdx >= aNoKashidaLine[ i ] && nCharIdx < aNoKashidaLineEnd[ i ])
return false;
@@ -2116,13 +2118,13 @@ bool SwScriptInfo::IsKashidaLine ( xub_StrLen nCharIdx ) const
void SwScriptInfo::ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen )
{
- xub_StrLen i = 0;
- while( i < aNoKashidaLine.Count())
+ size_t i = 0;
+ while( i < aNoKashidaLine.size())
{
if( nStt + nLen >= aNoKashidaLine[ i ] && nStt < aNoKashidaLineEnd [ i ] )
{
- aNoKashidaLine.Remove(i, 1);
- aNoKashidaLineEnd.Remove(i, 1);
+ aNoKashidaLine.erase(aNoKashidaLine.begin() + i);
+ aNoKashidaLineEnd.erase(aNoKashidaLineEnd.begin() + i);
}
else
++i;
@@ -2137,7 +2139,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo
{
OSL_ENSURE( pKashidaPositions && nCnt > 0, "Where are kashidas?" );
- USHORT nCntKash = 0;
+ sal_uInt16 nCntKash = 0;
xub_StrLen nKashidaPosIdx = 0;
while ( nCntKash < CountKashida() && nKashidaPosIdx < nCnt )
@@ -2163,7 +2165,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo
* SwScriptInfo::ThaiJustify()
*************************************************************************/
-USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
+sal_uInt16 SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
sal_Int32* pScrArray, xub_StrLen nStt,
xub_StrLen nLen, xub_StrLen nNumberOfBlanks,
long nSpaceAdd )
@@ -2174,9 +2176,9 @@ USHORT SwScriptInfo::ThaiJustify( const XubString& rTxt, sal_Int32* pKernArray,
SPACING_PRECISION_FACTOR;
long nSpaceSum = 0;
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
- for ( USHORT nI = 0; nI < nLen; ++nI )
+ for ( sal_uInt16 nI = 0; nI < nLen; ++nI )
{
const xub_Unicode cCh = rTxt.GetChar( nStt + nI );
@@ -2307,7 +2309,7 @@ void SwLineLayout::Init( SwLinePortion* pNextPortion )
SwTwips SwLineLayout::_GetHangingMargin() const
{
SwLinePortion* pPor = GetPortion();
- BOOL bFound = sal_False;
+ sal_Bool bFound = sal_False;
SwTwips nDiff = 0;
while( pPor)
{
@@ -2357,7 +2359,7 @@ SwTwips SwTxtFrm::HangingMargin() const
void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHiddenMulti )
{
const SfxPoolItem* pItem = 0;
- if( SFX_ITEM_SET == rNode.GetSwAttrSet().GetItemState( RES_CHRATR_HIDDEN, TRUE, &pItem ) &&
+ if( SFX_ITEM_SET == rNode.GetSwAttrSet().GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) &&
((SvxCharHiddenItem*)pItem)->GetValue() )
{
rHiddenMulti.SelectAll();
@@ -2392,7 +2394,7 @@ void SwScriptInfo::CalcHiddenRanges( const SwTxtNode& rNode, MultiSelection& rHi
const IDocumentRedlineAccess& rIDRA = *rNode.getIDocumentRedlineAccess();
if ( rHiddenMulti.GetRangeCount() && IDocumentRedlineAccess::IsShowChanges( rIDRA.GetRedlineMode() ) )
{
- USHORT nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX );
+ sal_uInt16 nAct = rIDRA.GetRedlinePos( rNode, USHRT_MAX );
for ( ; nAct < rIDRA.GetRedlineTbl().Count(); nAct++ )
{