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

Stephan Bergmann sbergman at redhat.com
Mon Jan 23 10:40:34 UTC 2017


 connectivity/source/drivers/evoab2/NResultSet.cxx |   14 ++++++--------
 connectivity/source/drivers/evoab2/NResultSet.hxx |    4 +++-
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 7e5c140dd9816b30a1fa7d65200c1487d7e374d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 23 11:39:49 2017 +0100

    loplugin:useuniqueptr
    
    Change-Id: Ia0c8c3bb8319b5719bf63a3408d404d9adc681cc

diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 9282773..c010260 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -42,6 +42,7 @@
 #include <connectivity/dbexception.hxx>
 #include <connectivity/sqlerror.hxx>
 #include <cppuhelper/typeprovider.hxx>
+#include <o3tl/make_unique.hxx>
 #include <rtl/string.hxx>
 #include <tools/diagnose_ex.h>
 #include <unotools/syslocale.hxx>
@@ -628,11 +629,11 @@ OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pCo
     ,m_nLength(0)
 {
     if (eds_check_version( 3, 7, 6 ) == nullptr)
-        m_pVersionHelper  = new OEvoabVersion38Helper;
+        m_pVersionHelper  = o3tl::make_unique<OEvoabVersion38Helper>();
     else if (eds_check_version( 3, 6, 0 ) == nullptr)
-        m_pVersionHelper  = new OEvoabVersion36Helper;
+        m_pVersionHelper  = o3tl::make_unique<OEvoabVersion36Helper>();
     else
-        m_pVersionHelper  = new OEvoabVersion35Helper;
+        m_pVersionHelper  = o3tl::make_unique<OEvoabVersion35Helper>();
 
     #define REGISTER_PROP( id, member ) \
         registerProperty( \
@@ -650,9 +651,7 @@ OEvoabResultSet::OEvoabResultSet( OCommonStatement* pStmt, OEvoabConnection *pCo
 }
 
 OEvoabResultSet::~OEvoabResultSet()
-{
-    delete m_pVersionHelper;
-}
+{}
 
 void OEvoabResultSet::construct( const QueryData& _rData )
 {
@@ -716,8 +715,7 @@ void OEvoabResultSet::disposing()
     ::comphelper::OPropertyContainer::disposing();
 
     ::osl::MutexGuard aGuard(m_aMutex);
-    delete m_pVersionHelper;
-    m_pVersionHelper = nullptr;
+    m_pVersionHelper.reset();
     m_pStatement = nullptr;
     m_xMetaData.clear();
 }
diff --git a/connectivity/source/drivers/evoab2/NResultSet.hxx b/connectivity/source/drivers/evoab2/NResultSet.hxx
index 20cee23..422ef5a 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.hxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_EVOAB2_NRESULTSET_HXX
 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_EVOAB2_NRESULTSET_HXX
 
+#include <memory>
+
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
@@ -80,7 +82,7 @@ namespace connectivity
                                 ,public ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet>
         {
         private:
-            OEvoabVersionHelper *m_pVersionHelper;
+            std::unique_ptr<OEvoabVersionHelper> m_pVersionHelper;
 
         protected:
 


More information about the Libreoffice-commits mailing list