diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-25 16:09:52 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-04 23:23:20 +0200 |
commit | 485e097ba8cc55a49188ec239042a92b8c160104 (patch) | |
tree | 4a5d1b1a7237b0c5b23996edcf7a1a91d8e493e1 /sw | |
parent | 6485258bc00de0bc1db9a0b146437a08c93970aa (diff) |
Convert Svptrarr to std::set<const SwTxtFld*>
Change-Id: I71bfd2075c7dd7a97fd5553c8e55e614d6be4cf3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/expfld.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/fields/fldlst.cxx | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 0b908df55bd2..c15e0a274bb8 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -28,10 +28,10 @@ #ifndef SW_EXPFLD_HXX #define SW_EXPFLD_HXX -#include <svl/svarray.hxx> #include "swdllapi.h" #include <fldbas.hxx> #include <cellfml.hxx> +#include <set> class SfxPoolItem; class SwTxtNode; @@ -356,9 +356,9 @@ public: void RemoveUnselectedFlds(); private: - SwEditShell* pSh; - _SetGetExpFlds* pSrtLst; - SvPtrarr aTmpLst; + SwEditShell* pSh; + _SetGetExpFlds* pSrtLst; + std::set<const SwTxtFld*> aTmpLst; }; // Implementation in tblcalc.cxx. diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx index cf90dc51e628..8b7aa5c3a6c2 100644 --- a/sw/source/core/fields/fldlst.cxx +++ b/sw/source/core/fields/fldlst.cxx @@ -78,8 +78,7 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst ) { if( bBuildTmpLst ) { - VoidPtr pTmp = (VoidPtr)pTxtFld; - aTmpLst.Insert( pTmp, aTmpLst.Count() ); + aTmpLst.insert( pTxtFld ); } else { @@ -171,25 +170,24 @@ sal_uInt16 SwInputFieldList::BuildSortLst() const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); if( rTxtNode.GetNodes().IsDocNodes() ) { - VoidPtr pTmp = (VoidPtr)pTxtFld; // nicht in der TempListe vorhanden, also in die SortListe // aufnehemen - sal_uInt16 nFndPos = aTmpLst.GetPos( pTmp ); - if( USHRT_MAX == nFndPos ) + std::set<const SwTxtFld*>::iterator it = aTmpLst.find( pTxtFld ); + if( aTmpLst.end() == it ) { SwNodeIndex aIdx( rTxtNode ); _SetGetExpFld* pNew = new _SetGetExpFld(aIdx, pTxtFld ); pSrtLst->Insert( pNew ); } else - aTmpLst.Remove( nFndPos ); + aTmpLst.erase( it ); } } } } // die Pointer werden nicht mehr gebraucht - aTmpLst.Remove( 0, aTmpLst.Count() ); + aTmpLst.clear(); return pSrtLst->Count(); } |