[Libreoffice-commits] .: 4 commits - svl/inc svl/source

Fridrich Strba fridrich at kemper.freedesktop.org
Fri May 6 02:01:23 PDT 2011


 svl/inc/svl/svdde.hxx       |   19 ++----
 svl/source/svdde/ddecli.cxx |   55 ++++++++----------
 svl/source/svdde/ddeimp.hxx |    4 -
 svl/source/svdde/ddesvr.cxx |  128 +++++++++++++++++++++++---------------------
 4 files changed, 102 insertions(+), 104 deletions(-)

New commits:
commit 7e04eab31eeeb7cb7f493ad0392162cfb26aa0fe
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Apr 27 18:24:59 2011 -0430

    Remove DECLARE_LIST(DdeTransactions,DdeTransaction*).

diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index 83aba8c..d739c51 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -60,7 +60,6 @@ DECLARE_LIST( DdeServices, DdeService* )
 typedef List DdeServices;
 #endif
 
-DECLARE_LIST( DdeTransactions, DdeTransaction* )
 typedef ::std::vector< long > DdeFormats;
 typedef ::std::vector< Conversation* > ConvList;
 
@@ -226,7 +225,7 @@ class SVL_DLLPUBLIC DdeConnection
 {
     friend class    DdeInternal;
     friend class    DdeTransaction;
-    DdeTransactions aTransactions;
+    std::vector<DdeTransaction*> aTransactions;
     DdeString*      pService;
     DdeString*      pTopic;
     DdeImp*         pImp;
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index 920a0cf..2de79f5 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -85,18 +85,18 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
 
     if( self )
     {
-        DdeTransaction* t;
         sal_Bool bFound = sal_False;
-        for( t = self->aTransactions.First(); t; t = self->aTransactions.Next() )
+        std::vector<DdeTransaction*> iter;
+        for( iter = self->aTransactions.begin(); iter != self->aTransactions.end(); ++iter )
         {
             switch( nCode )
             {
                 case XTYP_XACT_COMPLETE:
-                    if( (DWORD)t->nId == nInfo1 )
+                    if( (DWORD)iter->nId == nInfo1 )
                     {
-                        nCode = t->nType & (XCLASS_MASK | XTYP_MASK);
-                        t->bBusy = sal_False;
-                        t->Done( 0 != hData );
+                        nCode = iter->nType & (XCLASS_MASK | XTYP_MASK);
+                        iter->bBusy = sal_False;
+                        iter->Done( 0 != hData );
                         bFound = sal_True;
                     }
                     break;
@@ -106,27 +106,27 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
                     self->pImp->nStatus = self->pImp->hConv
                                     ? DMLERR_NO_ERROR
                                     : DdeGetLastError( pInst->hDdeInstCli );
-                    t = 0;
+                    iter = self->aTransactions.end();
                     nRet = 0;
                     bFound = sal_True;
                     break;
 
                 case XTYP_ADVDATA:
-                    bFound = sal_Bool( *t->pName == hText2 );
+                    bFound = sal_Bool( *iter->pName == hText2 );
                     break;
             }
             if( bFound )
                 break;
         }
 
-        if( t )
+        if( iter != self->aTransactions.end() )
         {
             switch( nCode )
             {
             case XTYP_ADVDATA:
                 if( !hData )
                 {
-                    ((DdeLink*) t)->Notify();
+                    static_cast<DdeLink*>(*iter)->Notify();
                     nRet = (HDDEDATA)DDE_FACK;
                     break;
                 }
@@ -142,7 +142,7 @@ HDDEDATA CALLBACK DdeInternal::CliCallback(
                 d.pImp->hData = hData;
                 d.pImp->nFmt  = DdeData::GetInternalFormat( nCbType );
                 d.Lock();
-                t->Data( &d );
+                iter->Data( &d );
                 nRet = (HDDEDATA)DDE_FACK;
                 break;
             }
@@ -279,7 +279,7 @@ DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName,
     nType = 0;
     bBusy = sal_False;
 
-    rDde.aTransactions.Insert( this );
+    rDde.aTransactions.push_back( this );
 }
 
 // --- DdeTransaction::~DdeTransaction() ---------------------------
@@ -293,7 +293,8 @@ DdeTransaction::~DdeTransaction()
     }
 
     delete pName;
-    rDde.aTransactions.Remove( this );
+    rDde.aTransactions.erase(std::remove(rDde.aTransactions.begin(),
+                                         rDde.aTransactions.end(),this));
 }
 
 // --- DdeTransaction::Execute() -----------------------------------
commit 444d3fe7620ef6b18507190dd321dad436279a2e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Apr 27 17:45:35 2011 -0430

    Remove DECLARE_LIST(DdeItems,DdeItem*).

diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index a83add1..83aba8c 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -56,10 +56,8 @@ struct Conversation;
 
 #ifndef _SVDDE_NOLISTS
 DECLARE_LIST( DdeServices, DdeService* )
-DECLARE_LIST( DdeItems, DdeItem* )
 #else
 typedef List DdeServices;
-typedef List DdeItems;
 #endif
 
 DECLARE_LIST( DdeTransactions, DdeTransaction* )
@@ -327,7 +325,7 @@ private:
 private:
     DdeString*      pName;
     String          aItem;
-    DdeItems        aItems;
+    std::vector<DdeItem*> aItems;
     Link            aConnectLink;
     Link            aDisconnectLink;
     Link            aGetLink;
@@ -359,7 +357,7 @@ public:
     DdeItem*        AddItem( const DdeItem& );  // werden kopiert !
     void            RemoveItem( const DdeItem& );
     const String&   GetCurItem() { return aItem;  }
-    const DdeItems& GetItems()   { return aItems; }
+    const std::vector<DdeItem*>& GetItems() const  { return aItems; }
 
 private:
                     DdeTopic( const DdeTopic& );
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index e75fdc6..7b44121 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -55,7 +55,6 @@
 class DdeService;
 class DdeTopic;
 class DdeItem;
-class DdeItems;
 
 // ----------------
 // - Conversation -
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 1d68298..0be6a90 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -330,25 +330,34 @@ found:
                 if( !pItem->pImpData && pTopic->StartAdviseLoop() )
                 {
                     // dann wurde das Item ausgewechselt
-                    pTopic->aItems.Remove( pItem );
-                    DdeItem* pTmp;
-                    for(  pTmp = pTopic->aItems.First(); pTmp;
-                                    pTmp = pTopic->aItems.Next() )
-                        if( *pTmp->pName == hText2 )
+                    pTopic->aItems.erase(std::remove(pTopic->aItems.begin(),
+                                                     pTopic->aItems.end(),
+                                                     pItem));
+
+                    std::vector<DdeItem*> iter;
+                    for(  iter = pTopic->aItems.begin(); iter != pTopic->aItems.end(); ++iter )
+                    {
+                        if( *iter->pName == hText2 )
                         {
                             // es wurde tatsaechlich ausgewechselt
                             delete pItem;
                             pItem = 0;
                             break;
                         }
+                    }
+
                     if( pItem )
                         // es wurde doch nicht ausgewechselt, also wieder rein
-                        pTopic->aItems.Insert( pItem );
+                        pTopic->aItems.push_back(pItem);
                     else
-                        pItem = pTmp;
+                        pItem = iter != pTopic->aItems.end() ? *iter : NULL;
+                }
+
+                if (pItem)
+                {
+                    pItem->IncMonitor( (long)hConv );
+                    pInst->hCurConvSvr = NULL;
                 }
-                pItem->IncMonitor( (long)hConv );
-                pInst->hCurConvSvr = NULL;
             }
             return (HDDEDATA)sal_True;
 
@@ -434,17 +443,17 @@ DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic )
 
 DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem )
 {
-    DdeItem* s;
-    DdeItems& rItems = rTopic.aItems;
+    std::vector<DdeItem>::iterator iter;
+    std::vector<DdeItem*> &rItems = rTopic.aItems;
     DdeInstData* pInst = ImpGetInstData();
     DBG_ASSERT(pInst,"SVDDE:No instance data");
     int bWeiter = sal_False;
 
     do {            // middle check loop
 
-        for ( s = rItems.First(); s; s = rItems.Next() )
-            if ( *s->pName == hItem )
-                return s;
+        for ( iter = rItems.begin(); iter != rItems.end(); ++iter )
+            if ( *iter->pName == hItem )
+                return *iter;
 
         bWeiter = !bWeiter;
         if( !bWeiter )
@@ -644,13 +653,13 @@ DdeTopic::DdeTopic( const String& rName )
 
 DdeTopic::~DdeTopic()
 {
-    DdeItem* t;
-    while( ( t = aItems.First() ) != NULL )
+    std::vector<DdeItem*>::iterator iter;
+    for (iter = aItems.begin(); iter != aItems.end(); ++iter)
     {
-        aItems.Remove( t );
-        t->pMyTopic = 0;
-        delete t;
+        iter->pMyTopic = 0;
+        delete *iter;
     }
+
     delete pName;
 }
 
@@ -679,7 +688,7 @@ DdeItem* DdeTopic::AddItem( const DdeItem& r )
         s = new DdeItem( r );
     if ( s )
     {
-        aItems.Insert( s );
+        aItems.push_back( s );
         s->pMyTopic = this;
     }
     return s;
@@ -691,7 +700,7 @@ void DdeTopic::InsertItem( DdeItem* pNew )
 {
     if( pNew )
     {
-        aItems.Insert( pNew );
+        aItems.push_back( pNew );
         pNew->pMyTopic = this;
     }
 }
@@ -700,18 +709,18 @@ void DdeTopic::InsertItem( DdeItem* pNew )
 
 void DdeTopic::RemoveItem( const DdeItem& r )
 {
-    DdeItem* s;
-    for ( s = aItems.First(); s; s = aItems.Next() )
+    std::vector<DdeItem*>::iterator iter;
+    for (iter = aItems.begin(); iter != aItems.end(); ++iter)
     {
-        if ( !DdeCmpStringHandles (*s->pName, *r.pName ) )
+        if ( !DdeCmpStringHandles (*iter->pName, *r.pName ) )
             break;
     }
 
-    if ( s )
+    if ( iter != aItems.end() )
     {
-        aItems.Remove( s );
-        s->pMyTopic = 0;
-        delete s;
+        iter->pMyTopic = 0;
+        delete *iter;
+        aItems.erase(iter);
     }
 }
 
@@ -719,17 +728,16 @@ void DdeTopic::RemoveItem( const DdeItem& r )
 
 void DdeTopic::NotifyClient( const String& rItem )
 {
-    DdeItem* pItem;
+    std::vector<DdeItem*>::iterator iter;
     DdeInstData* pInst = ImpGetInstData();
     DBG_ASSERT(pInst,"SVDDE:No instance data");
-    for ( pItem = aItems.First(); pItem; pItem = aItems.Next() )
+    for ( iter = aItems.begin(); iter != aItems.end(); ++iter)
     {
-        if ( pItem->GetName() == rItem )
+        if ( iter->GetName() == rItem && iter->pImpData)
         {
-            if ( pItem->pImpData )
-                DdePostAdvise( pInst->hDdeInstSvr, *pName, *pItem->pName );
+            DdePostAdvise( pInst->hDdeInstSvr, *pName, *iter->pName );
+            break;
         }
-        break;
     }
 }
 
@@ -751,8 +759,9 @@ void DdeTopic::Disconnect( long nId )
 
 void DdeTopic::_Disconnect( long nId )
 {
-    for( DdeItem* pItem = aItems.First(); pItem; pItem = aItems.Next() )
-        pItem->DecMonitor( nId );
+    std::vector<DdeItem*>::iterator iter;
+    for (iter = aItems.begin(); iter != aItems.end(); ++iter)
+        iter->DecMonitor( nId );
 
     Disconnect( nId );
 }
@@ -851,7 +860,8 @@ DdeItem::DdeItem( const DdeItem& r)
 DdeItem::~DdeItem()
 {
     if( pMyTopic )
-        pMyTopic->aItems.Remove( this );
+        pMyTopic->aItems.erase(std::remove(pMyTopic->aItems.begin(),
+                                           pMyTopic->aItems.end(),this));
     delete pName;
     delete pImpData;
 }
@@ -987,17 +997,17 @@ String DdeService::SysItems()
 {
     String s;
     std::vector<DdeTopic*>::iterator iter;
+    std::vector<DdeItem*>::iterator iterItem;
     for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter )
     {
         if ( iter->GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) )
         {
             short n = 0;
-            DdeItem* pi;
-            for ( pi = iter->aItems.First(); pi; pi = iter->aItems.Next(), n++ )
+            for ( iterItem = iter->aItems.begin(); iterItem != iter->aItems.end(); ++iterItem, n++ )
             {
                 if ( n )
                     s += '\t';
-                s += pi->GetName();
+                s += iterItem->GetName();
             }
             s += String::CreateFromAscii("\r\n");
         }
commit 01902c42e71fac21c2b4108baea48edb6eb107f0
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Apr 27 16:54:28 2011 -0430

    Remove DECLARE_LIST(DdeTopics,DdeTopic*)

diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index 033f211..a83add1 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -56,11 +56,9 @@ struct Conversation;
 
 #ifndef _SVDDE_NOLISTS
 DECLARE_LIST( DdeServices, DdeService* )
-DECLARE_LIST( DdeTopics, DdeTopic* )
 DECLARE_LIST( DdeItems, DdeItem* )
 #else
 typedef List DdeServices;
-typedef List DdeTopics;
 typedef List DdeItems;
 #endif
 
@@ -392,7 +390,7 @@ protected:
 
     const DdeTopic* GetSysTopic() const { return pSysTopic; }
 private:
-    DdeTopics       aTopics;
+    std::vector<DdeTopic*> aTopics;
     DdeFormats      aFormats;
     DdeTopic*       pSysTopic;
     DdeString*      pName;
@@ -409,7 +407,7 @@ public:
     short           GetError()              { return nStatus; }
 
     static DdeServices& GetServices();
-    DdeTopics&      GetTopics()             { return aTopics; }
+    std::vector<DdeTopic*>& GetTopics() { return aTopics; }
 
     void            AddTopic( const DdeTopic& );
     void            RemoveTopic( const DdeTopic& );
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index 0227453..e75fdc6 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -55,7 +55,6 @@
 class DdeService;
 class DdeTopic;
 class DdeItem;
-class DdeTopics;
 class DdeItems;
 
 // ----------------
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index ccc8171..1d68298 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -121,10 +121,10 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
             {
                 if ( !hText2 || ( *pService->pName == hText2 ) )
                 {
-                    for( pTopic = pService->aTopics.First(); pTopic;
-                         pTopic = pService->aTopics.Next() )
+                    std::vector<DdeTopic*>::const_iterator iter;
+                    for (iter = pService->aTopics.begin(); iter != pService->aTopics.end(); ++iter)
                     {
-                        if ( !hText1 || (*pTopic->pName == hText1) )
+                        if ( !hText1 || iter->pName == hText1 )
                             nTopics++;
                     }
                 }
@@ -403,17 +403,17 @@ DdeService* DdeInternal::FindService( HSZ hService )
 
 DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic )
 {
-    DdeTopic* s;
-    DdeTopics& rTopics = rService.aTopics;
+    std::vector<DdeTopic*>::iterator iter;
+    std::vector<DdeTopic*> &rTopics = rService.aTopics;
     int bWeiter = sal_False;
     DdeInstData* pInst = ImpGetInstData();
     DBG_ASSERT(pInst,"SVDDE:No instance data");
 
     do {            // middle check loop
-        for ( s = rTopics.First(); s; s = rTopics.Next() )
+        for ( iter = rTopics.begin(); iter != rTopics.end(); ++iter )
         {
-            if ( *s->pName == hTopic )
-                return s;
+            if ( iter->pName == hTopic )
+                return *iter;
         }
 
         bWeiter = !bWeiter;
@@ -559,19 +559,19 @@ DdeServices& DdeService::GetServices()
 void DdeService::AddTopic( const DdeTopic& rTopic )
 {
     RemoveTopic( rTopic );
-    aTopics.Insert( (DdeTopic*) &rTopic );
+    aTopics.push_back(&rTopic);
 }
 
 // --- DdeService::RemoveTopic() -----------------------------------
 
 void DdeService::RemoveTopic( const DdeTopic& rTopic )
 {
-    DdeTopic* t;
-    for ( t = aTopics.First(); t; t = aTopics.Next() )
+    std::vector<DdeTopic*>::iterator iter;
+    for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter )
     {
-        if ( !DdeCmpStringHandles (*t->pName, *rTopic.pName ) )
+        if ( !DdeCmpStringHandles (*iter->pName, *rTopic.pName ) )
         {
-            aTopics.Remove( t );
+            aTopics.erase(iter);
             // JP 27.07.95: und alle Conversions loeschen !!!
             //              (sonst wird auf geloeschten Topics gearbeitet!!)
             for( size_t n = pConv->size(); n; )
@@ -986,14 +986,14 @@ void DdeGetPutItem::AdviseLoop( sal_Bool )
 String DdeService::SysItems()
 {
     String s;
-    DdeTopic* t;
-    for ( t = aTopics.First(); t; t = aTopics.Next() )
+    std::vector<DdeTopic*>::iterator iter;
+    for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter )
     {
-        if ( t->GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) )
+        if ( iter->GetName() == reinterpret_cast<const sal_Unicode*>(SZDDESYS_TOPIC) )
         {
             short n = 0;
             DdeItem* pi;
-            for ( pi = t->aItems.First(); pi; pi = t->aItems.Next(), n++ )
+            for ( pi = iter->aItems.First(); pi; pi = iter->aItems.Next(), n++ )
             {
                 if ( n )
                     s += '\t';
@@ -1011,14 +1011,14 @@ String DdeService::SysItems()
 String DdeService::Topics()
 {
     String      s;
-    DdeTopic*   t;
+    std::vector<DdeTopic*>::iterator iter;
     short       n = 0;
 
-    for ( t = aTopics.First(); t; t = aTopics.Next(), n++ )
+    for ( iter = aTopics.begin(); iter != aTopics.end(); ++iter, n++ )
     {
         if ( n )
             s += '\t';
-        s += t->GetName();
+        s += iter->GetName();
     }
     s += String::CreateFromAscii("\r\n");
 
commit 9e54f9fddf0cb05829ac739124646c54d3012be6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Apr 27 12:04:23 2011 -0430

    Remove DECLARE_LIST(DdeConnections,DdeConnection*)

diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index 5cd1b97..033f211 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 3c2948f..920a0cf 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 fea2322..0227453 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;


More information about the Libreoffice-commits mailing list