diff options
author | Noel Grandin <noel@peralex.com> | 2012-04-25 11:55:07 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-04-25 12:35:34 +0200 |
commit | 5c8549c7cf53ff22a536e0f77d6f82aa1089e8a1 (patch) | |
tree | 672e5049e436c8a909e7e786b9812ab1a68d79a1 /sw | |
parent | 1f41dc40ad8e0465432b6ea089258c7f8902c247 (diff) |
Convert SV_DECL_PTRARR_DEL(_SwNumFmtsAttrs) to boost::ptr_vector
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/uinums.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/inc/uinums.hxx | 4 |
2 files changed, 11 insertions, 14 deletions
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx index 1c40de6ebd8f..22512d757106 100644 --- a/sw/source/ui/config/uinums.cxx +++ b/sw/source/ui/config/uinums.cxx @@ -59,8 +59,6 @@ using namespace ::com::sun::star; #define NUMRULE_FILENAME "numrule.cfg" #define CHAPTER_FILENAME "chapter.cfg" -SV_IMPL_PTRARR( _SwNumFmtsAttrs, SfxPoolItem* ) - // SwNumRulesWithName ---------------------------------------------------- // PUBLIC METHODES ------------------------------------------------------- @@ -305,7 +303,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const SwNumFmt& rFmt ) const SfxPoolItem *pCurr = aIter.GetCurItem(); while( sal_True ) { - aItems.Insert( pCurr->Clone(), aItems.Count() ); + aItems.push_back( pCurr->Clone() ); if( aIter.IsAtEnd() ) break; pCurr = aIter.NextItem(); @@ -322,8 +320,8 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( const _SwNumFmtGlobal& rFm sCharFmtName( rFmt.sCharFmtName ), nCharPoolId( rFmt.nCharPoolId ) { - for( sal_uInt16 n = rFmt.aItems.Count(); n; ) - aItems.Insert( rFmt.aItems[ --n ]->Clone(), aItems.Count() ); + for( sal_uInt16 n = rFmt.aItems.size(); n; ) + aItems.push_back( rFmt.aItems[ --n ].Clone() ); } SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, @@ -418,8 +416,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream, { sal_uInt16 nWhich, nVers; rStream >> nWhich >> nVers; - aItems.Insert( GetDfltAttr( nWhich )->Create( rStream, nVers ), - aItems.Count() ); + aItems.push_back( GetDfltAttr( nWhich )->Create( rStream, nVers ) ); } } @@ -504,11 +501,11 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream ) } rStream << nCharPoolId; rStream.WriteUniOrByteString( sCharFmtName, eEncoding ); - rStream << aItems.Count(); + rStream << aItems.size(); - for( sal_uInt16 n = aItems.Count(); n; ) + for( sal_uInt16 n = aItems.size(); n; ) { - SfxPoolItem* pItem = aItems[ --n ]; + SfxPoolItem* pItem = &aItems[ --n ]; sal_uInt16 nIVers = pItem->GetVersion( SOFFICE_FILEFORMAT_50 ); OSL_ENSURE( nIVers != USHRT_MAX, "Was'n das: Item-Version USHRT_MAX in der aktuellen Version" ); @@ -570,8 +567,8 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh, pFmt = rSh.GetCharFmtFromPool( nCharPoolId ); if( !pFmt->GetDepends() ) // set attributes - for( sal_uInt16 n = aItems.Count(); n; ) - pFmt->SetFmtAttr( *aItems[ --n ] ); + for( sal_uInt16 n = aItems.size(); n; ) + pFmt->SetFmtAttr( aItems[ --n ] ); } } ((SwNumFmt&)aFmt).SetCharFmt( pFmt ); diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx index cfb846fafc2b..f67df60fca13 100644 --- a/sw/source/ui/inc/uinums.hxx +++ b/sw/source/ui/inc/uinums.hxx @@ -31,6 +31,7 @@ #include <svl/svarray.hxx> #include <numrule.hxx> #include "swdllapi.h" +#include <boost/ptr_container/ptr_vector.hpp> class SfxPoolItem; class SwWrtShell; @@ -38,8 +39,7 @@ class SvStream; #define MAX_NUM_RULES 9 -typedef SfxPoolItem* SfxPoolItemPtr; -SV_DECL_PTRARR_DEL( _SwNumFmtsAttrs, SfxPoolItemPtr, 5 ) +typedef boost::ptr_vector<SfxPoolItem> _SwNumFmtsAttrs; class SW_DLLPUBLIC SwNumRulesWithName { |