diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-10-05 21:37:51 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-05 23:28:06 +0200 |
commit | 63b0a1fe18ac38cded0774a0119c2aea4ff01593 (patch) | |
tree | 8f0ceba343af42a0b2791441ddac86c73abcdf5d /sw | |
parent | 56a5734b06e0f252722153d2e6af680fd9e6e429 (diff) |
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I792c90a52c30e0c1c4702827b35afdbf958b2812
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/config/uinums.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/inc/uinums.hxx | 6 |
2 files changed, 16 insertions, 8 deletions
diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index ac8ce7a9e9e1..427c085ac819 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -190,7 +190,7 @@ void SwNumRulesWithName::SetNumFormat( aFormats[nIndex] = new _SwNumFormatGlobal(rNumFormat); aFormats[nIndex]->sCharFormatName = rName; aFormats[nIndex]->nCharPoolId = USHRT_MAX; - aFormats[nIndex]->aItems.clear(); + aFormats[nIndex]->m_Items.clear(); } SwNumRulesWithName::_SwNumFormatGlobal::_SwNumFormatGlobal( const SwNumFormat& rFormat ) @@ -209,7 +209,7 @@ SwNumRulesWithName::_SwNumFormatGlobal::_SwNumFormatGlobal( const SwNumFormat& r const SfxPoolItem *pCurr = aIter.GetCurItem(); while( true ) { - aItems.push_back( pCurr->Clone() ); + m_Items.push_back(std::unique_ptr<SfxPoolItem>(pCurr->Clone())); if( aIter.IsAtEnd() ) break; pCurr = aIter.NextItem(); @@ -226,8 +226,10 @@ SwNumRulesWithName::_SwNumFormatGlobal::_SwNumFormatGlobal( const _SwNumFormatGl sCharFormatName( rFormat.sCharFormatName ), nCharPoolId( rFormat.nCharPoolId ) { - for( sal_uInt16 n = rFormat.aItems.size(); n; ) - aItems.push_back( rFormat.aItems[ --n ].Clone() ); + for (size_t n = rFormat.m_Items.size(); n; ) + { + m_Items.push_back(std::unique_ptr<SfxPoolItem>(rFormat.m_Items[ --n ]->Clone())); + } } SwNumRulesWithName::_SwNumFormatGlobal::~_SwNumFormatGlobal() @@ -262,8 +264,12 @@ void SwNumRulesWithName::_SwNumFormatGlobal::ChgNumFormat( SwWrtShell& rSh, pFormat = rSh.GetCharFormatFromPool( nCharPoolId ); if( !pFormat->HasWriterListeners() ) // set attributes - for( sal_uInt16 n = aItems.size(); n; ) - pFormat->SetFormatAttr( aItems[ --n ] ); + { + for (size_t n = m_Items.size(); n; ) + { + pFormat->SetFormatAttr( *m_Items[ --n ] ); + } + } } } const_cast<SwNumFormat&>(aFormat).SetCharFormat( pFormat ); diff --git a/sw/source/uibase/inc/uinums.hxx b/sw/source/uibase/inc/uinums.hxx index b6205c0dcbbd..e03e03398257 100644 --- a/sw/source/uibase/inc/uinums.hxx +++ b/sw/source/uibase/inc/uinums.hxx @@ -21,7 +21,9 @@ #include <numrule.hxx> #include "swdllapi.h" -#include <boost/ptr_container/ptr_vector.hpp> + +#include <memory> +#include <vector> class SfxPoolItem; class SwWrtShell; @@ -42,7 +44,7 @@ class SW_DLLPUBLIC SwNumRulesWithName SwNumFormat aFormat; OUString sCharFormatName; sal_uInt16 nCharPoolId; - boost::ptr_vector<SfxPoolItem> aItems; + std::vector<std::unique_ptr<SfxPoolItem>> m_Items; _SwNumFormatGlobal& operator=( const _SwNumFormatGlobal& ) SAL_DELETED_FUNCTION; |