From ca5f56a571c79b254af7c1fcb2e8256fa98d521f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 26 Apr 2012 10:04:46 +0200 Subject: Convert SV_DECL_PTRARR_DEL(SwPageFlyCache) to boost::ptr_vector --- sw/source/core/layout/laycache.cxx | 4 +--- sw/source/core/layout/layhelp.hxx | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 5cad47c52cac..b924dac9e163 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -70,8 +70,6 @@ using namespace ::com::sun::star; -SV_IMPL_PTRARR( SwPageFlyCache, SwFlyCachePtr ) - /* * Reading and writing of the layout cache. * The layout cache is not necessary, but it improves @@ -158,7 +156,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) aIo.GetStream() >> nPgNum >> nIndex >> nX >> nY >> nW >> nH; SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH ); - aFlyCache.Insert( pFly, aFlyCache.Count() ); + aFlyCache.push_back( pFly ); aIo.CloseRec( SW_LAYCACHE_IO_REC_FLY ); break; } diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx index 1a6d4cb45184..afaf6feb9903 100644 --- a/sw/source/core/layout/layhelp.hxx +++ b/sw/source/core/layout/layhelp.hxx @@ -56,8 +56,7 @@ class SvStream; *************************************************************************/ class SwFlyCache; -typedef SwFlyCache* SwFlyCachePtr; -SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0 ) +typedef boost::ptr_vector SwPageFlyCache; class SwLayCacheImpl : public std::vector { @@ -75,8 +74,8 @@ public: xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; } sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; } - sal_uInt16 GetFlyCount() const { return aFlyCache.Count(); } - SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) const { return aFlyCache[ nIdx ]; } + sal_uInt16 GetFlyCount() const { return aFlyCache.size(); } + SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) { return &aFlyCache[ nIdx ]; } sal_Bool IsUseFlyCache() const { return bUseFlyCache; } }; -- cgit