summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-06 11:59:47 +0200
committerTor Lillqvist <tlillqvist@suse.com>2012-08-08 13:53:05 +0300
commit0c8ae56cde20a6c9c6eabbb94b6f2a98425b5970 (patch)
tree2b8d8bcf5641ae6b1168127ee6170b0f8a6a30e9 /cui
parent3d8f844101bbd0a999227af70991128584b2fe23 (diff)
Convert SV_DECL_REF_LIST(SvBaseLink) to std::vector
Change-Id: Id397c5993cd6562ff3400dc63a9e2678d05732cf
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/linkdlg.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index c163c59de418..95d46d60b86b 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -56,8 +56,23 @@
using namespace sfx2;
-SV_DECL_REF_LIST(SvBaseLink,SvBaseLink*)
-SV_IMPL_REF_LIST(SvBaseLink,SvBaseLink*)
+class SvBaseLinkMemberList : private std::vector<SvBaseLink*> {
+public:
+ ~SvBaseLinkMemberList()
+ {
+ for( const_iterator it = begin(); it != end(); ++it )
+ {
+ SvBaseLink* p = *it;
+ if( p )
+ p->ReleaseReference();
+ }
+ }
+
+ using std::vector<SvBaseLink*>::size;
+ using std::vector<SvBaseLink*>::operator[];
+
+ void push_back(SvBaseLink* p) { std::vector<SvBaseLink*>::push_back(p); p->AddRef(); }
+};
// attention, this array is indexed directly (0, 1, ...) in the code
static long nTabs[] =
@@ -442,13 +457,13 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
{
void * pUD = pEntry->GetUserData();
if( pUD )
- aLinkList.Append( (SvBaseLink*)pUD );
+ aLinkList.push_back( (SvBaseLink*)pUD );
pEntry = Links().NextSelected(pEntry);
}
Links().RemoveSelection();
- for( sal_uLong i = 0; i < aLinkList.Count(); i++ )
+ for( sal_uLong i = 0; i < aLinkList.size(); i++ )
{
- SvBaseLinkRef xLink = aLinkList.GetObject( i );
+ SvBaseLinkRef xLink = aLinkList[i];
// tell the link that it will be resolved!
xLink->Closed();