diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-02-02 20:41:45 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-02-02 20:41:45 -0800 |
commit | 0e3fe1771329cf21da4bd7cd15660ae079607718 (patch) | |
tree | 486045d0faefad280eb046d52913b477fddc7740 /svtools/source | |
parent | 74a67b2c88e0f939840149ca71d12e3bb8b55d0c (diff) |
Remove DECLARE_LIST( RectangleList, Rectangle* )
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 11 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 34 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 4 |
3 files changed, 24 insertions, 25 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 21f51de760bc..e7c3c2b1b0bf 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -365,20 +365,21 @@ void BrowseBox::ToggleSelection( BOOL bForce ) Rectangle aAddRect( Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ), Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) ); - if ( aHighlightList.Count() && nLastRowInRect == ( nRow - 1 ) ) - aHighlightList.First()->Union( aAddRect ); + if ( aHighlightList.size() && nLastRowInRect == ( nRow - 1 ) ) + aHighlightList[ 0 ]->Union( aAddRect ); else - aHighlightList.Insert( new Rectangle( aAddRect ), (ULONG) 0 ); + aHighlightList.insert( aHighlightList.begin(), new Rectangle( aAddRect ) ); nLastRowInRect = nRow; } // unhighlight the old selection (if any) - while ( aHighlightList.Count() ) + for ( size_t i = aHighlightList.size(); i > 0; ) { - Rectangle *pRect = aHighlightList.Remove( aHighlightList.Count() - 1 ); + Rectangle *pRect = aHighlightList[ --i ]; pDataWin->Invalidate( *pRect ); delete pRect; } + aHighlightList.clear(); // unhighlight old column selection (if any) for ( long nColId = pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION; diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index 6db9ee471ced..be3ae263d34f 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -232,6 +232,10 @@ BrowserDataWin::~BrowserDataWin() { if( pDtorNotify ) *pDtorNotify = TRUE; + + for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i ) + delete aInvalidRegion[ i ]; + aInvalidRegion.clear(); } //------------------------------------------------------------------- @@ -315,7 +319,7 @@ void BrowserDataWin::Paint( const Rectangle& rRect ) { if ( bInPaint ) { - aInvalidRegion.Insert( new Rectangle( rRect ) ); + aInvalidRegion.push_back( new Rectangle( rRect ) ); return; } bInPaint = TRUE; @@ -324,7 +328,7 @@ void BrowserDataWin::Paint( const Rectangle& rRect ) DoOutstandingInvalidations(); } else - aInvalidRegion.Insert( new Rectangle( rRect ) ); + aInvalidRegion.push_back( new Rectangle( rRect ) ); } //------------------------------------------------------------------- @@ -685,8 +689,7 @@ BrowserExecuteDropEvent::BrowserExecuteDropEvent( BrowserDataWin *pWindow, const void BrowserDataWin::SetUpdateMode( BOOL bMode ) { - DBG_ASSERT( !bUpdateMode || aInvalidRegion.Count() == 0, - "invalid region not empty" ); + DBG_ASSERT( !bUpdateMode || aInvalidRegion.empty(), "invalid region not empty" ); if ( bMode == bUpdateMode ) return; @@ -698,14 +701,11 @@ void BrowserDataWin::SetUpdateMode( BOOL bMode ) //------------------------------------------------------------------- void BrowserDataWin::DoOutstandingInvalidations() { - for ( Rectangle* pRect = aInvalidRegion.First(); - pRect; - pRect = aInvalidRegion.Next() ) - { - Control::Invalidate( *pRect ); - delete pRect; + for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i ) { + Control::Invalidate( *aInvalidRegion[ i ] ); + delete aInvalidRegion[ i ]; } - aInvalidRegion.Clear(); + aInvalidRegion.clear(); } //------------------------------------------------------------------- @@ -714,12 +714,10 @@ void BrowserDataWin::Invalidate( USHORT nFlags ) { if ( !GetUpdateMode() ) { - for ( Rectangle* pRect = aInvalidRegion.First(); - pRect; - pRect = aInvalidRegion.Next() ) - delete pRect; - aInvalidRegion.Clear(); - aInvalidRegion.Insert( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); + for ( size_t i = 0, n = aInvalidRegion.size(); i < n; ++i ) + delete aInvalidRegion[ i ]; + aInvalidRegion.clear(); + aInvalidRegion.push_back( new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); } else Window::Invalidate( nFlags ); @@ -730,7 +728,7 @@ void BrowserDataWin::Invalidate( USHORT nFlags ) void BrowserDataWin::Invalidate( const Rectangle& rRect, USHORT nFlags ) { if ( !GetUpdateMode() ) - aInvalidRegion.Insert( new Rectangle( rRect ) ); + aInvalidRegion.push_back( new Rectangle( rRect ) ); else Window::Invalidate( rRect, nFlags ); } diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index 006ebe8a1433..770e359c15f6 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -33,15 +33,15 @@ #include <svtools/brwhead.hxx> #include <vcl/timer.hxx> #include <vcl/image.hxx> -#include <tools/list.hxx> #include <svtools/transfer.hxx> +#include <vector> //=================================================================== #define MIN_COLUMNWIDTH 2 #define DRAG_CRITICAL 4 -DECLARE_LIST( RectangleList, Rectangle* ) +typedef ::std::vector< Rectangle* > RectangleList; //=================================================================== |