From 70fed865df7655a7ee65fa6cde51bbf93182dbbb Mon Sep 17 00:00:00 2001
From: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Mon, 16 Jan 2017 14:13:31 +0200
Subject: new loplugin: useuniqueptr: forms..framework

Change-Id: I4300a13f455148b7156ac3f444c7102d63ae6db3
Reviewed-on: https://gerrit.libreoffice.org/33164
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
---
 fpicker/source/office/fpsmartcontent.cxx | 5 ++---
 fpicker/source/office/fpsmartcontent.hxx | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'fpicker')

diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index fc5af8d4af06..7e068be975ac 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -76,7 +76,6 @@ namespace svt
            TODO: If there is real need for caching the content, it must
            be done here.
         */
-        delete m_pContent;
     }
 
 
@@ -145,7 +144,7 @@ namespace svt
             // nothing to do, regardless of the state
             return;
 
-        DELETEZ( m_pContent );
+        m_pContent.reset();
         m_eState = INVALID; // default to INVALID
         m_sURL = _rURL;
 
@@ -153,7 +152,7 @@ namespace svt
         {
             try
             {
-                m_pContent = new ::ucbhelper::Content( _rURL, m_xCmdEnv, comphelper::getProcessComponentContext() );
+                m_pContent.reset( new ::ucbhelper::Content( _rURL, m_xCmdEnv, comphelper::getProcessComponentContext() ) );
                 m_eState = UNKNOWN;
                     // from now on, the state is unknown -> we cannot know for sure if the content
                     // is really valid (some UCP's only tell this when asking for properties, not upon
diff --git a/fpicker/source/office/fpsmartcontent.hxx b/fpicker/source/office/fpsmartcontent.hxx
index e20acb0089fa..9606e1166f3c 100644
--- a/fpicker/source/office/fpsmartcontent.hxx
+++ b/fpicker/source/office/fpsmartcontent.hxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
 #include <com/sun/star/task/XInteractionHandler.hpp>
 #include <ucbhelper/content.hxx>
+#include <memory>
 
 
 namespace svt
@@ -49,7 +50,7 @@ namespace svt
 
     private:
         OUString                                               m_sURL;
-        ::ucbhelper::Content*                                  m_pContent;
+        std::unique_ptr<::ucbhelper::Content>                  m_pContent;
         State                                                  m_eState;
         css::uno::Reference < css::ucb::XCommandEnvironment >  m_xCmdEnv;
         css::uno::Reference < css::task::XInteractionHandler > m_xOwnInteraction;
-- 
cgit