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

Stephan Bergmann sbergman at redhat.com
Thu Apr 6 14:51:59 UTC 2017


 sw/source/uibase/dbui/dbmgr.cxx |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 032aee2cb74e168ecf35ef698a84165cc74fad0a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 6 16:51:29 2017 +0200

    loplugin:useuniqueptr
    
    Change-Id: Icd2ff94d1fb9003e634b6f789d66011b1c94dd5b

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f54a51d80f28..a0ee6b5e14eb 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -869,7 +869,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell,
     // aTempFile is not deleted, but that seems to be intentional
     utl::TempFile aTempFile( basename, true, &sExt, &sTempDirURL );
     INetURLObject aTempFileURL( aTempFile.GetURL() );
-    SfxMedium* pDstMed = new SfxMedium(
+    auto pDstMed = o3tl::make_unique<SfxMedium>(
         aTempFileURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ),
         StreamMode::STD_READWRITE );
     bool bAnyError = !xTargetDocShell->DoSaveAs( *pDstMed );
@@ -879,7 +879,6 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell,
         SAL_WARN( "sw.mailmerge", "Error saving: " << aTempFile.GetURL() );
     else
         SAL_INFO( "sw.mailmerge", "Saved doc as: " << aTempFile.GetURL() );
-    delete pDstMed;
 }
 
 static bool lcl_SaveDoc(


More information about the Libreoffice-commits mailing list