Kaydet (Commit) 529f5441 authored tarafından Michael Stahl's avatar Michael Stahl

sw: replace boost::ptr_vector with std::vector

Change-Id: I708bd090b28fd8b9f2642425fa55fcaa5f8346ec
üst 01648a39
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include "swdllapi.h" #include "swdllapi.h"
#include <hintids.hxx> #include <hintids.hxx>
#include <format.hxx> #include <format.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
/// ColumnDescriptor /// ColumnDescriptor
class SwColumn class SwColumn
...@@ -56,7 +57,7 @@ public: ...@@ -56,7 +57,7 @@ public:
void dumpAsXml(struct _xmlTextWriter* pWriter) const; void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
typedef boost::ptr_vector<SwColumn> SwColumns; typedef std::vector<SwColumn> SwColumns;
enum SwColLineAdj enum SwColLineAdj
{ {
......
...@@ -821,15 +821,14 @@ SwFormatCol::SwFormatCol( const SwFormatCol& rCpy ) ...@@ -821,15 +821,14 @@ SwFormatCol::SwFormatCol( const SwFormatCol& rCpy )
m_aLineColor( rCpy.m_aLineColor), m_aLineColor( rCpy.m_aLineColor),
m_nLineHeight( rCpy.GetLineHeight() ), m_nLineHeight( rCpy.GetLineHeight() ),
m_eAdj( rCpy.GetLineAdj() ), m_eAdj( rCpy.GetLineAdj() ),
m_aColumns( (sal_Int8)rCpy.GetNumCols() ),
m_nWidth( rCpy.GetWishWidth() ), m_nWidth( rCpy.GetWishWidth() ),
m_aWidthAdjustValue( rCpy.m_aWidthAdjustValue ), m_aWidthAdjustValue( rCpy.m_aWidthAdjustValue ),
m_bOrtho( rCpy.IsOrtho() ) m_bOrtho( rCpy.IsOrtho() )
{ {
m_aColumns.reserve(rCpy.GetNumCols());
for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
{ {
SwColumn *pCol = new SwColumn( rCpy.GetColumns()[i] ); m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) );
m_aColumns.push_back( pCol );
} }
} }
...@@ -850,8 +849,7 @@ SwFormatCol& SwFormatCol::operator=( const SwFormatCol& rCpy ) ...@@ -850,8 +849,7 @@ SwFormatCol& SwFormatCol::operator=( const SwFormatCol& rCpy )
m_aColumns.clear(); m_aColumns.clear();
for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
{ {
SwColumn *pCol = new SwColumn( rCpy.GetColumns()[i] ); m_aColumns.push_back( SwColumn(rCpy.GetColumns()[i]) );
m_aColumns.push_back( pCol );
} }
return *this; return *this;
} }
...@@ -956,8 +954,7 @@ void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 ...@@ -956,8 +954,7 @@ void SwFormatCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16
m_aColumns.clear(); m_aColumns.clear();
for ( sal_uInt16 i = 0; i < nNumCols; ++i ) for ( sal_uInt16 i = 0; i < nNumCols; ++i )
{ {
SwColumn *pCol = new SwColumn; m_aColumns.push_back( SwColumn() );
m_aColumns.push_back( pCol );
} }
m_bOrtho = true; m_bOrtho = true;
m_nWidth = USHRT_MAX; m_nWidth = USHRT_MAX;
...@@ -1092,12 +1089,12 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -1092,12 +1089,12 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(nCount > 1) if(nCount > 1)
for(sal_uInt16 i = 0; i < nCount; i++) for(sal_uInt16 i = 0; i < nCount; i++)
{ {
SwColumn* pCol = new SwColumn; SwColumn aCol;
pCol->SetWishWidth( static_cast<sal_uInt16>(pArray[i].Width) ); aCol.SetWishWidth(static_cast<sal_uInt16>(pArray[i].Width) );
nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width); nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width);
pCol->SetLeft ( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin)) ); aCol.SetLeft (static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin)));
pCol->SetRight( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin)) ); aCol.SetRight(static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin)));
m_aColumns.insert(m_aColumns.begin() + i, pCol); m_aColumns.insert(m_aColumns.begin() + i, aCol);
} }
bRet = true; bRet = true;
m_nWidth = nWidthSum; m_nWidth = nWidthSum;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment