summaryrefslogtreecommitdiff
path: root/sw/source/core/docnode
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-04 18:29:01 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-07 16:49:57 +0200
commitb7a5b788f37707f9d0c473877be9777ce784175a (patch)
treeba4850187e363e025f320139cd2bf78b6fd7502b /sw/source/core/docnode
parent8bf0e60d1da6d1ab79455dc916fd8701122812d2 (diff)
sw: convert boost::ptr_vector to std::vector<std::unique_ptr>
Change-Id: If8d9770717c21875b4472b0d94a1fa5a9d136085
Diffstat (limited to 'sw/source/core/docnode')
-rw-r--r--sw/source/core/docnode/ndtbl.cxx32
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx6
2 files changed, 21 insertions, 17 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 70b56363b4a0..3635c4ab05ba 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1858,15 +1858,15 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor )
_FndBox* pFndBox = &aFndBox;
while( 1 == pFndBox->GetLines().size() &&
- 1 == pFndBox->GetLines().front().GetBoxes().size() )
+ 1 == pFndBox->GetLines().front()->GetBoxes().size() )
{
- _FndBox *const pTmp = & pFndBox->GetLines().front().GetBoxes()[0];
+ _FndBox *const pTmp = & pFndBox->GetLines().front()->GetBoxes()[0];
if( pTmp->GetBox()->GetSttNd() )
break; // Else it gets too far
pFndBox = pTmp;
}
- SwTableLine* pDelLine = pFndBox->GetLines().back().GetLine();
+ SwTableLine* pDelLine = pFndBox->GetLines().back()->GetLine();
SwTableBox* pDelBox = pDelLine->GetTabBoxes().back();
while( !pDelBox->GetSttNd() )
{
@@ -1882,7 +1882,7 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor )
if( !pNextBox ) // No succeeding Boxes? Then take the preceding one
{
- pDelLine = pFndBox->GetLines().front().GetLine();
+ pDelLine = pFndBox->GetLines().front()->GetLine();
pDelBox = pDelLine->GetTabBoxes()[ 0 ];
while( !pDelBox->GetSttNd() )
pDelBox = pDelBox->GetTabLines()[0]->GetTabBoxes()[0];
@@ -3712,8 +3712,10 @@ static bool lcl_SetAFormatBox( _FndBox & rBox, _SetAFormatTabPara *pSetPara )
}
else
{
- for( _FndLine& rFndLine : rBox.GetLines() )
- lcl_SetAFormatLine( rFndLine, pSetPara );
+ for (auto const& rpFndLine : rBox.GetLines())
+ {
+ lcl_SetAFormatLine( *rpFndLine, pSetPara );
+ }
}
if (!rBox.GetUpper()->GetUpper()) // a BaseLine
@@ -3745,9 +3747,9 @@ bool SwDoc::SetTableAutoFormat( const SwSelBoxes& rBoxes, const SwTableAutoForma
_FndBox* pFndBox = &aFndBox;
while( 1 == pFndBox->GetLines().size() &&
- 1 == pFndBox->GetLines().front().GetBoxes().size() )
+ 1 == pFndBox->GetLines().front()->GetBoxes().size())
{
- pFndBox = &pFndBox->GetLines().front().GetBoxes()[0];
+ pFndBox = &pFndBox->GetLines().front()->GetBoxes()[0];
}
if( pFndBox->GetLines().empty() ) // One too far? (only one sel. Box)
@@ -3766,11 +3768,11 @@ bool SwDoc::SetTableAutoFormat( const SwSelBoxes& rBoxes, const SwTableAutoForma
rNew.RestoreTableProperties(table);
_SetAFormatTabPara aPara( rNew );
- _FndLines& rFLns = pFndBox->GetLines();
+ FndLines_t& rFLns = pFndBox->GetLines();
- for( _FndLines::size_type n = 0; n < rFLns.size(); ++n )
+ for (FndLines_t::size_type n = 0; n < rFLns.size(); ++n)
{
- _FndLine* pLine = &rFLns[n];
+ _FndLine* pLine = rFLns[n].get();
// Set Upper to 0 (thus simulate BaseLine)
_FndBox* pSaveBox = pLine->GetUpper();
@@ -3832,15 +3834,15 @@ bool SwDoc::GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGe
_FndBox* pFndBox = &aFndBox;
while( 1 == pFndBox->GetLines().size() &&
- 1 == pFndBox->GetLines().front().GetBoxes().size() )
+ 1 == pFndBox->GetLines().front()->GetBoxes().size())
{
- pFndBox = &pFndBox->GetLines().front().GetBoxes()[0];
+ pFndBox = &pFndBox->GetLines().front()->GetBoxes()[0];
}
if( pFndBox->GetLines().empty() ) // One too far? (only one sel. Box)
pFndBox = pFndBox->GetUpper()->GetUpper();
- _FndLines& rFLns = pFndBox->GetLines();
+ FndLines_t& rFLns = pFndBox->GetLines();
sal_uInt16 aLnArr[4];
aLnArr[0] = 0;
@@ -3850,7 +3852,7 @@ bool SwDoc::GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGe
for( sal_uInt8 nLine = 0; nLine < 4; ++nLine )
{
- _FndLine& rLine = rFLns[ aLnArr[ nLine ] ];
+ _FndLine& rLine = *rFLns[ aLnArr[ nLine ] ];
sal_uInt16 aBoxArr[4];
aBoxArr[0] = 0;
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 578cd50ecee4..51d5fa76f696 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -179,8 +179,10 @@ bool _FindBox( _FndBox & rBox, LinesAndTable* pPara )
if (!rBox.GetLines().empty())
{
pPara->m_bInsertLines = true;
- for (_FndLine & rFndLine : rBox.GetLines())
- _FindLine(rFndLine, pPara);
+ for (auto const& rpFndLine : rBox.GetLines())
+ {
+ _FindLine(*rpFndLine, pPara);
+ }
if (pPara->m_bInsertLines)
{