summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2012-01-21 01:18:35 -0500
committerAugust Sodora <augsod@gmail.com>2012-01-21 01:54:19 -0500
commit528aba3a9cf91da5ce70c6d631d7b82e203f8086 (patch)
treea0563e447f2716119dab527110a298f4e36a15ad
parent8904dce9758a48d2d627ebd5d755f0c2105b9ba0 (diff)
SV_DECL_PTRARR_DEL->boost::ptr_vector
-rw-r--r--sfx2/source/control/dispatch.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 7b2610511da7..5ad8d588d13c 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -72,21 +72,17 @@
#include <rtl/strbuf.hxx>
#include <deque>
+#include <boost/ptr_container/ptr_vector.hpp>
namespace css = ::com::sun::star;
-//==================================================================
DBG_NAME(SfxDispatcherFlush)
DBG_NAME(SfxDispatcherFillState)
-//==================================================================
-typedef SfxRequest* SfxRequestPtr;
-SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr );
-SV_DECL_PTRARR_DEL( SfxRequestPtrArray, SfxRequestPtr, 4, 4 )
-SV_IMPL_PTRARR( SfxRequestPtrArray, SfxRequestPtr );
+typedef boost::ptr_vector<SfxRequest> SfxRequestPtrArray;
+SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr );
DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
-//==================================================================
struct SfxToDo_Impl
{
@@ -1264,7 +1260,7 @@ IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq )
else
{
if ( pImp->bLocked )
- pImp->aReqArr.Insert( new SfxRequest(*pReq), pImp->aReqArr.Count() );
+ pImp->aReqArr.push_back(new SfxRequest(*pReq));
else
pImp->xPoster->Post(new SfxRequest(*pReq));
}
@@ -2176,10 +2172,9 @@ void SfxDispatcher::Lock( sal_Bool bLock )
pImp->bLocked = bLock;
if ( !bLock )
{
- sal_uInt16 nCount = pImp->aReqArr.Count();
- for ( sal_uInt16 i=0; i<nCount; i++ )
- pImp->xPoster->Post( pImp->aReqArr[i] );
- pImp->aReqArr.Remove( 0, nCount );
+ for(size_t i = 0; i < pImp->aReqArr.size(); ++i)
+ pImp->xPoster->Post(&pImp->aReqArr[i]);
+ pImp->aReqArr.clear();
}
}