summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-25 14:29:49 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-04 23:23:19 +0200
commitdb36d83392792fa672d64460c617c9a72d779f1d (patch)
tree74503d782ecf266d79b3d3496692504eae736af8 /sw
parent0be0cc0e50fa6c4161d6f71964ec90ba579026ac (diff)
Convert Svptrarr to std::vector
Change-Id: Ia385f3b004f9d4744035b43e0e049dbb19da774b
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index db44bc350b53..4d39e3473f9e 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -952,28 +952,19 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
InsertAlphaDelimitter( aIntl );
// Sort the List of all TOC Marks and TOC Sections
- void* p = 0;
- sal_uInt16 nCnt = 0, nFormMax = GetTOXForm().GetFormMax();
- SvPtrarr aCollArr( (sal_uInt8)nFormMax );
- for( ; nCnt < nFormMax; ++nCnt )
- {
- aCollArr.Insert( p, nCnt );
- }
-
+ std::vector<SwTxtFmtColl*> aCollArr( GetTOXForm().GetFormMax(), 0 );
SwNodeIndex aInsPos( *pFirstEmptyNd, 1 );
- for( nCnt = 0; nCnt < aSortArr.size(); ++nCnt )
+ for( sal_uInt16 nCnt = 0; nCnt < aSortArr.size(); ++nCnt )
{
::SetProgressState( 0, pDoc->GetDocShell() );
// Put the Text into the TOC
sal_uInt16 nLvl = aSortArr[ nCnt ]->GetLevel();
- SwTxtFmtColl* pColl = (SwTxtFmtColl*)aCollArr[ nLvl ];
+ SwTxtFmtColl* pColl = aCollArr[ nLvl ];
if( !pColl )
{
pColl = GetTxtFmtColl( nLvl );
- aCollArr.Remove( nLvl );
- p = pColl;
- aCollArr.Insert( p , nLvl );
+ aCollArr[ nLvl ] = pColl;
}
// Generate: Set dynamic TabStops