summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-06-04 23:14:20 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-06 07:08:18 +0000
commit8a9559c59c0ee78cdab929b3e01fcd4bc9d569b2 (patch)
tree225db500e63a2f793a89f3d2f3395484da9475de
parente41d9a9ef9579c1f31dbca988d27f8320146a334 (diff)
tdf#89329: use unique_ptr for pImpl in TColumnHelper
Change-Id: I4a7594cb2a9424fddbd79e2b5d77431bf329eec9 Reviewed-on: https://gerrit.libreoffice.org/25903 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--connectivity/source/commontools/TColumnsHelper.cxx5
-rw-r--r--include/connectivity/TColumnsHelper.hxx2
2 files changed, 2 insertions, 5 deletions
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index 5d6fcf85e5b0..6cf821be8110 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -64,15 +64,12 @@ OColumnsHelper::OColumnsHelper( ::cppu::OWeakObject& _rParent
,const TStringVector &_rVector
,bool _bUseHardRef
) : OCollection(_rParent,_bCase,_rMutex,_rVector,false,_bUseHardRef)
- ,m_pImpl(nullptr)
,m_pTable(nullptr)
{
}
OColumnsHelper::~OColumnsHelper()
{
- delete m_pImpl;
- m_pImpl = nullptr;
}
@@ -82,7 +79,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const OUString& _rName)
Reference<XConnection> xConnection = m_pTable->getConnection();
if ( !m_pImpl )
- m_pImpl = new OColumnsHelperImpl(isCaseSensitive());
+ m_pImpl.reset(new OColumnsHelperImpl(isCaseSensitive()));
bool bQueryInfo = true;
bool bAutoIncrement = false;
diff --git a/include/connectivity/TColumnsHelper.hxx b/include/connectivity/TColumnsHelper.hxx
index 0c970aee722b..d4e52960ef12 100644
--- a/include/connectivity/TColumnsHelper.hxx
+++ b/include/connectivity/TColumnsHelper.hxx
@@ -33,7 +33,7 @@ namespace connectivity
*/
class OOO_DLLPUBLIC_DBTOOLS OColumnsHelper : public sdbcx::OCollection
{
- OColumnsHelperImpl* m_pImpl;
+ std::unique_ptr<OColumnsHelperImpl> m_pImpl;
protected:
OTableHelper* m_pTable;