diff options
Diffstat (limited to 'svtools/source/contnr/treelist.cxx')
-rw-r--r-- | svtools/source/contnr/treelist.cxx | 304 |
1 files changed, 152 insertions, 152 deletions
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 1b96f1ac89e4..c4ec516a735b 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -89,7 +89,7 @@ void SvListEntry::SetListPositions() if( pChilds ) { SvListEntry *pEntry = (SvListEntry*)pChilds->First(); - ULONG nCur = 0; + sal_uLong nCur = 0; while ( pEntry ) { pEntry->nListPos &= 0x80000000; @@ -152,7 +152,7 @@ void SvTreeEntryList::DestroyAll() SvTreeList::SvTreeList() { nEntryCount = 0; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; nRefCount = 1; pRootItem = new SvListEntry; eSortMode = SortNone; @@ -188,11 +188,11 @@ SvTreeList::~SvTreeList() |* *************************************************************************/ -void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvTreeList::Broadcast( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { - ULONG nViewCount = aViewList.Count(); - for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ ) + sal_uLong nViewCount = aViewList.Count(); + for( sal_uLong nCurView = 0; nCurView < nViewCount; nCurView++ ) { SvListView* pView = (SvListView*)aViewList.GetObject( nCurView ); if( pView ) @@ -202,7 +202,7 @@ void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1, void SvTreeList::InsertView( SvListView* pView) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uLong nPos = aViewList.GetPos( pView ); if ( nPos == LIST_ENTRY_NOTFOUND ) { aViewList.Insert( pView, LIST_APPEND ); @@ -212,7 +212,7 @@ void SvTreeList::InsertView( SvListView* pView) void SvTreeList::RemoveView( SvListView* pView ) { - ULONG nPos = aViewList.GetPos( pView ); + sal_uLong nPos = aViewList.GetPos( pView ); if ( nPos != LIST_ENTRY_NOTFOUND ) { aViewList.Remove( pView ); @@ -222,15 +222,15 @@ void SvTreeList::RemoveView( SvListView* pView ) // Ein Entry ist sichtbar, wenn alle Parents expandiert sind -BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const +sal_Bool SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params"); - BOOL bRetVal=FALSE; + sal_Bool bRetVal=sal_False; do { if ( pEntry == pRootItem ) { - bRetVal=TRUE; + bRetVal=sal_True; break; } pEntry = pEntry->pParent; @@ -238,10 +238,10 @@ BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) return bRetVal; } -USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const +sal_uInt16 SvTreeList::GetDepth( SvListEntry* pEntry ) const { DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry"); - USHORT nDepth = 0; + sal_uInt16 nDepth = 0; while( pEntry->pParent != pRootItem ) { nDepth++; @@ -290,20 +290,20 @@ void SvTreeList::Clear() |* *************************************************************************/ -BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const +sal_Bool SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; SvTreeEntryList* pList = pParent->pChilds; if ( !pList ) - return FALSE; + return sal_False; SvListEntry* pActualChild = (SvListEntry*)(pList->First()); while( !bIsChild && pActualChild ) { if ( pActualChild == pChild ) - bIsChild = TRUE; + bIsChild = sal_True; else { if ( pActualChild->pChilds ) @@ -314,7 +314,7 @@ BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const return bIsChild; } -ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uLong SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -329,7 +329,7 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( pSrcEntry == pTargetParent ) return pSrcEntry->GetChildListPos(); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; SvTreeEntryList* pDstList = pTargetParent->pChilds; SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds; @@ -358,20 +358,20 @@ ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n // Listenpositionen in Zielliste korrigieren SetListPositions( pDstList ); - if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList ) + if ( pSrcList && (sal_uLong)pSrcList != (sal_uLong)pDstList ) SetListPositions( pSrcList ); #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - ULONG nRetVal = pDstList->GetPos( pSrcEntry ); + sal_uLong nRetVal = pDstList->GetPos( pSrcEntry ); DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid"); Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal); return nRetVal; } -ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos) +sal_uLong SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,sal_uLong nListPos) { // pDest darf Null sein! DBG_ASSERT(pSrcEntry,"Entry?"); @@ -380,9 +380,9 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n if ( !pTargetParent->pChilds ) pTargetParent->pChilds = new SvTreeEntryList; - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; - ULONG nCloneCount = 0; + sal_uLong nCloneCount = 0; SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount ); nEntryCount += nCloneCount; @@ -395,7 +395,7 @@ ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG n CheckIntegrity(); #endif Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry ); - ULONG nRetVal = pDstList->GetPos( pClonedEntry ); + sal_uLong nRetVal = pDstList->GetPos( pClonedEntry ); return nRetVal; } @@ -414,7 +414,7 @@ CheckIntegrity(); void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -443,7 +443,7 @@ void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -470,7 +470,7 @@ void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry ) void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) { SvListEntry* pParent; - ULONG nPos; + sal_uLong nPos; if ( !pDstEntry ) { @@ -487,7 +487,7 @@ void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry) void SvTreeList::InsertTree(SvListEntry* pSrcEntry, - SvListEntry* pTargetParent,ULONG nListPos) + SvListEntry* pTargetParent,sal_uLong nListPos) { DBG_ASSERT(pSrcEntry,"InsertTree:Entry?"); if ( !pSrcEntry ) @@ -501,7 +501,7 @@ void SvTreeList::InsertTree(SvListEntry* pSrcEntry, // Sortierung beruecksichtigen GetInsertionPos( pSrcEntry, pTargetParent, nListPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pSrcEntry->pParent = pTargetParent; // Parent umsetzen SvTreeEntryList* pDstList = pTargetParent->pChilds; @@ -540,7 +540,7 @@ SvListEntry* SvTreeList::CreateEntry() const |* *************************************************************************/ -SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const +SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, sal_uLong& nCloneCount ) const { SvListEntry* pClonedEntry = CloneEntry( pEntry ); nCloneCount = 1; @@ -562,7 +562,7 @@ SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, SvListEntry* pNewParent, - ULONG& nCloneCount ) const + sal_uLong& nCloneCount ) const { DBG_ASSERT(pChilds->Count(),"Childs?"); SvTreeEntryList* pClonedChilds = new SvTreeEntryList; @@ -596,16 +596,16 @@ SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds, |* *************************************************************************/ -ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const +sal_uLong SvTreeList::GetChildCount( SvListEntry* pParent ) const { if ( !pParent ) return GetEntryCount(); if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -625,16 +625,16 @@ ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const +sal_uLong SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const { DBG_ASSERT(pView,"GetVisChildCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds ) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = NextVisible( pView, pParent, &nActDepth ); @@ -644,16 +644,16 @@ ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pPa return nCount; } -ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const +sal_uLong SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const { DBG_ASSERT(pView,"GetChildSelCount:No View"); if ( !pParent ) pParent = pRootItem; if ( !pParent || !pParent->pChilds) return 0; - ULONG nCount = 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nActDepth = nRefDepth; + sal_uLong nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nActDepth = nRefDepth; do { pParent = Next( pParent, &nActDepth ); @@ -692,22 +692,22 @@ SvListEntry* SvTreeList::First() const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT( pActEntry && pActEntry->pParent, "SvTreeList::Next: invalid entry/parent!" ); if ( !pActEntry || !pActEntry->pParent ) return NULL; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ ) { @@ -756,20 +756,20 @@ SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const +SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, sal_uInt16* pDepth ) const { DBG_ASSERT(pActEntry!=0,"Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pDepth ) { nDepth = *pDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -809,7 +809,7 @@ SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const |* *************************************************************************/ -SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const +SvListEntry* SvTreeList::Last( sal_uInt16* /* nDepth */ ) const { SvTreeEntryList* pActList = pRootItem->pChilds; // if ( pActList->Count() == 0 ) @@ -835,7 +835,7 @@ SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const |* *************************************************************************/ -ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const +sal_uLong SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const { DBG_ASSERT(pView&&pEntry,"View/Entry?"); @@ -859,7 +859,7 @@ ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) |* *************************************************************************/ -ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const +sal_uLong SvTreeList::GetVisibleCount( const SvListView* pView ) const { DBG_ASSERT(pView,"GetVisCount:No View"); if( !pView->HasViewData() ) @@ -867,7 +867,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const if ( pView->nVisibleCount ) return pView->nVisibleCount; - ULONG nPos = 0; + sal_uLong nPos = 0; SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar while ( pEntry ) { @@ -883,7 +883,7 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const } #endif ((SvListView*)pView)->nVisibleCount = nPos; - ((SvListView*)pView)->bVisPositionsValid = TRUE; + ((SvListView*)pView)->bVisPositionsValid = sal_True; return nPos; } @@ -901,22 +901,22 @@ ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,sal_uInt16* pActDepth) const { DBG_ASSERT(pView,"NextVisible:No View"); if ( !pActEntry ) return 0; - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( pView->IsExpanded(pActEntry) ) { @@ -971,20 +971,20 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEn // Funktion geht aus Geschwindigkeitsgruenden davon aus, // das der uebergebene Eintrag bereits sichtbar ist -SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const +SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, sal_uInt16* pActDepth) const { DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?"); - USHORT nDepth = 0; - int bWithDepth = FALSE; + sal_uInt16 nDepth = 0; + int bWithDepth = sal_False; if ( pActDepth ) { nDepth = *pActDepth; - bWithDepth = TRUE; + bWithDepth = sal_True; } SvTreeEntryList* pActualList = pActEntry->pParent->pChilds; - ULONG nActualPos = pActEntry->GetChildListPos(); + sal_uLong nActualPos = pActEntry->GetChildListPos(); if ( nActualPos > 0 ) { @@ -1024,7 +1024,7 @@ SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActE |* *************************************************************************/ -SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const +SvListEntry* SvTreeList::LastVisible( const SvListView* pView, sal_uInt16* pDepth) const { DBG_ASSERT(pView,"LastVis:No View"); SvListEntry* pEntry = Last(); @@ -1045,20 +1045,20 @@ SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) c |* *************************************************************************/ -SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const +SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,sal_uInt16& nDelta) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 // nNewDelta = 10-nVisPos-1 == 4 if ( nVisPos+nDelta >= pView->nVisibleCount ) { - nDelta = (USHORT)(pView->nVisibleCount-nVisPos); + nDelta = (sal_uInt16)(pView->nVisibleCount-nVisPos); nDelta--; } - USHORT nDeltaTmp = nDelta; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = NextVisible( pView, pEntry ); @@ -1078,17 +1078,17 @@ SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry |* *************************************************************************/ -SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const +SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, sal_uInt16& nDelta ) const { DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis"); - ULONG nVisPos = GetVisiblePos( pView, pEntry ); + sal_uLong nVisPos = GetVisiblePos( pView, pEntry ); // nDelta Eintraege vorhanden ? // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20 // nNewDelta = nNewVisPos if ( nDelta > nVisPos ) - nDelta = (USHORT)nVisPos; - USHORT nDeltaTmp = nDelta; + nDelta = (sal_uInt16)nVisPos; + sal_uInt16 nDeltaTmp = nDelta; while( nDeltaTmp ) { pEntry = PrevVisible( pView, pEntry ); @@ -1138,8 +1138,8 @@ SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const if( !pEntry ) return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; -// ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); +// sal_uLong nPos = pList->GetPos( pEntry ); + sal_uLong nPos = pEntry->GetChildListPos(); nPos++; pEntry = (SvListEntry*)(pList->GetObject( nPos )); return pEntry; @@ -1152,8 +1152,8 @@ SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const return 0; SvTreeEntryList* pList = pEntry->pParent->pChilds; - // ULONG nPos = pList->GetPos( pEntry ); - ULONG nPos = pEntry->GetChildListPos(); + // sal_uLong nPos = pList->GetPos( pEntry ); + sal_uLong nPos = pEntry->GetChildListPos(); if ( nPos == 0 ) return 0; nPos--; @@ -1243,7 +1243,7 @@ SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const |* Letzte Aenderung 17.08.94 |* *************************************************************************/ -ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) +sal_uLong SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,sal_uLong nPos ) { DBG_ASSERT( pEntry,"Entry?"); @@ -1262,7 +1262,7 @@ ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos ) // Sortierung beruecksichtigen GetInsertionPos( pEntry, pParent, nPos ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; pEntry->pParent = pParent; pList->Insert( pEntry, nPos ); @@ -1289,7 +1289,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const +sal_uLong SvTreeList::GetAbsPos( SvListEntry* pEntry) const { if ( !bAbsPositionsValid ) ((SvTreeList*)this)->SetAbsolutePositions(); @@ -1308,7 +1308,7 @@ ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const void SvTreeList::SetAbsolutePositions() { - ULONG nPos = 0; + sal_uLong nPos = 0; SvListEntry* pEntry = First(); while ( pEntry ) { @@ -1316,7 +1316,7 @@ void SvTreeList::SetAbsolutePositions() nPos++; pEntry = Next( pEntry ); } - bAbsPositionsValid = TRUE; + bAbsPositionsValid = sal_True; #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif @@ -1347,7 +1347,7 @@ void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry ) // wenn Parent sichtbar dann Statusdaten invalidieren if ( pView->IsExpanded( pParent ) ) { - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; pView->nVisibleCount = 0; } #ifdef CHECK_INTEGRITY @@ -1380,7 +1380,7 @@ void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry ) if ( pView->IsExpanded(pParent) ) { pView->nVisibleCount = 0; - pView->bVisPositionsValid = FALSE; + pView->bVisPositionsValid = sal_False; } #ifdef CHECK_INTEGRITY CheckIntegrity(); @@ -1398,14 +1398,14 @@ CheckIntegrity(); |* *************************************************************************/ -BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) +sal_Bool SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, sal_Bool bSelect ) { DBG_ASSERT(pView&&pEntry,"Select:View/Entry?"); SvViewData* pViewData = pView->GetViewData( pEntry ); if ( bSelect ) { if ( pViewData->IsSelected() || !pViewData->IsSelectable() ) - return FALSE; + return sal_False; else { pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED; @@ -1415,7 +1415,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) else { if ( !pViewData->IsSelected() ) - return FALSE; + return sal_False; else { pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED ); @@ -1425,7 +1425,7 @@ BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect ) #ifdef CHECK_INTEGRITY CheckIntegrity(); #endif - return TRUE; + return sal_True; } /************************************************************************* @@ -1437,7 +1437,7 @@ CheckIntegrity(); |* Letzte Aenderung 05.04.01 |* *************************************************************************/ -BOOL SvTreeList::Remove( SvListEntry* pEntry ) +sal_Bool SvTreeList::Remove( SvListEntry* pEntry ) { DBG_ASSERT(pEntry,"Cannot remove root, use clear"); @@ -1448,22 +1448,22 @@ BOOL SvTreeList::Remove( SvListEntry* pEntry ) // Explorer aus der View Eintraege, die er nicht in die View // eingefuegt hat. Da sich der Kunde fuer ein platzendes // Office nichts kaufen kann, fange ich diesen Fall ab. - return FALSE; + return sal_False; } Broadcast( LISTACTION_REMOVING, pEntry ); - ULONG nRemoved = 1 + GetChildCount(pEntry); - bAbsPositionsValid = FALSE; + sal_uLong nRemoved = 1 + GetChildCount(pEntry); + bAbsPositionsValid = sal_False; SvListEntry* pParent = pEntry->pParent; SvTreeEntryList* pList = pParent->pChilds; DBG_ASSERT(pList,"Remove:No Childlist"); - BOOL bLastEntry = FALSE; + sal_Bool bLastEntry = sal_False; if ( pEntry->HasChildListPos() ) { - ULONG nListPos = pEntry->GetChildListPos(); - bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE; + sal_uLong nListPos = pEntry->GetChildListPos(); + bLastEntry = (nListPos == (pList->Count()-1) ) ? sal_True : sal_False; pList->Remove( nListPos ); } else @@ -1493,7 +1493,7 @@ CheckIntegrity(); Broadcast( LISTACTION_REMOVED, pEntry ); delete pEntry; // loescht auch alle Childs - return TRUE; + return sal_True; } /************************************************************************* @@ -1506,7 +1506,7 @@ CheckIntegrity(); |* *************************************************************************/ -ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect ) +sal_uLong SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,sal_Bool bSelect ) { DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?"); if ( !pParent->pChilds ) @@ -1514,9 +1514,9 @@ ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSel if ( pParent->pChilds->Count() == 0 ) return 0; - USHORT nRefDepth = GetDepth( pParent ); - USHORT nDepth = nRefDepth; - ULONG nCount = 0; + sal_uInt16 nRefDepth = GetDepth( pParent ); + sal_uInt16 nDepth = nRefDepth; + sal_uLong nCount = 0; pParent = Next( pParent ); do { @@ -1531,7 +1531,7 @@ CheckIntegrity(); return nCount; } -void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect ) +void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect ) { DBG_ASSERT(pView,"SelectAll:NoView"); SvListEntry* pEntry = First(); @@ -1555,7 +1555,7 @@ CheckIntegrity(); } -SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const +SvListEntry* SvTreeList::GetEntryAtAbsPos( sal_uLong nAbsPos ) const { SvListEntry* pEntry = First(); while ( nAbsPos && pEntry ) @@ -1566,7 +1566,7 @@ SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const return pEntry; } -SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const +SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, sal_uLong nVisPos ) const { DBG_ASSERT(pView,"GetEntryAtVisPos:No View"); SvListEntry* pEntry = First(); @@ -1587,7 +1587,7 @@ void SvTreeList::SetListPositions( SvTreeEntryList* pList ) pEntry->pParent->InvalidateChildrensListPositions(); } /* - ULONG nListPos = 0; + sal_uLong nListPos = 0; SvListEntry* pEntry = (SvListEntry*)(pList->First()); while( pEntry ) { @@ -1604,13 +1604,13 @@ void SvTreeList::InvalidateEntry( SvListEntry* pEntry ) Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry ); } -BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const +sal_Bool SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const { if ( !pParent ) pParent = pRootItem; - BOOL bIsChild = FALSE; + sal_Bool bIsChild = sal_False; if ( pParent->pChilds ) - bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); + bIsChild = (sal_Bool)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND); return bIsChild; } @@ -1618,7 +1618,7 @@ BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const void lcl_CheckList( SvTreeEntryList* pList ) { SvListEntry* pEntry = (SvListEntry*)(pList->First()); - ULONG nPos = 0; + sal_uLong nPos = 0; while ( pEntry ) { DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos"); @@ -1629,7 +1629,7 @@ void lcl_CheckList( SvTreeEntryList* pList ) void SvTreeList::CheckIntegrity() const { - ULONG nMyEntryCount = 0; + sal_uLong nMyEntryCount = 0; if ( pRootItem->pChilds ) { lcl_CheckList( pRootItem->pChilds ); @@ -1680,7 +1680,7 @@ SvListView::SvListView( SvTreeList* pModell ) pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; SetModel( pModell ); } @@ -1690,7 +1690,7 @@ SvListView::SvListView() pModel = 0; nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } @@ -1724,7 +1724,7 @@ void SvListView::InitTable() pEntry = pModel->pRootItem; pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); // Jetzt alle anderen Entries pEntry = pModel->First(); while( pEntry ) @@ -1732,7 +1732,7 @@ void SvListView::InitTable() pViewData = CreateViewData( pEntry ); DBG_ASSERT(pViewData,"InitTable:No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); pEntry = pModel->Next( pEntry ); } } @@ -1760,25 +1760,25 @@ void SvListView::Clear() ClearTable(); nSelectionCount = 0; nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; if( pModel ) { // RootEntry einfuegen SvListEntry* pEntry = pModel->pRootItem; SvViewData* pViewData = new SvViewData; pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED; - aDataTable.Insert( (ULONG)pEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pEntry, pViewData ); } } void SvListView::SetModel( SvTreeList* pNewModel ) { DBG_CHKTHIS(SvListView,0); - BOOL bBroadcastCleared = FALSE; + sal_Bool bBroadcastCleared = sal_False; if ( pModel ) { pModel->RemoveView( this ); - bBroadcastCleared = TRUE; + bBroadcastCleared = sal_True; ModelNotification( LISTACTION_CLEARING,0,0,0 ); if ( pModel->GetRefCount() == 0 ) delete pModel; @@ -1807,7 +1807,7 @@ void SvListView::ModelHasInsertedTree( SvListEntry* ) } void SvListView::ModelIsMoving( SvListEntry* /* pSource */ , - SvListEntry* /* pTargetParent */ , ULONG /* nPos */ ) + SvListEntry* /* pTargetParent */ , sal_uLong /* nPos */ ) { DBG_CHKTHIS(SvListView,0); } @@ -1833,28 +1833,28 @@ void SvListView::ModelHasEntryInvalidated( SvListEntry*) DBG_CHKTHIS(SvListView,0); } -void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,ULONG) +void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry*,sal_uLong) { DBG_CHKTHIS(SvListView,0); SvListEntry* pParent = pEntry->pParent; DBG_ASSERT(pParent,"Model not consistent"); if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent ); + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pParent ); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } // vorlaeufig nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionMoved( SvListEntry* /* pEntry */ , SvListEntry* /* pTargetPrnt */ , - ULONG /* nChildPos */ ) + sal_uLong /* nChildPos */ ) { DBG_CHKTHIS(SvListView,0); nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } void SvListView::ActionInserted( SvListEntry* pEntry ) @@ -1864,14 +1864,14 @@ void SvListView::ActionInserted( SvListEntry* pEntry ) SvViewData* pData = CreateViewData( pEntry ); InitViewData( pData, pEntry ); #ifdef DBG_UTIL - BOOL bSuccess = + sal_Bool bSuccess = #endif - aDataTable.Insert( (ULONG)pEntry, pData ); + aDataTable.Insert( (sal_uLong)pEntry, pData ); DBG_ASSERT(bSuccess,"Entry already in View"); if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } } @@ -1881,18 +1881,18 @@ void SvListView::ActionInsertedTree( SvListEntry* pEntry ) if ( pModel->IsEntryVisible( this, pEntry )) { nVisibleCount = 0; - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; } // ueber Entry und seine Childs iterieren SvListEntry* pCurEntry = pEntry; - USHORT nRefDepth = pModel->GetDepth( pCurEntry ); + sal_uInt16 nRefDepth = pModel->GetDepth( pCurEntry ); while( pCurEntry ) { - DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table"); + DBG_ASSERT(aDataTable.Get((sal_uLong)pCurEntry)==0,"Entry already in Table"); SvViewData* pViewData = CreateViewData( pCurEntry ); DBG_ASSERT(pViewData,"No ViewData"); InitViewData( pViewData, pEntry ); - aDataTable.Insert( (ULONG)pCurEntry, pViewData ); + aDataTable.Insert( (sal_uLong)pCurEntry, pViewData ); pCurEntry = pModel->Next( pCurEntry ); if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth) pCurEntry = 0; @@ -1907,9 +1907,9 @@ void SvListView::RemoveViewData( SvListEntry* pParent ) SvListEntry* pCur = (SvListEntry*)pChilds->First(); while( pCur ) { - SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur); + SvViewData* pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCur); delete pViewData; - aDataTable.Remove( (ULONG)pCur ); + aDataTable.Remove( (sal_uLong)pCur ); if( pCur->HasChilds()) RemoveViewData( pCur ); pCur = (SvListEntry*)pChilds->Next(); @@ -1924,12 +1924,12 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) DBG_CHKTHIS(SvListView,0); DBG_ASSERT(pEntry,"Remove:No Entry"); - SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry ); - ULONG nSelRemoved = 0; + SvViewData* pViewData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry ); + sal_uLong nSelRemoved = 0; if ( pViewData->IsSelected() ) nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry ); nSelectionCount -= nSelRemoved; - ULONG nVisibleRemoved = 0; + sal_uLong nVisibleRemoved = 0; if ( pModel->IsEntryVisible( this, pEntry ) ) nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry ); if( nVisibleCount ) @@ -1942,18 +1942,18 @@ void SvListView::ActionRemoving( SvListEntry* pEntry ) #endif nVisibleCount -= nVisibleRemoved; } - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; - pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pEntry); delete pViewData; - aDataTable.Remove( (ULONG)pEntry ); + aDataTable.Remove( (sal_uLong)pEntry ); RemoveViewData( pEntry ); SvListEntry* pCurEntry = pEntry->pParent; if ( pCurEntry && pCurEntry != pModel->pRootItem && pCurEntry->pChilds->Count() == 1 ) { - pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry); + pViewData = (SvViewData*)aDataTable.Get((sal_uLong)pCurEntry); pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED); } } @@ -1969,8 +1969,8 @@ void SvListView::ActionClear() Clear(); } -void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, ULONG nPos ) +void SvListView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, + SvListEntry* pEntry2, sal_uLong nPos ) { DBG_CHKTHIS(SvListView,0); switch( nActionId ) @@ -2010,7 +2010,7 @@ void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, ModelHasEntryInvalidated( pEntry1 ); break; case LISTACTION_RESORTED: - bVisPositionsValid = FALSE; + bVisPositionsValid = sal_False; break; case LISTACTION_RESORTING: break; @@ -2038,7 +2038,7 @@ StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) cons void SvTreeList::Resort() { Broadcast( LISTACTION_RESORTING ); - bAbsPositionsValid = FALSE; + bAbsPositionsValid = sal_False; ResortChilds( pRootItem ); Broadcast( LISTACTION_RESORTED ); } @@ -2052,11 +2052,11 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) List aList( *pChildList ); pChildList->Clear(); - ULONG nCount = aList.Count(); - for( ULONG nCur = 0; nCur < nCount; nCur++ ) + sal_uLong nCount = aList.Count(); + for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) { SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur ); - ULONG nListPos = LIST_APPEND; + sal_uLong nListPos = LIST_APPEND; GetInsertionPos( pCurEntry, pParent, nListPos ); pChildList->Insert( pCurEntry, nListPos ); if( pCurEntry->pChilds ) @@ -2066,7 +2066,7 @@ void SvTreeList::ResortChilds( SvListEntry* pParent ) } void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent, - ULONG& rPos ) + sal_uLong& rPos ) { DBG_ASSERT(pEntry,"No Entry"); |