[Libreoffice-commits] .: sfx2/source

Michael Stahl mst at kemper.freedesktop.org
Fri Jun 8 15:35:00 PDT 2012


 sfx2/source/appl/appdde.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit f4ac2ffd9e0854a767f15ed38eab947cb16e66ad
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat Jun 9 00:31:29 2012 +0200

    fix WNT only SfxApplication::AddDdeTopic
    
    Change-Id: Ifa5f845817178f7ec3608670c65c71e8c0a717cd

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index e6d3706..10d5b19 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -577,7 +577,8 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
     // prevent double submit
     String sShellNm;
     sal_Bool bFnd = sal_False;
-    for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; )
+    for (size_t n = pAppData_Impl->pDocTopics->size(); n;)
+    {
         if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh )
         {
             // If the document is untitled, is still a new Topic is created!
@@ -590,10 +591,10 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
             if( sShellNm == sNm.ToLowerAscii() )
                 return ;
         }
+    }
 
     const SfxDdeDocTopic_Impl* pTopic = new SfxDdeDocTopic_Impl( pSh );
-    pAppData_Impl->pDocTopics->Insert( pTopic,
-                                       pAppData_Impl->pDocTopics->Count() );
+    pAppData_Impl->pDocTopics->push_back(pTopic);
     pAppData_Impl->pDdeService->AddTopic( *pTopic );
 }
 #endif
@@ -606,13 +607,16 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh )
         return;
 
     SfxDdeDocTopic_Impl* pTopic;
-    for( sal_uInt16 n = pAppData_Impl->pDocTopics->size(); n; )
-        if( ( pTopic = (*pAppData_Impl->pDocTopics)[ --n ])->pSh == pSh )
+    for (size_t n = pAppData_Impl->pDocTopics->size(); n; )
+    {
+        pTopic = (*pAppData_Impl->pDocTopics)[ --n ];
+        if (pTopic->pSh == pSh)
         {
             pAppData_Impl->pDdeService->RemoveTopic( *pTopic );
             delete pTopic;
             pAppData_Impl->pDocTopics->erase( pAppData_Impl->pDocTopics->begin() + n );
         }
+    }
 }
 
 const DdeService* SfxApplication::GetDdeService() const


More information about the Libreoffice-commits mailing list