diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-04-27 12:04:23 -0430 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-05-06 10:16:43 +0200 |
commit | a39d4eae6ddd14a677ce140bf0482cff7331d536 (patch) | |
tree | fd671791114355d243363c2f87cb1d900f912ac7 /svl | |
parent | 2c21aa4638d4bf1b437dc892f44e9ab83764be14 (diff) |
Remove DECLARE_LIST(DdeConnections,DdeConnection*)
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/svdde.hxx | 4 | ||||
-rw-r--r-- | svl/source/svdde/ddecli.cxx | 28 | ||||
-rw-r--r-- | svl/source/svdde/ddeimp.hxx | 2 |
3 files changed, 14 insertions, 20 deletions
diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx index d60ef0094723..80481f2a4eb2 100644 --- a/svl/inc/svl/svdde.hxx +++ b/svl/inc/svl/svdde.hxx @@ -55,12 +55,10 @@ class DdeItemImp; struct Conversation; #ifndef _SVDDE_NOLISTS -DECLARE_LIST( DdeConnections, DdeConnection* ) DECLARE_LIST( DdeServices, DdeService* ) DECLARE_LIST( DdeTopics, DdeTopic* ) DECLARE_LIST( DdeItems, DdeItem* ) #else -typedef List DdeConnections; typedef List DdeServices; typedef List DdeTopics; typedef List DdeItems; @@ -244,7 +242,7 @@ public: long GetError(); long GetConvId(); - static const DdeConnections& GetConnections(); + static const std::vector<DdeConnection*>& GetConnections(); sal_Bool IsConnected(); diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx index 6e8fe7662e05..329d4e507fa1 100644 --- a/svl/source/svdde/ddecli.cxx +++ b/svl/source/svdde/ddecli.cxx @@ -39,11 +39,6 @@ #include <tools/solarmutex.hxx> #include <osl/mutex.hxx> -// static DWORD hDdeInst = NULL; -// static short nInstance = 0; - -// DdeConnections* DdeConnection::pConnections = NULL; - DdeInstData* ImpInitInstData() { DdeInstData* pData = new DdeInstData; @@ -74,15 +69,19 @@ HDDEDATA CALLBACK DdeInternal::CliCallback( HDDEDATA hData, DWORD nInfo1, DWORD ) { HDDEDATA nRet = DDE_FNOTPROCESSED; - DdeConnections& rAll = (DdeConnections&)DdeConnection::GetConnections(); + const std::vector<DdeConnection*> &rAll = DdeConnection::GetConnections(); DdeConnection* self = 0; DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - for ( self = rAll.First(); self; self = rAll.Next() ) + for ( size_t i = 0; i < rAll.size(); ++i) + { + self = rAll[i]; + if ( self->pImp->hConv == hConv ) break; + } if( self ) { @@ -173,7 +172,6 @@ DdeConnection::DdeConnection( const String& rService, const String& rTopic ) CBF_FAIL_ALLSVRXACTIONS | CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS, 0L ); - pInst->pConnections = new DdeConnections; } pService = new DdeString( pInst->hDdeInstCli, rService ); @@ -186,8 +184,7 @@ DdeConnection::DdeConnection( const String& rService, const String& rTopic ) pImp->nStatus = DdeGetLastError( pInst->hDdeInstCli ); } - if ( pInst->pConnections ) - pInst->pConnections->Insert( this ); + pInst->aConnections.push_back( this ); } // --- DdeConnection::~DdeConnection() ----------------------------- @@ -202,8 +199,9 @@ DdeConnection::~DdeConnection() DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - if ( pInst->pConnections ) - pInst->pConnections->Remove( this ); + + pInst->aConnections.erase(std::remove(pInst->aConnections.begin(), + pInst->aConnections.end(),this)); pInst->nInstanceCli--; pInst->nRefCount--; @@ -212,8 +210,6 @@ DdeConnection::~DdeConnection() if( DdeUninitialize( pInst->hDdeInstCli ) ) { pInst->hDdeInstCli = NULL; - delete pInst->pConnections; - pInst->pConnections = NULL; if( pInst->nRefCount == 0 ) ImpDeinitInstData(); } @@ -263,11 +259,11 @@ long DdeConnection::GetConvId() return (long)pImp->hConv; } -const DdeConnections& DdeConnection::GetConnections() +const std::vector<DdeConnection*>& DdeConnection::GetConnections() { DdeInstData* pInst = ImpGetInstData(); DBG_ASSERT(pInst,"SVDDE:No instance data"); - return *(pInst->pConnections); + return pInst->aConnections; } // --- DdeTransaction::DdeTransaction() ---------------------------- diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx index fb7360b79c61..b462f0bcc616 100644 --- a/svl/source/svdde/ddeimp.hxx +++ b/svl/source/svdde/ddeimp.hxx @@ -143,7 +143,7 @@ class DdeServices; struct DdeInstData { sal_uInt16 nRefCount; - DdeConnections* pConnections; + std::vector<DdeConnection*> aConnections; // Server long hCurConvSvr; DWORD hDdeInstSvr; |