Kaydet (Commit) 23979c1d authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

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/34703Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst ae181f92
......@@ -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 );
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment