sw/source/core/layout/calcmove.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b40f41d0cfcc355f16f4a9d5b0d805fe555dd5bf
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Sep 12 10:26:38 2018 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Sep 13 09:56:32 2018 +0200

    loplugin:useuniqueptr in SwContentFrame::MakeAll
    
    Change-Id: I46aff0769abaf778c705029ac59a03afadac5e8b
    Reviewed-on: https://gerrit.libreoffice.org/60411
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 2b56272bf49c..38409de14e0d 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1179,7 +1179,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
     PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
 
     // 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)
     bool bMakePage = true;
@@ -1216,7 +1216,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 
     const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem());
 
-    SwSaveFootnoteHeight *pSaveFootnote = nullptr;
+    std::unique_ptr<SwSaveFootnoteHeight> pSaveFootnote;
     if ( bFootnote )
     {
         SwFootnoteFrame *pFootnote = FindFootnoteFrame();
@@ -1226,8 +1226,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
             SwFootnoteBossFrame* pBoss = 
pFootnote->GetRef()->FindFootnoteBossFrame(
                                     
pFootnote->GetAttr()->GetFootnote().IsEndNote() );
             if( !pSct || pSct->IsColLocked() || !pSct->Growable() )
-                pSaveFootnote = new SwSaveFootnoteHeight( pBoss,
-                    
static_cast<SwTextFrame*>(pFootnote->GetRef())->GetFootnoteLine( 
pFootnote->GetAttr() ) );
+                pSaveFootnote.reset( new SwSaveFootnoteHeight( pBoss,
+                    
static_cast<SwTextFrame*>(pFootnote->GetRef())->GetFootnoteLine( 
pFootnote->GetAttr() ) ) );
         }
     }
 
@@ -1833,7 +1833,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
                             ),
                          static_cast<SwTextFrame&>(*this) );
 
-    delete pSaveFootnote;
+    pSaveFootnote.reset();
 
     UnlockJoin();
     xDeleteGuard.reset();
@@ -1843,7 +1843,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
     {
         pNotify->SetInvalidatePrevPrtArea();
     }
-    delete pNotify;
+    pNotify.reset();
     SetFlyLock( false );
 }
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to