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

Xisco Fauli anistenis at gmail.com
Mon Jun 6 07:08:39 UTC 2016


 connectivity/source/commontools/TColumnsHelper.cxx |    5 +----
 include/connectivity/TColumnsHelper.hxx            |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 8a9559c59c0ee78cdab929b3e01fcd4bc9d569b2
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sat Jun 4 23:14:20 2016 +0200

    tdf#89329: use unique_ptr for pImpl in TColumnHelper
    
    Change-Id: I4a7594cb2a9424fddbd79e2b5d77431bf329eec9
    Reviewed-on: https://gerrit.libreoffice.org/25903
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index 5d6fcf8..6cf821b 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 0c970ae..d4e5296 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;
 


More information about the Libreoffice-commits mailing list