diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-02-17 08:34:25 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-02-17 08:35:29 -0800 |
commit | 0f48d891f2a5759f0c005b873e4eab3a3f54a7d5 (patch) | |
tree | 050f7fbeacd49afcaef4f281700e5aa7a8f51696 /vcl/source/control/morebtn.cxx | |
parent | d008b8a6064fc28b63ec2c583a0d9d75e5b50f71 (diff) |
Remove DECLARE_LIST( ImplMoreWindowList, Window* )
Diffstat (limited to 'vcl/source/control/morebtn.cxx')
-rw-r--r-- | vcl/source/control/morebtn.cxx | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index c00ab079d9ca..5d1fbc9c466b 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -31,12 +31,11 @@ #include <vcl/morebtn.hxx> #include <tools/rc.h> - - +#include <vector> // ======================================================================= -DECLARE_LIST( ImplMoreWindowList, Window* ) +typedef ::std::vector< Window* > ImplMoreWindowList; struct ImplMoreButtonData { @@ -149,7 +148,6 @@ void MoreButton::Click() { Window* pParent = GetParent(); Size aSize( pParent->GetSizePixel() ); - Window* pWindow = (mpMBData->mpItemList) ? mpMBData->mpItemList->First() : NULL; long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height(); // Status aendern @@ -164,10 +162,10 @@ void MoreButton::Click() if ( mbState ) { // Fenster anzeigen - while ( pWindow ) - { - pWindow->Show(); - pWindow = mpMBData->mpItemList->Next(); + if ( mpMBData->mpItemList ) { + for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) { + (*mpMBData->mpItemList)[ i ]->Show(); + } } // Dialogbox anpassen @@ -194,10 +192,10 @@ void MoreButton::Click() pParent->SetSizePixel( aSize ); // Fenster nicht mehr anzeigen - while ( pWindow ) - { - pWindow->Hide(); - pWindow = mpMBData->mpItemList->Next(); + if ( mpMBData->mpItemList ) { + for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) { + (*mpMBData->mpItemList)[ i ]->Hide(); + } } } } @@ -207,9 +205,9 @@ void MoreButton::Click() void MoreButton::AddWindow( Window* pWindow ) { if ( !mpMBData->mpItemList ) - mpMBData->mpItemList = new ImplMoreWindowList( 1024, 16, 16 ); + mpMBData->mpItemList = new ImplMoreWindowList(); - mpMBData->mpItemList->Insert( pWindow, LIST_APPEND ); + mpMBData->mpItemList->push_back( pWindow ); if ( mbState ) pWindow->Show(); @@ -221,8 +219,17 @@ void MoreButton::AddWindow( Window* pWindow ) void MoreButton::RemoveWindow( Window* pWindow ) { - if ( mpMBData->mpItemList ) - mpMBData->mpItemList->Remove( pWindow ); + if ( mpMBData->mpItemList ) { + for ( ImplMoreWindowList::iterator it = mpMBData->mpItemList->begin(); + it < mpMBData->mpItemList->end(); + ++it + ) { + if ( *it == pWindow ) { + mpMBData->mpItemList->erase( it ); + break; + } + } + } } // ----------------------------------------------------------------------- |