[Libreoffice-commits] core.git: 2 commits - sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 12 06:57:40 UTC 2018


 sd/source/ui/docshell/docshel2.cxx |    4 ++--
 sd/source/ui/docshell/docshel4.cxx |    6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit fb310c42746c5f2452a7e8d9b0893640bf7b2019
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 10 11:14:04 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 08:57:29 2018 +0200

    loplugin:useuniqueptr in DrawDocShell::Load
    
    Change-Id: I0d8b8c5c592b689bae33dd73f99cdf4ceb5f6c2d
    Reviewed-on: https://gerrit.libreoffice.org/60339
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index d2b9693deeec..fca227e683c7 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -358,9 +358,9 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
  */
 bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
 {
-    WaitObject* pWait = nullptr;
+    std::unique_ptr<WaitObject> pWait;
     if( mpViewShell )
-        pWait = new WaitObject( static_cast<vcl::Window*>(mpViewShell->GetActiveWindow()) );
+        pWait.reset(new WaitObject( static_cast<vcl::Window*>(mpViewShell->GetActiveWindow()) ));
 
     mpDoc->NewOrLoadCompleted( NEW_DOC );
     mpDoc->CreateFirstPages();
@@ -379,8 +379,6 @@ bool DrawDocShell::LoadFrom( SfxMedium& rMedium )
             pSet->Put( SfxUInt16Item( SID_VIEW_ID, 5 ) );
     }
 
-    delete pWait;
-
     return bRet;
 }
 
commit 7df81f27974a640de3dae54b48f0b71281bffd4a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 10 11:06:14 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 08:57:15 2018 +0200

    loplugin:useuniqueptr in DrawDocShell::GetPagePreviewBitmap
    
    Change-Id: Ib301f361d9d9598bcb79865c62200bce081c77ef
    Reviewed-on: https://gerrit.libreoffice.org/60338
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 6e22f84315d8..120c3c426889 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -204,7 +204,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage)
     aMapMode.SetScaleY( aFrac );
     pVDev->SetMapMode( aMapMode );
 
-    ClientView* pView = new ClientView( this, pVDev );
+    std::unique_ptr<ClientView> pView(new ClientView( this, pVDev ));
     FrameView*      pFrameView = GetFrameView();
     pView->ShowSdrPage( pPage );
 
@@ -258,7 +258,7 @@ BitmapEx DrawDocShell::GetPagePreviewBitmap(SdPage* pPage)
     pView->CompleteRedraw( pVDev, vcl::Region(::tools::Rectangle(aNullPt, aSize)) );
 
     // IsRedrawReady() always gives sal_True while ( !pView->IsRedrawReady() ) {}
-    delete pView;
+    pView.reset();
 
     pVDev->SetMapMode( MapMode() );
 


More information about the Libreoffice-commits mailing list