diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-09-15 23:41:24 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-09-16 13:04:08 +0200 |
commit | 529f5441a7633a76f0a393e9f6dcb83b0b2e408c (patch) | |
tree | 22ac14bf326ae0bd53ce8e8d9669df4dcaa980a6 | |
parent | 01648a391107c1501ed1948ef1b18539d551176e (diff) |
sw: replace boost::ptr_vector with std::vector
Change-Id: I708bd090b28fd8b9f2642425fa55fcaa5f8346ec
-rw-r--r-- | sw/inc/fmtclds.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 21 |
2 files changed, 12 insertions, 14 deletions
diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx index 7bf1a4bd24ea..0213c20c3709 100644 --- a/sw/inc/fmtclds.hxx +++ b/sw/inc/fmtclds.hxx @@ -25,7 +25,8 @@ #include "swdllapi.h" #include <hintids.hxx> #include <format.hxx> -#include <boost/ptr_container/ptr_vector.hpp> + +#include <vector> /// ColumnDescriptor class SwColumn @@ -56,7 +57,7 @@ public: void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; -typedef boost::ptr_vector<SwColumn> SwColumns; +typedef std::vector<SwColumn> SwColumns; enum SwColLineAdj { diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index b1317190a22c..a1512f46507b 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -821,15 +821,14 @@ SwFormatCol::SwFormatCol( const SwFormatCol& rCpy ) m_aLineColor( rCpy.m_aLineColor), m_nLineHeight( rCpy.GetLineHeight() ), m_eAdj( rCpy.GetLineAdj() ), - m_aColumns( (sal_Int8)rCpy.GetNumCols() ), m_nWidth( rCpy.GetWishWidth() ), m_aWidthAdjustValue( rCpy.m_aWidthAdjustValue ), m_bOrtho( rCpy.IsOrtho() ) { + m_aColumns.reserve(rCpy.GetNumCols()); for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) { - SwColumn *pCol = new SwColumn( rCpy.GetColumns()[i] ); - m_aColumns.push_back( pCol ); + m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) ); } } @@ -850,8 +849,7 @@ SwFormatCol& SwFormatCol::operator=( const SwFormatCol& rCpy ) m_aColumns.clear(); for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) { - SwColumn *pCol = new SwColumn( rCpy.GetColumns()[i] ); - m_aColumns.push_back( pCol ); + m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) ); } return *this; } @@ -956,8 +954,7 @@ void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 m_aColumns.clear(); for ( sal_uInt16 i = 0; i < nNumCols; ++i ) { - SwColumn *pCol = new SwColumn; - m_aColumns.push_back( pCol ); + m_aColumns.push_back( SwColumn() ); } m_bOrtho = true; m_nWidth = USHRT_MAX; @@ -1092,12 +1089,12 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(nCount > 1) for(sal_uInt16 i = 0; i < nCount; i++) { - SwColumn* pCol = new SwColumn; - pCol->SetWishWidth( static_cast<sal_uInt16>(pArray[i].Width) ); + SwColumn aCol; + aCol.SetWishWidth(static_cast<sal_uInt16>(pArray[i].Width) ); nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width); - pCol->SetLeft ( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin)) ); - pCol->SetRight( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin)) ); - m_aColumns.insert(m_aColumns.begin() + i, pCol); + aCol.SetLeft (static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin))); + aCol.SetRight(static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin))); + m_aColumns.insert(m_aColumns.begin() + i, aCol); } bRet = true; m_nWidth = nWidthSum; |