From 794e54cd34239006270a00a6e5017acc463063f9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 4 Jan 2018 15:35:21 +0100 Subject: sw: convert SwFrame::mpDrawObjs to unique_ptr Change-Id: I0713e6fb2b3f2cfc3115daafe37ae5380f3e7938 --- sw/source/core/layout/ssfrm.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sw/source/core/layout/ssfrm.cxx') diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 9934d1c4b4dd..180ceba1ff9c 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -338,11 +338,11 @@ void SwFrame::DestroyImpl() } } - if( mpDrawObjs ) + if (m_pDrawObjs) { - for ( size_t i = mpDrawObjs->size(); i; ) + for (size_t i = m_pDrawObjs->size(); i; ) { - SwAnchoredObject* pAnchoredObj = (*mpDrawObjs)[--i]; + SwAnchoredObject* pAnchoredObj = (*m_pDrawObjs)[--i]; if ( dynamic_cast< const SwFlyFrame *>( pAnchoredObj ) != nullptr ) { SwFrame::DestroyFrame(static_cast(pAnchoredObj)); @@ -360,8 +360,7 @@ void SwFrame::DestroyImpl() } } } - delete mpDrawObjs; - mpDrawObjs = nullptr; + m_pDrawObjs.reset(); } } @@ -371,7 +370,7 @@ SwFrame::~SwFrame() assert(!IsDeleteForbidden()); // check that it's not deleted while deletes are forbidden #if OSL_DEBUG_LEVEL > 0 // JP 15.10.2001: for detection of access to deleted frames - mpDrawObjs = reinterpret_cast(0x33333333); + mpRoot = reinterpret_cast(0x33333333); #endif } -- cgit v1.2.3