diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-23 11:39:49 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-23 11:39:49 +0100 |
commit | 7e5c140dd9816b30a1fa7d65200c1487d7e374d2 (patch) | |
tree | 4bbe6c95cf8d788356e73f139f5656031c10efb1 /connectivity | |
parent | 936fd770facefa49019abcf30b241b694b3afac9 (diff) |
loplugin:useuniqueptr
Change-Id: Ia0c8c3bb8319b5719bf63a3408d404d9adc681cc
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.hxx | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 9282773a779a..c01026062c4c 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 20cee2374744..422ef5ac7ee5 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: |