summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-06 14:53:38 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-08 22:52:31 +0200
commit306fe606587153fe619f99bb06e1b4d402cb26f7 (patch)
tree0a14a7309b6fd152a25a921871de07b2e64322c3 /sfx2
parent2186e7cbb03be308c1b02fae881e5e64d3afc36e (diff)
Convert SV_DECL_PTRARR( SvLinkSources) to std::set
Used a std::set because the code was enforcing uniqueness. Change-Id: Ie9243ed17b1165b6a371d0ff2f1a856186697ba3
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/linkmgr.hxx8
-rw-r--r--sfx2/source/appl/linkmgr2.cxx9
2 files changed, 6 insertions, 11 deletions
diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx
index 544c782f6918..f9fd7d577ee4 100644
--- a/sfx2/inc/sfx2/linkmgr.hxx
+++ b/sfx2/inc/sfx2/linkmgr.hxx
@@ -35,6 +35,7 @@
#include <svl/svarray.hxx>
#include <vector>
+#include <set>
class SfxObjectShell;
class Graphic;
@@ -59,8 +60,7 @@ class SvBaseLinkRef;
typedef SvBaseLinkRef* SvBaseLinkRefPtr;
SV_DECL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr, 1 )
-typedef SvLinkSource* SvLinkSourcePtr;
-SV_DECL_PTRARR( SvLinkSources, SvLinkSourcePtr, 1 )
+typedef std::set<SvLinkSource*> SvLinkSources;
class SFX2_DLLPUBLIC LinkManager
{
@@ -162,9 +162,7 @@ public:
const SvLinkSources& GetServers() const { return aServerTbl; }
// Link register/delete
sal_Bool InsertServer( SvLinkSource* rObj );
- void RemoveServer( SvLinkSource* rObj );
- void RemoveServer( sal_uInt16 nPos, sal_uInt16 nCnt = 1 )
- { aServerTbl.Remove( nPos, nCnt ); }
+ void RemoveServer( SvLinkSource* rObj );
// A transfer is aborted, so cancel all download media
// (for the time beeing this is only of interest for the FileLinks!)
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index daec440c0c5a..663e98e89168 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -387,19 +387,16 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink * pLink )
sal_Bool LinkManager::InsertServer( SvLinkSource* pObj )
{
// no duplicate inserts
- if( !pObj || USHRT_MAX != aServerTbl.GetPos( pObj ) )
+ if( !pObj )
return sal_False;
- aServerTbl.Insert( pObj, aServerTbl.Count() );
- return sal_True;
+ return aServerTbl.insert( pObj ).second;
}
void LinkManager::RemoveServer( SvLinkSource* pObj )
{
- sal_uInt16 nPos = aServerTbl.GetPos( pObj );
- if( USHRT_MAX != nPos )
- aServerTbl.Remove( nPos, 1 );
+ aServerTbl.erase( pObj );
}