summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 09:31:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 09:04:59 +0000
commit2abe0df63c59637ea1b00703458edf71dff8167c (patch)
treee97b3820a3ff20a2b6b57491180973dac63cbbad /dbaccess
parent4883355c31dff1f3d89f0d99d76837e0b72131d3 (diff)
new loplugin: useuniqueptr: dbaccess
Change-Id: I2421cd032066c41f80e8b6560c8c4a73f26edeb2 Reviewed-on: https://gerrit.libreoffice.org/33151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx5
-rw-r--r--dbaccess/source/core/inc/TableDeco.hxx2
-rw-r--r--dbaccess/source/ui/misc/moduledbu.cxx7
3 files changed, 6 insertions, 8 deletions
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index 643ed9349ad3..54c82bc8b542 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -75,7 +75,6 @@ ODBTableDecorator::ODBTableDecorator( const Reference< XConnection >& _rxConnect
ODBTableDecorator::~ODBTableDecorator()
{
- delete m_pColumns;
}
Sequence< sal_Int8 > ODBTableDecorator::getImplementationId() throw (RuntimeException, std::exception)
@@ -453,7 +452,7 @@ Reference< XNameAccess> ODBTableDecorator::getColumns() throw (RuntimeException,
if(!m_pColumns)
refreshColumns();
- return m_pColumns;
+ return m_pColumns.get();
}
OUString SAL_CALL ODBTableDecorator::getName() throw(RuntimeException, std::exception)
@@ -577,7 +576,7 @@ void ODBTableDecorator::refreshColumns()
OContainerMediator* pMediator = new OContainerMediator( pCol, m_xColumnDefinitions );
m_xColumnMediator = pMediator;
pCol->setMediator( pMediator );
- m_pColumns = pCol;
+ m_pColumns.reset( pCol );
}
else
m_pColumns->reFill(aVector);
diff --git a/dbaccess/source/core/inc/TableDeco.hxx b/dbaccess/source/core/inc/TableDeco.hxx
index 1107014eff74..7c269f71501f 100644
--- a/dbaccess/source/core/inc/TableDeco.hxx
+++ b/dbaccess/source/core/inc/TableDeco.hxx
@@ -73,7 +73,7 @@ namespace dbaccess
// <properties>
mutable sal_Int32 m_nPrivileges;
// </properties>
- ::connectivity::sdbcx::OCollection* m_pColumns;
+ std::unique_ptr<::connectivity::sdbcx::OCollection> m_pColumns;
// IColumnFactory
virtual OColumn* createColumn(const OUString& _rName) const override;
diff --git a/dbaccess/source/ui/misc/moduledbu.cxx b/dbaccess/source/ui/misc/moduledbu.cxx
index 8e3086025908..8f1bba1d6354 100644
--- a/dbaccess/source/ui/misc/moduledbu.cxx
+++ b/dbaccess/source/ui/misc/moduledbu.cxx
@@ -35,7 +35,7 @@ namespace dbaui
*/
class OModuleImpl
{
- ResMgr* m_pResources;
+ std::unique_ptr<ResMgr> m_pResources;
public:
/// ctor
@@ -54,7 +54,6 @@ OModuleImpl::OModuleImpl()
OModuleImpl::~OModuleImpl()
{
- delete m_pResources;
}
ResMgr* OModuleImpl::getResManager()
@@ -64,9 +63,9 @@ ResMgr* OModuleImpl::getResManager()
if (!m_pResources)
{
// create a manager with a fixed prefix
- m_pResources = ResMgr::CreateResMgr("dbu");
+ m_pResources.reset( ResMgr::CreateResMgr("dbu") );
}
- return m_pResources;
+ return m_pResources.get();
}
// OModule