[Libreoffice-commits] .: sc/inc sc/source

Joseph Powers jpowers at kemper.freedesktop.org
Sun May 1 23:39:51 PDT 2011


 sc/inc/chgtrack.hxx                |    4 ++--
 sc/source/core/tool/chgtrack.cxx   |   10 +++++++---
 sc/source/ui/miscdlgs/acredlin.cxx |   15 ++++++++-------
 3 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit ff6b15fddbcdaf374fd3b44362c08353087d2014
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun May 1 23:39:44 2011 -0700

    Remove DECLARE_QUEUE( ScChangeTrackMsgQueue,

diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index 4aae42e..1885074 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -29,12 +29,12 @@
 #ifndef SC_CHGTRACK_HXX
 #define SC_CHGTRACK_HXX
 
+#include <deque>
 
 #include <tools/string.hxx>
 #include <tools/datetime.hxx>
 #include <tools/table.hxx>
 #include <tools/stack.hxx>
-#include <tools/queue.hxx>
 #include <tools/mempool.hxx>
 #include <tools/link.hxx>
 #include <unotools/options.hxx>
@@ -954,7 +954,7 @@ struct ScChangeTrackMsgInfo
 };
 
 // MsgQueue for notification via ModifiedLink
-DECLARE_QUEUE( ScChangeTrackMsgQueue, ScChangeTrackMsgInfo* )
+typedef std::deque<ScChangeTrackMsgInfo*> ScChangeTrackMsgQueue;
 DECLARE_STACK( ScChangeTrackMsgStack, ScChangeTrackMsgInfo* )
 
 enum ScChangeTrackMergeState
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 7a13107..5129bab 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -2146,8 +2146,12 @@ void ScChangeTrack::ClearMsgQueue()
         delete pMsgInfo;
     while ( ( pMsgInfo = aMsgStackFinal.Pop() ) != NULL )
         delete pMsgInfo;
-    while ( ( pMsgInfo = aMsgQueue.Get() ) != NULL )
-        delete pMsgInfo;
+
+    ScChangeTrackMsgQueue::iterator itQueue;
+    for ( itQueue = aMsgQueue.begin(); itQueue != aMsgQueue.end(); ++itQueue)
+        delete *itQueue;
+
+    aMsgQueue.clear();
 }
 
 
@@ -2238,7 +2242,7 @@ void ScChangeTrack::EndBlockModify( sal_uLong nEndAction )
             ScChangeTrackMsgInfo* pMsg;
             while ( ( pMsg = aMsgStackFinal.Pop() ) != NULL )
             {
-                aMsgQueue.Put( pMsg );
+                aMsgQueue.push_back( pMsg );
                 bNew = sal_True;
             }
             if ( bNew )
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index bca8253..e84368e 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1647,22 +1647,22 @@ void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartActi
 
 IMPL_LINK( ScAcceptChgDlg, ChgTrackModHdl, ScChangeTrack*, pChgTrack)
 {
+    ScChangeTrackMsgQueue::iterator iter;
     ScChangeTrackMsgQueue& aMsgQueue= pChgTrack->GetMsgQueue();
 
-    ScChangeTrackMsgInfo* pTrackInfo=aMsgQueue.Get();
     sal_uLong	nStartAction;
     sal_uLong	nEndAction;
 
-    while(pTrackInfo!=NULL)
+    for (iter = aMsgQueue.begin(); iter != aMsgQueue.end(); ++iter)
     {
-        nStartAction=pTrackInfo->nStartAction;
-        nEndAction=pTrackInfo->nEndAction;
+        nStartAction=(*iter)->nStartAction;
+        nEndAction=(*iter)->nEndAction;
 
         if(!bIgnoreMsg)
         {
             bNoSelection=sal_True;
 
-            switch(pTrackInfo->eMsgType)
+            switch((*iter)->eMsgType)
             {
                 case SC_CTM_APPEND: AppendChanges(pChgTrack,nStartAction,nEndAction);
                                     break;
@@ -1678,10 +1678,11 @@ IMPL_LINK( ScAcceptChgDlg, ChgTrackModHdl, ScChangeTrack*, pChgTrack)
                 }
             }
         }
-        delete pTrackInfo;
-        pTrackInfo=aMsgQueue.Get();
+        delete *iter;
     }
 
+    aMsgQueue.clear();
+
     return 0;
 }
 IMPL_LINK( ScAcceptChgDlg, ReOpenTimerHdl, Timer*, EMPTYARG )


More information about the Libreoffice-commits mailing list