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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 18 08:54:07 UTC 2018


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

New commits:
commit 9c3cf7a3f738b407b74909220ac68e7382f414e1
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 14 13:53:30 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Sep 18 10:53:45 2018 +0200

    loplugin:useuniqueptr in SwTextPainter::PaintMultiPortion
    
    Change-Id: I7d3db85eb59ba44b529941ac166201d12c6fdf84
    Reviewed-on: https://gerrit.libreoffice.org/60601
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 578d7643c0e1..22c6442285aa 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1550,18 +1550,18 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint,
 
     SwSpaceManipulator aManip( GetInfo(), rMulti );
 
-    SwFontSave *pFontSave;
-    SwFont* pTmpFnt;
+    std::unique_ptr<SwFontSave> pFontSave;
+    std::unique_ptr<SwFont> pTmpFnt;
 
     if( rMulti.IsDouble() )
     {
-        pTmpFnt = new SwFont( *GetInfo().GetFont() );
+        pTmpFnt.reset(new SwFont( *GetInfo().GetFont() ));
         if( rMulti.IsDouble() )
         {
             SetPropFont( 50 );
             pTmpFnt->SetProportion( GetPropFont() );
         }
-        pFontSave = new SwFontSave( GetInfo(), pTmpFnt, this );
+        pFontSave.reset(new SwFontSave( GetInfo(), pTmpFnt.get(), this ));
     }
     else
     {
@@ -1821,8 +1821,8 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint,
     // Restore the saved values
     GetInfo().X( nOldX );
     GetInfo().SetLen( nOldLen );
-    delete pFontSave;
-    delete pTmpFnt;
+    pFontSave.reset();
+    pTmpFnt.reset();
     SetPropFont( 0 );
 }
 


More information about the Libreoffice-commits mailing list