summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/dcontact.hxx1
-rw-r--r--sw/source/core/draw/dcontact.cxx21
2 files changed, 2 insertions, 20 deletions
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 91800c480a8a..a92656ab45f3 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -368,7 +368,6 @@ class SwDrawContact final : public SwContact
/// method for adding/removing 'virtual' drawing object.
SwDrawVirtObj* CreateVirtObj();
- static void DestroyVirtObj( SwDrawVirtObj* pVirtObj );
void RemoveAllVirtObjs();
void InvalidateObjs_( const bool _bUpdateSortedObjsList = false );
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index f8a5eb0179fc..c40cd50aaa08 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -764,20 +764,6 @@ SwDrawVirtObj* SwDrawContact::CreateVirtObj()
return pNewDrawVirtObj;
}
-/** destroys a given 'virtual' drawing object.
- *
- * side effect: 'virtual' drawing object is removed from data structure
- * <maDrawVirtObjs>.
- */
-void SwDrawContact::DestroyVirtObj( SwDrawVirtObj* _pVirtObj )
-{
- if ( _pVirtObj )
- {
- delete _pVirtObj;
- _pVirtObj = nullptr;
- }
-}
-
/** add a 'virtual' drawing object to drawing page.
*
* Use an already created one, which isn't used, or create a new one.
@@ -809,15 +795,12 @@ SwDrawVirtObj* SwDrawContact::AddVirtObj()
/// remove 'virtual' drawing objects and destroy them.
void SwDrawContact::RemoveAllVirtObjs()
{
- for ( std::list<SwDrawVirtObj*>::iterator aDrawVirtObjsIter = maDrawVirtObjs.begin();
- aDrawVirtObjsIter != maDrawVirtObjs.end();
- ++aDrawVirtObjsIter )
+ for(auto& pDrawVirtObj : maDrawVirtObjs)
{
// remove and destroy 'virtual object'
- SwDrawVirtObj* pDrawVirtObj = (*aDrawVirtObjsIter);
pDrawVirtObj->RemoveFromWriterLayout();
pDrawVirtObj->RemoveFromDrawingPage();
- DestroyVirtObj( pDrawVirtObj );
+ delete pDrawVirtObj;
}
maDrawVirtObjs.clear();
}