summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2017-02-27 23:00:36 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2017-02-28 08:59:56 +0000
commit23979c1d81b5aa6efae7c103ba24a024b6cdf64a (patch)
tree42c30f1a63f24a129fd065abba79f5f841dd0372 /sw
parentae181f927dfc7d18562279a49813035931667463 (diff)
remove DestroyVirtObj member
- had only one caller - didnt even do what it claimed in the comments (removing from container), so removed to a simple delete statements with pointless noop decorum Change-Id: I3eeaebbc6199a516b24106d3c2fc27a3067cb34d Reviewed-on: https://gerrit.libreoffice.org/34703 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-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();
}