Kaydet (Commit) b40f41d0 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwContentFrame::MakeAll

Change-Id: I46aff0769abaf778c705029ac59a03afadac5e8b
Reviewed-on: https://gerrit.libreoffice.org/60411
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst fe0ad0b9
...@@ -1179,7 +1179,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) ...@@ -1179,7 +1179,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr ) PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
// takes care of the notification in the dtor // takes care of the notification in the dtor
SwContentNotify *pNotify = new SwContentNotify( this ); std::unique_ptr<SwContentNotify> pNotify(new SwContentNotify( this ));
// as long as bMakePage is true, a new page can be created (exactly once) // as long as bMakePage is true, a new page can be created (exactly once)
bool bMakePage = true; bool bMakePage = true;
...@@ -1216,7 +1216,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) ...@@ -1216,7 +1216,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem()); const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem());
SwSaveFootnoteHeight *pSaveFootnote = nullptr; std::unique_ptr<SwSaveFootnoteHeight> pSaveFootnote;
if ( bFootnote ) if ( bFootnote )
{ {
SwFootnoteFrame *pFootnote = FindFootnoteFrame(); SwFootnoteFrame *pFootnote = FindFootnoteFrame();
...@@ -1226,8 +1226,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) ...@@ -1226,8 +1226,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
SwFootnoteBossFrame* pBoss = pFootnote->GetRef()->FindFootnoteBossFrame( SwFootnoteBossFrame* pBoss = pFootnote->GetRef()->FindFootnoteBossFrame(
pFootnote->GetAttr()->GetFootnote().IsEndNote() ); pFootnote->GetAttr()->GetFootnote().IsEndNote() );
if( !pSct || pSct->IsColLocked() || !pSct->Growable() ) if( !pSct || pSct->IsColLocked() || !pSct->Growable() )
pSaveFootnote = new SwSaveFootnoteHeight( pBoss, pSaveFootnote.reset( new SwSaveFootnoteHeight( pBoss,
static_cast<SwTextFrame*>(pFootnote->GetRef())->GetFootnoteLine( pFootnote->GetAttr() ) ); static_cast<SwTextFrame*>(pFootnote->GetRef())->GetFootnoteLine( pFootnote->GetAttr() ) ) );
} }
} }
...@@ -1833,7 +1833,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) ...@@ -1833,7 +1833,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
), ),
static_cast<SwTextFrame&>(*this) ); static_cast<SwTextFrame&>(*this) );
delete pSaveFootnote; pSaveFootnote.reset();
UnlockJoin(); UnlockJoin();
xDeleteGuard.reset(); xDeleteGuard.reset();
...@@ -1843,7 +1843,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) ...@@ -1843,7 +1843,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
{ {
pNotify->SetInvalidatePrevPrtArea(); pNotify->SetInvalidatePrevPrtArea();
} }
delete pNotify; pNotify.reset();
SetFlyLock( false ); SetFlyLock( false );
} }
......
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