From 63b0a1fe18ac38cded0774a0119c2aea4ff01593 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 5 Oct 2015 21:37:51 +0200 Subject: sw: replace boost::ptr_vector with std::vector Change-Id: I792c90a52c30e0c1c4702827b35afdbf958b2812 --- sw/source/uibase/config/uinums.cxx | 18 ++++++++++++------ sw/source/uibase/inc/uinums.hxx | 6 ++++-- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'sw') 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(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(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(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 #include "swdllapi.h" -#include + +#include +#include class SfxPoolItem; class SwWrtShell; @@ -42,7 +44,7 @@ class SW_DLLPUBLIC SwNumRulesWithName SwNumFormat aFormat; OUString sCharFormatName; sal_uInt16 nCharPoolId; - boost::ptr_vector aItems; + std::vector> m_Items; _SwNumFormatGlobal& operator=( const _SwNumFormatGlobal& ) SAL_DELETED_FUNCTION; -- cgit