[Libreoffice-commits] core.git: connectivity/source include/connectivity
Noel Grandin
noel.grandin at collabora.co.uk
Tue Jan 17 06:34:54 UTC 2017
connectivity/source/commontools/TIndex.cxx | 4 ++--
connectivity/source/commontools/TKey.cxx | 4 ++--
connectivity/source/drivers/ado/AGroup.cxx | 2 +-
connectivity/source/drivers/ado/AIndex.cxx | 2 +-
connectivity/source/drivers/ado/AKey.cxx | 2 +-
connectivity/source/drivers/ado/AUser.cxx | 2 +-
connectivity/source/drivers/dbase/DIndex.cxx | 2 +-
connectivity/source/drivers/dbase/dindexnode.cxx | 3 +--
connectivity/source/drivers/mork/MDatabaseMetaData.cxx | 3 +--
connectivity/source/drivers/mork/MDatabaseMetaData.hxx | 3 ++-
connectivity/source/inc/dbase/dindexnode.hxx | 3 ++-
connectivity/source/sdbcx/VGroup.cxx | 3 +--
connectivity/source/sdbcx/VIndex.cxx | 3 +--
connectivity/source/sdbcx/VKey.cxx | 3 +--
connectivity/source/sdbcx/VUser.cxx | 3 +--
include/connectivity/sdbcx/VGroup.hxx | 2 +-
include/connectivity/sdbcx/VIndex.hxx | 2 +-
include/connectivity/sdbcx/VKey.hxx | 2 +-
include/connectivity/sdbcx/VUser.hxx | 2 +-
19 files changed, 23 insertions(+), 27 deletions(-)
New commits:
commit d9884a62a23b2a410e5b364308e06c37a67f9422
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jan 16 09:21:14 2017 +0200
new loplugin: useuniqueptr: connectivity
Change-Id: I016f6a62814f1e93373dc70f59893fa38361464b
Reviewed-on: https://gerrit.libreoffice.org/33149
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/connectivity/source/commontools/TIndex.cxx b/connectivity/source/commontools/TIndex.cxx
index 88f5d68..0adbc70 100644
--- a/connectivity/source/commontools/TIndex.cxx
+++ b/connectivity/source/commontools/TIndex.cxx
@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : connectivity::sdbcx::OIndex
{
construct();
::std::vector< OUString> aVector;
- m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+ m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) );
}
OIndexHelper::OIndexHelper( OTableHelper* _pTable,
@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns()
if(m_pColumns)
m_pColumns->reFill(aVector);
else
- m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+ m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) );
}
diff --git a/connectivity/source/commontools/TKey.cxx b/connectivity/source/commontools/TKey.cxx
index 057dce0..783aa53 100644
--- a/connectivity/source/commontools/TKey.cxx
+++ b/connectivity/source/commontools/TKey.cxx
@@ -98,9 +98,9 @@ void OTableKeyHelper::refreshColumns()
if ( m_pColumns )
- m_pColumns ->reFill(aVector);
+ m_pColumns->reFill(aVector);
else
- m_pColumns = new OKeyColumnsHelper(this,m_aMutex,aVector);
+ m_pColumns.reset( new OKeyColumnsHelper(this,m_aMutex,aVector) );
}
diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx
index 2ff16b1..ab1eb1f 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -79,7 +79,7 @@ void OAdoGroup::refreshUsers()
if(m_pUsers)
m_pUsers->reFill(aVector);
else
- m_pUsers = new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
+ m_pUsers.reset( new OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive()) );
}
Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx
index d5b4417..b907873 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -68,7 +68,7 @@ void OAdoIndex::refreshColumns()
if ( m_pColumns )
m_pColumns->reFill(aVector);
else
- m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+ m_pColumns.reset( new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) );
}
diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx
index 8c3657d..cc1e13c 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -64,7 +64,7 @@ void OAdoKey::refreshColumns()
if(m_pColumns)
m_pColumns->reFill(aVector);
else
- m_pColumns = new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+ m_pColumns.reset( new OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) );
}
Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx
index 3894307..d874eb2 100644
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ b/connectivity/source/drivers/ado/AUser.cxx
@@ -63,7 +63,7 @@ void OAdoUser::refreshGroups()
if(m_pGroups)
m_pGroups->reFill(aVector);
else
- m_pGroups = new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive());
+ m_pGroups.reset( new OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive()) );
}
Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 5498b98..416ad8d 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -103,7 +103,7 @@ void ODbaseIndex::refreshColumns()
if(m_pColumns)
m_pColumns->reFill(aVector);
else
- m_pColumns = new ODbaseIndexColumns(this,m_aMutex,aVector);
+ m_pColumns.reset( new ODbaseIndexColumns(this,m_aMutex,aVector) );
}
Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index d9b156e..171906d 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -75,12 +75,11 @@ ONDXPage::ONDXPage(ODbaseIndex& rInd, sal_uInt32 nPos, ONDXPage* pParent)
, ppNodes(nullptr)
{
sal_uInt16 nT = rIndex.getHeader().db_maxkeys;
- ppNodes = new ONDXNode[nT];
+ ppNodes.reset( new ONDXNode[nT] );
}
ONDXPage::~ONDXPage()
{
- delete[] ppNodes;
}
void ONDXPage::ReleaseRef()
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
index debc927..9dfdcc3 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
@@ -39,14 +39,13 @@ namespace connectivity
ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
: ::connectivity::ODatabaseMetaDataBase(_pCon,_pCon->getConnectionInfo())
,m_pConnection(_pCon)
+ ,m_pMetaDataHelper(new MDatabaseMetaDataHelper)
{
OSL_ENSURE(m_pConnection,"ODatabaseMetaData::ODatabaseMetaData: No connection set!");
- m_pMetaDataHelper = new MDatabaseMetaDataHelper();
}
ODatabaseMetaData::~ODatabaseMetaData()
{
- delete m_pMetaDataHelper;
}
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
index 74c7b8e..2c991d0 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
@@ -24,7 +24,8 @@ namespace connectivity
class ODatabaseMetaData : public ODatabaseMetaDataBase
{
OConnection* m_pConnection;
- MDatabaseMetaDataHelper* m_pMetaDataHelper;
+ std::unique_ptr<MDatabaseMetaDataHelper>
+ m_pMetaDataHelper;
ODatabaseMetaDataResultSet::ORows& SAL_CALL getColumnRows( const OUString& tableNamePattern, const OUString& columnNamePattern ) throw( css::sdbc::SQLException );
diff --git a/connectivity/source/inc/dbase/dindexnode.hxx b/connectivity/source/inc/dbase/dindexnode.hxx
index 7adf900..4e19f19 100644
--- a/connectivity/source/inc/dbase/dindexnode.hxx
+++ b/connectivity/source/inc/dbase/dindexnode.hxx
@@ -129,7 +129,8 @@ namespace connectivity
ONDXPagePtr aParent, // Parent page
aChild; // Pointer to the right child page
ODbaseIndex& rIndex;
- ONDXNode* ppNodes; // Array of nodes
+ std::unique_ptr<ONDXNode[]>
+ ppNodes; // Array of nodes
public:
// Node operations
diff --git a/connectivity/source/sdbcx/VGroup.cxx b/connectivity/source/sdbcx/VGroup.cxx
index 21ac504..e1f9ea3 100644
--- a/connectivity/source/sdbcx/VGroup.cxx
+++ b/connectivity/source/sdbcx/VGroup.cxx
@@ -52,7 +52,6 @@ OGroup::OGroup(const OUString& Name, bool _bCase) : OGroup_BASE(m_aMutex)
OGroup::~OGroup()
{
- delete m_pUsers;
}
Any SAL_CALL OGroup::queryInterface( const Type & rType ) throw(RuntimeException, std::exception)
@@ -108,7 +107,7 @@ Reference< XNameAccess > SAL_CALL OGroup::getUsers( ) throw(RuntimeException, s
// allowed
}
- return m_pUsers;
+ return m_pUsers.get();
}
diff --git a/connectivity/source/sdbcx/VIndex.cxx b/connectivity/source/sdbcx/VIndex.cxx
index a0dacf1..120222b 100644
--- a/connectivity/source/sdbcx/VIndex.cxx
+++ b/connectivity/source/sdbcx/VIndex.cxx
@@ -88,7 +88,6 @@ OIndex::OIndex( const OUString& Name,
OIndex::~OIndex( )
{
- delete m_pColumns;
}
::cppu::IPropertyArrayHelper* OIndex::createArrayHelper( sal_Int32 /*_nId*/ ) const
@@ -163,7 +162,7 @@ Reference< css::container::XNameAccess > SAL_CALL OIndex::getColumns( ) throw(R
OSL_FAIL( "OIndex::getColumns: caught an exception!" );
}
- return m_pColumns;
+ return m_pColumns.get();
}
Reference< XPropertySet > SAL_CALL OIndex::createDataDescriptor( ) throw(RuntimeException, std::exception)
diff --git a/connectivity/source/sdbcx/VKey.cxx b/connectivity/source/sdbcx/VKey.cxx
index 8eaf5e7..a3c15cd 100644
--- a/connectivity/source/sdbcx/VKey.cxx
+++ b/connectivity/source/sdbcx/VKey.cxx
@@ -92,7 +92,6 @@ OKey::OKey(const OUString& Name,const std::shared_ptr<KeyProperties>& _rProps, b
OKey::~OKey( )
{
- delete m_pColumns;
}
Any SAL_CALL OKey::queryInterface( const Type & rType ) throw(RuntimeException, std::exception)
@@ -171,7 +170,7 @@ Reference< css::container::XNameAccess > SAL_CALL OKey::getColumns( ) throw(Run
// allowed
}
- return m_pColumns;
+ return m_pColumns.get();
}
Reference< XPropertySet > SAL_CALL OKey::createDataDescriptor( ) throw(RuntimeException, std::exception)
diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx
index 88e7cb2..e77b55b 100644
--- a/connectivity/source/sdbcx/VUser.cxx
+++ b/connectivity/source/sdbcx/VUser.cxx
@@ -53,7 +53,6 @@ OUser::OUser(const OUString& Name, bool _bCase) : OUser_BASE(m_aMutex)
OUser::~OUser( )
{
- delete m_pGroups;
}
void OUser::disposing()
@@ -117,7 +116,7 @@ Reference< XNameAccess > SAL_CALL OUser::getGroups( ) throw(RuntimeException, s
// allowed
}
- return m_pGroups;
+ return m_pGroups.get();
}
diff --git a/include/connectivity/sdbcx/VGroup.hxx b/include/connectivity/sdbcx/VGroup.hxx
index 3ab99f5..06634a0 100644
--- a/include/connectivity/sdbcx/VGroup.hxx
+++ b/include/connectivity/sdbcx/VGroup.hxx
@@ -55,7 +55,7 @@ namespace connectivity
public ODescriptor
{
protected:
- OUsers* m_pUsers;
+ std::unique_ptr<OUsers> m_pUsers;
using OGroup_BASE::rBHelper;
diff --git a/include/connectivity/sdbcx/VIndex.hxx b/include/connectivity/sdbcx/VIndex.hxx
index 65738a7..a7b75f7 100644
--- a/include/connectivity/sdbcx/VIndex.hxx
+++ b/include/connectivity/sdbcx/VIndex.hxx
@@ -56,7 +56,7 @@ namespace connectivity
bool m_IsPrimaryKeyIndex;
bool m_IsClustered;
- OCollection* m_pColumns;
+ std::unique_ptr<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper;
virtual void refreshColumns() override;
diff --git a/include/connectivity/sdbcx/VKey.hxx b/include/connectivity/sdbcx/VKey.hxx
index 2290ed7..cabf0b5 100644
--- a/include/connectivity/sdbcx/VKey.hxx
+++ b/include/connectivity/sdbcx/VKey.hxx
@@ -69,7 +69,7 @@ namespace connectivity
{
protected:
std::shared_ptr<KeyProperties> m_aProps;
- OCollection* m_pColumns;
+ std::unique_ptr<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper;
// OPropertyArrayUsageHelper
diff --git a/include/connectivity/sdbcx/VUser.hxx b/include/connectivity/sdbcx/VUser.hxx
index 0bef5e9..fd4cb5c 100644
--- a/include/connectivity/sdbcx/VUser.hxx
+++ b/include/connectivity/sdbcx/VUser.hxx
@@ -52,7 +52,7 @@ namespace connectivity
public ODescriptor
{
protected:
- OGroups* m_pGroups;
+ std::unique_ptr<OGroups> m_pGroups;
using OUser_BASE::rBHelper;
More information about the Libreoffice-commits
mailing list