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/source/uibase/config | |
parent | 56a5734b06e0f252722153d2e6af680fd9e6e429 (diff) |
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I792c90a52c30e0c1c4702827b35afdbf958b2812
Diffstat (limited to 'sw/source/uibase/config')
-rw-r--r-- | sw/source/uibase/config/uinums.cxx | 18 |
1 files changed, 12 insertions, 6 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 ); |