summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-21 17:42:31 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-25 20:13:16 +0200
commitace0b43a026626dfbf0623800c24600d2d9480b5 (patch)
treeb0c0c74e70ac5d306ff9e56d977696ae9c0ae283 /sw
parentRemove unused member aTblFmts (diff)
downloadcore-ace0b43a026626dfbf0623800c24600d2d9480b5.tar.gz
core-ace0b43a026626dfbf0623800c24600d2d9480b5.zip
Convert SwRTFParser::RemoveUnusedNumRules from Svptrarr top std::vector
Change-Id: I38b5c23e59399babb8bfc2c52455bfff0f7c062e
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index 39218c4bc566..13d963d8b3de 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -689,7 +689,7 @@ void SwRTFParser::RemoveUnusedNumRule( SwNumRule* pRule )
void SwRTFParser::RemoveUnusedNumRules()
{
SwListEntry* pEntry;
- SvPtrarr aDelArr;
+ std::set<SwNumRule*> aDelArr;
size_t n;
for( n = aListArr.size(); n; )
{
@@ -704,20 +704,20 @@ void SwRTFParser::RemoveUnusedNumRules()
}
if (unused)
{
- void * p = pDoc->GetNumRuleTbl()[pEntry->nListDocPos];
+ SwNumRule* p = pDoc->GetNumRuleTbl()[pEntry->nListDocPos];
// dont delete named char formats
- if( USHRT_MAX == aDelArr.GetPos( p ) &&
- ((SwNumRule*)p)->GetName().EqualsAscii( RTF_NUMRULE_NAME, 0,
+ if( aDelArr.find( p ) == aDelArr.end() &&
+ p->GetName().EqualsAscii( RTF_NUMRULE_NAME, 0,
sizeof( RTF_NUMRULE_NAME )) )
- aDelArr.Insert( p, aDelArr.Count() );
+ aDelArr.insert( p );
}
}
}
- for( n = aDelArr.Count(); n; )
+ while( !aDelArr.empty() )
{
- SwNumRule* pDel = (SwNumRule*)aDelArr[ --n ];
- RemoveUnusedNumRule( pDel );
+ RemoveUnusedNumRule( *aDelArr.begin() );
+ aDelArr.erase( aDelArr.begin() );
}
}