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

Stephan Bergmann sbergman at redhat.com
Thu Apr 6 14:32:22 UTC 2017


 sc/source/ui/docshell/tablink.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0548f6205c0241e079eb3e17b6d6636dcf621f01
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 6 16:31:52 2017 +0200

    loplugin:useuniqueptr
    
    Change-Id: I706838b9fae087017f60782c185340e6560de86a

diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index a5f03bd7b49e..805aca1b4641 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/make_unique.hxx>
 #include <sfx2/sfxsids.hrc>
 #include <sfx2/app.hxx>
 #include <svl/itemset.hxx>
@@ -450,7 +453,7 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName,
     //  Filter detection
 
     std::shared_ptr<const SfxFilter> pSfxFilter;
-    SfxMedium* pMedium = new SfxMedium( rFileName, StreamMode::STD_READ );
+    auto pMedium = o3tl::make_unique<SfxMedium>( rFileName, StreamMode::STD_READ );
     if ( pMedium->GetError() == ERRCODE_NONE )
     {
         if ( bWithInteraction )
@@ -473,7 +476,6 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName,
         bOK = !rFilter.isEmpty();
     }
 
-    delete pMedium;
     return bOK;
 }
 


More information about the Libreoffice-commits mailing list