From 0f48d891f2a5759f0c005b873e4eab3a3f54a7d5 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Thu, 17 Feb 2011 08:34:25 -0800 Subject: Remove DECLARE_LIST( ImplMoreWindowList, Window* ) --- vcl/source/control/morebtn.cxx | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'vcl/source/control/morebtn.cxx') 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 #include - - +#include // ======================================================================= -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; + } + } + } } // ----------------------------------------------------------------------- -- cgit