[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 07:00:09 UTC 2018


 sw/source/core/layout/paintfrm.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 8920f62b51cd0fe2dc9f92be2d66eec6e663cdce
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 13 10:45:26 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 14 08:59:38 2018 +0200

    loplugin:useuniqueptr in SwFrame::PaintSwFrameBackground
    
    Change-Id: I351ebf8ece7e6c298bfd352d308bb811029ea266
    Reviewed-on: https://gerrit.libreoffice.org/60448
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3ed96c30813e..57243e777ef1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6122,7 +6122,7 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
     const SvxBrushItem* pItem;
     // OD 05.09.2002 #102912#
     // temporary background brush for a fly frame without a background brush
-    SvxBrushItem* pTmpBackBrush = nullptr;
+    std::unique_ptr<SvxBrushItem> pTmpBackBrush;
     const Color* pCol;
     SwRect aOrigBackRect;
     const bool bPageFrame = IsPageFrame();
@@ -6156,20 +6156,20 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
                  )
                )
             {
-                pTmpBackBrush = new SvxBrushItem( COL_WHITE, RES_BACKGROUND );
+                pTmpBackBrush.reset(new SvxBrushItem( COL_WHITE, RES_BACKGROUND ));
 
                 //UUU
                 aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(COL_WHITE));
             }
             else
             {
-                pTmpBackBrush = new SvxBrushItem( aGlobalRetoucheColor, RES_BACKGROUND);
+                pTmpBackBrush.reset(new SvxBrushItem( aGlobalRetoucheColor, RES_BACKGROUND));
 
                 //UUU
                 aFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aGlobalRetoucheColor));
             }
 
-            pItem = pTmpBackBrush;
+            pItem = pTmpBackBrush.get();
             bBack = true;
         }
     }
@@ -6293,7 +6293,7 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
 
     // OD 05.09.2002 #102912#
     // delete temporary background brush.
-    delete pTmpBackBrush;
+    pTmpBackBrush.reset();
 
     //Now process lower and his neighbour.
     //We end this as soon as a Frame leaves the chain and therefore is not a lower


More information about the Libreoffice-commits mailing list