summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-12 12:45:37 +0200
committerMichael Stahl <mstahl@redhat.com>2015-10-12 13:59:53 +0200
commitcc47088d8733603b351259d3a4b5bf1b4270e8f0 (patch)
tree751c8b7207072aaa65ee55a54356e934143e833f /sw
parent9ebfe82edc3cb12cb3d8574b1fefd2d2c6809970 (diff)
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I35063a241937137c4ebf4393dd880fa7cb7c8546
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/UndoTable.hxx2
-rw-r--r--sw/source/core/undo/untbl.cxx19
2 files changed, 10 insertions, 11 deletions
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 58a320dd2b50..ddd9673df7e2 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -103,7 +103,7 @@ class SwUndoTableToText : public SwUndo
OUString sTableNm;
SwDDEFieldType* pDDEFieldType;
_SaveTable* pTableSave;
- SwTableToTextSaves* pBoxSaves;
+ SwTableToTextSaves* m_pBoxSaves;
SwHistory* pHistory;
sal_uLong nSttNd, nEndNd;
sal_Unicode cTrenner;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index b69f7a3637a4..3ecead828add 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -91,10 +91,7 @@ public:
class SwUndoMoves : public std::vector<std::unique_ptr<SwUndoMove>> {};
struct SwTableToTextSave;
-class SwTableToTextSaves : public boost::ptr_vector<SwTableToTextSave> {
-public:
- explicit SwTableToTextSaves(size_type n) : boost::ptr_vector<SwTableToTextSave>(n) {}
-};
+class SwTableToTextSaves : public std::vector<std::unique_ptr<SwTableToTextSave>> {};
struct _UndoTableCpyTable_Entry
{
@@ -406,7 +403,8 @@ SwUndoTableToText::SwUndoTableToText( const SwTable& rTable, sal_Unicode cCh )
cTrenner( cCh ), nHdlnRpt( rTable.GetRowsToRepeat() )
{
pTableSave = new _SaveTable( rTable );
- pBoxSaves = new SwTableToTextSaves( (SwTableToTextSaves::size_type)rTable.GetTabSortBoxes().size() );
+ m_pBoxSaves = new SwTableToTextSaves;
+ m_pBoxSaves->reserve(rTable.GetTabSortBoxes().size());
if( dynamic_cast<const SwDDETable *>(&rTable) != nullptr )
pDDEFieldType = static_cast<SwDDEFieldType*>(static_cast<const SwDDETable&>(rTable).GetDDEFieldType()->Copy());
@@ -441,7 +439,7 @@ SwUndoTableToText::~SwUndoTableToText()
{
delete pDDEFieldType;
delete pTableSave;
- delete pBoxSaves;
+ delete m_pBoxSaves;
delete pHistory;
}
@@ -463,7 +461,7 @@ void SwUndoTableToText::UndoImpl(::sw::UndoRedoContext & rContext)
SwNode2Layout aNode2Layout( aFrmIdx.GetNode() );
// create TableNode structure
- SwTableNode* pTableNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves );
+ SwTableNode* pTableNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *m_pBoxSaves );
pTableNd->GetTable().SetTableModel( pTableSave->IsNewModel() );
SwTableFormat* pTableFormat = rDoc.MakeTableFrameFormat( sTableNm, rDoc.GetDfltFrameFormat() );
pTableNd->GetTable().RegisterToFormat( *pTableFormat );
@@ -547,7 +545,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create());
for( size_t n = rSavedData.size(); n; )
{
- const SwTableToTextSave* pSave = &rSavedData[ --n ];
+ const SwTableToTextSave *const pSave = rSavedData[ --n ].get();
// if the start node was merged with last from prev. cell,
// subtract 1 from index to get the merged paragraph, and split that
aSttIdx = pSave->m_nSttNd - ( ( SAL_MAX_INT32 != pSave->m_nContent ) ? 1 : 0);
@@ -681,8 +679,9 @@ void SwUndoTableToText::SetRange( const SwNodeRange& rRg )
void SwUndoTableToText::AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx, sal_Int32 nContentIdx )
{
- SwTableToTextSave* pNew = new SwTableToTextSave( rDoc, nNdIdx, nEndIdx, nContentIdx );
- pBoxSaves->push_back( pNew );
+ std::unique_ptr<SwTableToTextSave> pNew(
+ new SwTableToTextSave(rDoc, nNdIdx, nEndIdx, nContentIdx));
+ m_pBoxSaves->push_back(std::move(pNew));
}
SwUndoTextToTable::SwUndoTextToTable( const SwPaM& rRg,