diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-08 09:54:16 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-09 10:06:11 +0200 |
commit | 5906a2a6380dc8f748a3c6f4fa0778e237abdff2 (patch) | |
tree | 0c3f41c74e68229b1633973d25e96a8896d6e450 /svx | |
parent | 7a39ae04220d70caef0335ed47452b36cd2e98c7 (diff) |
convert Link<> to typed
Change-Id: I184d836e944d6dcfd17233a7a83680f1c1bff9bf
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/objfac3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmobjfac.cxx | 6 | ||||
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 10 |
5 files changed, 15 insertions, 27 deletions
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index a494d897b4e7..197c77cd3739 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -45,8 +45,7 @@ E3dObjFactory::~E3dObjFactory() // Generate chart internal objects -IMPL_STATIC_LINK( - E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory) +IMPL_STATIC_LINK_TYPED( E3dObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void ) { if ( pObjFactory->nInventor == E3dInventor ) { @@ -80,7 +79,6 @@ IMPL_STATIC_LINK( break; } } - return 0; } diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index a5e370bc5d6f..894421729954 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -109,8 +109,8 @@ namespace } } -IMPL_STATIC_LINK( - FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory) +IMPL_STATIC_LINK_TYPED( + FmFormObjFactory, MakeObject, SdrObjFactory*, pObjFactory, void) { if (pObjFactory->nInventor == FmFormInventor) { @@ -232,8 +232,6 @@ IMPL_STATIC_LINK( ); } } - - return 0; } diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 368f955923e5..a602f8afe24b 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -76,13 +76,11 @@ BitmapEx GalleryResGetBitmapEx( sal_uInt32 nId ) return aBmpEx; } -IMPL_STATIC_LINK( - SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory ) +IMPL_STATIC_LINK_TYPED( + SgaUserDataFactory, MakeUserData, SdrObjFactory*, pObjFactory, void ) { if ( pObjFactory->nInventor == IV_IMAPINFO && pObjFactory->nIdentifier == ID_IMAPINFO ) pObjFactory->pNewData = new SgaIMapInfo; - - return 0L; } GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index e69fe4b5ae6a..3227bf331889 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -260,14 +260,10 @@ IMPL_LINK_NOARG_TYPED(OLEObjCache, UnloadCheckHdl, Timer*, void) void SdrLinkList::Clear() { - unsigned nAnz=GetLinkCount(); - for (unsigned i=0; i<nAnz; i++) { - delete aList[i]; - } aList.clear(); } -unsigned SdrLinkList::FindEntry(const Link<>& rLink) const +unsigned SdrLinkList::FindEntry(const Link<SdrObjFactory*,void>& rLink) const { unsigned nAnz=GetLinkCount(); for (unsigned i=0; i<nAnz; i++) { @@ -276,15 +272,15 @@ unsigned SdrLinkList::FindEntry(const Link<>& rLink) const return 0xFFFF; } -void SdrLinkList::InsertLink(const Link<>& rLink, unsigned nPos) +void SdrLinkList::InsertLink(const Link<SdrObjFactory*,void>& rLink, unsigned nPos) { unsigned nFnd=FindEntry(rLink); if (nFnd==0xFFFF) { if (rLink.IsSet()) { if(nPos==0xFFFF) - aList.push_back(new Link<>(rLink)); + aList.push_back(rLink); else - aList.insert(aList.begin() + nPos, new Link<>(rLink)); + aList.insert(aList.begin() + nPos, rLink); } else { OSL_FAIL("SdrLinkList::InsertLink(): Tried to insert a link that was not set already."); } @@ -293,13 +289,11 @@ void SdrLinkList::InsertLink(const Link<>& rLink, unsigned nPos) } } -void SdrLinkList::RemoveLink(const Link<>& rLink) +void SdrLinkList::RemoveLink(const Link<SdrObjFactory*,void>& rLink) { unsigned nFnd=FindEntry(rLink); if (nFnd!=0xFFFF) { - Link<>* pLink = aList[nFnd]; aList.erase( aList.begin() + nFnd ); - delete pLink; } else { OSL_FAIL("SdrLinkList::RemoveLink(): Link not found."); } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 42042d5b6832..6b8c00d23a42 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -3171,7 +3171,7 @@ SdrObject* SdrObjFactory::CreateObjectFromFactory( sal_uInt32 nInventor, sal_uIn SdrObject* pObj = NULL; while (i < n && !pObj) { - rLL.GetLink(i).Call(static_cast<void*>(pFact.get())); + rLL.GetLink(i).Call(pFact.get()); pObj = pFact->pNewObj; i++; } @@ -3331,25 +3331,25 @@ SdrObject* SdrObjFactory::MakeNewObject( return pObj; } -void SdrObjFactory::InsertMakeObjectHdl(const Link<>& rLink) +void SdrObjFactory::InsertMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink) { SdrLinkList& rLL=ImpGetUserMakeObjHdl(); rLL.InsertLink(rLink); } -void SdrObjFactory::RemoveMakeObjectHdl(const Link<>& rLink) +void SdrObjFactory::RemoveMakeObjectHdl(const Link<SdrObjFactory*,void>& rLink) { SdrLinkList& rLL=ImpGetUserMakeObjHdl(); rLL.RemoveLink(rLink); } -void SdrObjFactory::InsertMakeUserDataHdl(const Link<>& rLink) +void SdrObjFactory::InsertMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink) { SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl(); rLL.InsertLink(rLink); } -void SdrObjFactory::RemoveMakeUserDataHdl(const Link<>& rLink) +void SdrObjFactory::RemoveMakeUserDataHdl(const Link<SdrObjFactory*,void>& rLink) { SdrLinkList& rLL=ImpGetUserMakeObjUserDataHdl(); rLL.RemoveLink(rLink); |