diff options
Diffstat (limited to 'editeng/source/editeng/editdoc2.cxx')
-rw-r--r-- | editeng/source/editeng/editdoc2.cxx | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index 3610423ba3c0..20b13778a025 100644 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -70,10 +70,10 @@ SV_IMPL_VARARR( CharPosArray, sal_Int32 ); /* -BOOL EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) +sal_Bool EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) { if ( GetParent() == rStyle.GetName() ) - return TRUE; + return sal_True; if ( GetParent().Len() && ( GetParent() != GetName() ) ) { @@ -81,7 +81,7 @@ BOOL EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) if ( pS ) return pS->HasStyleAsAnyParent( rStyle ); } - return FALSE; + return sal_False; } */ @@ -100,24 +100,24 @@ TextPortionList::~TextPortionList() void TextPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } -void TextPortionList::DeleteFromPortion( USHORT nDelFrom ) +void TextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) { DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" ); - for ( USHORT nP = nDelFrom; nP < Count(); nP++ ) + for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ ) delete GetObject( nP ); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) +sal_uInt16 TextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) { // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden - USHORT nTmpPos = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + sal_uInt16 nTmpPos = 0; + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { TextPortion* pPortion = GetObject( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -135,10 +135,10 @@ USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOO return ( Count() - 1 ); } -USHORT TextPortionList::GetStartPos( USHORT nPortion ) +sal_uInt16 TextPortionList::GetStartPos( sal_uInt16 nPortion ) { - USHORT nPos = 0; - for ( USHORT n = 0; n < nPortion; n++ ) + sal_uInt16 nPos = 0; + for ( sal_uInt16 n = 0; n < nPortion; n++ ) { TextPortion* pPortion = GetObject( n ); nPos = nPos + pPortion->GetLen(); @@ -158,8 +158,8 @@ ExtraPortionInfo::ExtraPortionInfo() nMaxCompression100thPercent = 0; nAsianCompressionTypes = 0; nPortionOffsetX = 0; - bFirstCharIsRightPunktuation = FALSE; - bCompressed = FALSE; + bFirstCharIsRightPunktuation = sal_False; + bCompressed = sal_False; pOrgDXArray = NULL; } @@ -168,7 +168,7 @@ ExtraPortionInfo::~ExtraPortionInfo() delete[] pOrgDXArray; } -void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ) +void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen ) { delete[] pOrgDXArray; pOrgDXArray = new sal_Int32[nLen]; @@ -190,10 +190,10 @@ ParaPortion::ParaPortion( ContentNode* pN ) DBG_CTOR( EE_ParaPortion, 0 ); pNode = pN; - bInvalid = TRUE; - bVisible = TRUE; - bSimple = FALSE; - bForceRepaint = FALSE; + bInvalid = sal_True; + bVisible = sal_True; + bSimple = sal_False; + bForceRepaint = sal_False; nInvalidPosStart = 0; nInvalidDiff = 0; nHeight = 0; @@ -206,9 +206,9 @@ ParaPortion::~ParaPortion() DBG_DTOR( EE_ParaPortion, 0 ); } -void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) +void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { // nInvalidPosEnd = nStart; // ??? => CreateLines nInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); @@ -232,19 +232,19 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) { // nInvalidPosEnd = pNode->Len(); DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - nInvalidPosStart = Min( nInvalidPosStart, (USHORT) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); + nInvalidPosStart = Min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; - bSimple = FALSE; + bSimple = sal_False; } } - bInvalid = TRUE; + bInvalid = sal_True; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } -void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) +void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */ ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { nInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -255,18 +255,18 @@ void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) // nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; - bInvalid = TRUE; - bSimple = FALSE; + bInvalid = sal_True; + bSimple = sal_False; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } -USHORT ParaPortion::GetLineNumber( USHORT nIndex ) +sal_uInt16 ParaPortion::GetLineNumber( sal_uInt16 nIndex ) { DBG_ASSERTWARNING( aLineList.Count(), "Leere ParaPortion in GetLine!" ); DBG_ASSERT( bVisible, "Wozu GetLine() bei einem unsichtbaren Absatz?" ); - for ( USHORT nLine = 0; nLine < aLineList.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < aLineList.Count(); nLine++ ) { if ( aLineList[nLine]->IsIn( nIndex ) ) return nLine; @@ -277,14 +277,14 @@ USHORT ParaPortion::GetLineNumber( USHORT nIndex ) return (aLineList.Count()-1); } -void ParaPortion::SetVisible( BOOL bMakeVisible ) +void ParaPortion::SetVisible( sal_Bool bMakeVisible ) { bVisible = bMakeVisible; } -void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) +void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - USHORT nLines = aLineList.Count(); + sal_uInt16 nLines = aLineList.Count(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { @@ -302,18 +302,18 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin int nTDiff = -( nTextDiff-1 ); if ( nPDiff || nTDiff ) { - for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ ) + for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { EditLine* pLine = aLineList[ nL ]; - pLine->GetStartPortion() = sal::static_int_cast< USHORT >( + pLine->GetStartPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetStartPortion() + nPDiff); - pLine->GetEndPortion() = sal::static_int_cast< USHORT >( + pLine->GetEndPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetEndPortion() + nPDiff); - pLine->GetStart() = sal::static_int_cast< USHORT >( + pLine->GetStart() = sal::static_int_cast< sal_uInt16 >( pLine->GetStart() + nTDiff); - pLine->GetEnd() = sal::static_int_cast< USHORT >( + pLine->GetEnd() = sal::static_int_cast< sal_uInt16 >( pLine->GetEnd() + nTDiff); pLine->SetValid(); @@ -325,21 +325,21 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin // Shared reverse lookup acceleration pieces ... -static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, - VoidPtr pPtr, USHORT &rLastPos ) +static sal_uInt16 FastGetPos( const VoidPtr *pPtrArray, sal_uInt16 nPtrArrayLen, + VoidPtr pPtr, sal_uInt16 &rLastPos ) { // Through certain filter code-paths we do a lot of appends, which in // turn call GetPos - creating some N^2 nightmares. If we have a // non-trivially large list, do a few checks from the end first. if( rLastPos > 16 ) { - USHORT nEnd; + sal_uInt16 nEnd; if (rLastPos > nPtrArrayLen - 2) nEnd = nPtrArrayLen; else nEnd = rLastPos + 2; - for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) + for( sal_uInt16 nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) { if( pPtrArray[ nIdx ] == pPtr ) { @@ -349,7 +349,7 @@ static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, } } // The world's lamest linear search from svarray ... - for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) + for( sal_uInt16 nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) if (pPtrArray[ nIdx ] == pPtr ) return rLastPos = nIdx; return USHRT_MAX; @@ -367,14 +367,14 @@ ParaPortionList::~ParaPortionList() Reset(); } -USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const +sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), ((ParaPortionList *)this)->nLastCache ); } -USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const +sal_uInt16 ContentList::GetPos( const ContentNodePtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), @@ -383,7 +383,7 @@ USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const void ParaPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } @@ -391,7 +391,7 @@ void ParaPortionList::Reset() long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) { long nHeight = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { ParaPortion* pTmpPortion = GetObject(nPortion); if ( pTmpPortion == pPPortion ) @@ -402,10 +402,10 @@ long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) return nHeight; } -USHORT ParaPortionList::FindParagraph( long nYOffset ) +sal_uInt16 ParaPortionList::FindParagraph( long nYOffset ) { long nY = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { nY += GetObject(nPortion)->GetHeight(); // sollte auch bei !bVisible richtig sein! if ( nY > nYOffset ) @@ -422,7 +422,7 @@ void ParaPortionList::DbgCheck( EditDoc& { #ifdef DBG_UTIL DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() ungleich!" ); - for ( USHORT i = 0; i < Count(); i++ ) + for ( sal_uInt16 i = 0; i < Count(); i++ ) { DBG_ASSERT( SaveGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in Liste!" ); DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in Liste(2)!" ); @@ -458,8 +458,8 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Ungueltiges Item!" ); SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem; - rItem.SetUpper( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); - rItem.SetLower( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); + rItem.SetUpper( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLower( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_SBL: @@ -468,7 +468,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem; // #96298# SetLineHeight changes also eLineSpace! if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) - rItem.SetLineHeight( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_TABS: @@ -476,7 +476,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Ungueltiges Item!" ); SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem; SvxTabStopItem aNewItem( EE_PARA_TABS ); - for ( USHORT i = 0; i < rItem.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rItem.Count(); i++ ) { const SvxTabStop& rTab = rItem[i]; SvxTabStop aNewStop( OutputDevice::LogicToLogic( rTab.GetTabPos(), eSourceUnit, eDestUnit ), rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() ); @@ -502,20 +502,20 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map const SfxItemPool* pSourcePool = rSource.GetPool(); const SfxItemPool* pDestPool = rDest.GetPool(); - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { // Wenn moeglich ueber SlotID gehen... - USHORT nSourceWhich = nWhich; - USHORT nSlot = pDestPool->GetTrueSlotId( nWhich ); + sal_uInt16 nSourceWhich = nWhich; + sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich ); if ( nSlot ) { - USHORT nW = pSourcePool->GetTrueWhich( nSlot ); + sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot ); if ( nW ) nSourceWhich = nW; } - if ( rSource.GetItemState( nSourceWhich, FALSE ) == SFX_ITEM_ON ) + if ( rSource.GetItemState( nSourceWhich, sal_False ) == SFX_ITEM_ON ) { MapUnit eSourceUnit = pSourceUnit ? *pSourceUnit : (MapUnit)pSourcePool->GetMetric( nSourceWhich ); MapUnit eDestUnit = pDestUnit ? *pDestUnit : (MapUnit)pDestPool->GetMetric( nWhich ); |