summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-01-25 15:44:34 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-25 19:47:44 +0100
commit38af1bb52d3833da7919e61e650fb9ec1bdaf4f7 (patch)
treeab401f166d7a8b3118ca8403ce1730cbb05c23f3 /sw
parent7dbe76266cb4250701aaee043933ccb21e5f6564 (diff)
sw: de-pointerise local variable in SwTOXBaseSection::UpdatePageNum()
Change-Id: I24fcde19ae94cc5a278da6d88e72ce6a57a64951
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index e19316445785..3202362cbbf2 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1550,7 +1550,6 @@ void SwTOXBaseSection::UpdatePageNum()
// Loop over all SourceNodes
std::vector<sal_uInt16> aNums; // the PageNumber
std::vector<SwPageDesc*> aDescs; // The PageDescriptors matching the PageNumbers
- std::vector<sal_uInt16> *pMainNums = nullptr; // contains page numbers of main entries
// process run in lines
SwTOXSortTabBases::size_type nRange = 0;
@@ -1573,6 +1572,7 @@ void SwTOXBaseSection::UpdatePageNum()
for(SwTOXSortTabBases::size_type nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry)
{
+ std::vector<sal_uInt16> aMainNums; // contains page numbers of main entries
SwTOXSortTabBase* pSortBase = aSortArr[nRunInEntry];
size_t nSize = pSortBase->aTOXSources.size();
for (size_t j = 0; j < nSize; ++j)
@@ -1616,9 +1616,7 @@ void SwTOXBaseSection::UpdatePageNum()
if(TOX_SORT_INDEX == pSortBase->GetType() &&
rTOXSource.bMainEntry)
{
- if(!pMainNums)
- pMainNums = new std::vector<sal_uInt16>;
- pMainNums->push_back(nPage);
+ aMainNums.push_back(nPage);
}
}
}
@@ -1629,10 +1627,9 @@ void SwTOXBaseSection::UpdatePageNum()
const SwTextNode* pTextNd = pBase->pTOXNd->GetTextNode();
OSL_ENSURE( pTextNd, "no TextNode, wrong TOC" );
- UpdatePageNum_( const_cast<SwTextNode*>(pTextNd), aNums, aDescs, pMainNums,
+ UpdatePageNum_( const_cast<SwTextNode*>(pTextNd), aNums, aDescs, &aMainNums,
aIntl );
}
- DELETEZ(pMainNums);
aNums.clear();
}
}