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

Noel Grandin noel.grandin at collabora.co.uk
Mon Feb 5 06:54:17 UTC 2018


 connectivity/source/drivers/file/FStatement.cxx |    5 ++---
 connectivity/source/inc/file/FStatement.hxx     |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 748167da4e5a7f406d3fec93c9e61a534ec64037
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 30 09:37:27 2018 +0200

    loplugin:useuniqueptr in OStatement_Base
    
    Change-Id: I41bc59c7ff7d711e0fc877e843625fa54c96b6bc
    Reviewed-on: https://gerrit.libreoffice.org/49183
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 8c4c8bc2988e..765c7a542531 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -87,7 +87,6 @@ OStatement_Base::~OStatement_Base()
 {
     osl_atomic_increment( &m_refCount );
     disposing();
-    delete m_pSQLAnalyzer;
 }
 
 void OStatement_Base::disposeResultSet()
@@ -429,7 +428,7 @@ void OStatement_Base::construct(const OUString& sql)
     // create the column mapping
     createColumnMapping();
 
-    m_pSQLAnalyzer = new OSQLAnalyzer(m_pConnection.get());
+    m_pSQLAnalyzer.reset( new OSQLAnalyzer(m_pConnection.get()) );
 
     Reference<XIndexesSupplier> xIndexSup(xTunnel,UNO_QUERY);
     if(xIndexSup.is())
@@ -455,7 +454,7 @@ void OStatement_Base::initializeResultSet(OResultSet* _pResult)
 {
     GetAssignValues();
 
-    _pResult->setSqlAnalyzer(m_pSQLAnalyzer);
+    _pResult->setSqlAnalyzer(m_pSQLAnalyzer.get());
     _pResult->setOrderByColumns(m_aOrderbyColumnNumber);
     _pResult->setOrderByAscending(m_aOrderbyAscending);
     _pResult->setBindingRow(m_aRow);
diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
index fd5006c83253..bb759444fe5c 100644
--- a/connectivity/source/inc/file/FStatement.hxx
+++ b/connectivity/source/inc/file/FStatement.hxx
@@ -78,7 +78,7 @@ namespace connectivity
 
             rtl::Reference<OConnection>                 m_pConnection;// The owning Connection object
             connectivity::OSQLParseNode*                m_pParseTree;
-            OSQLAnalyzer*                               m_pSQLAnalyzer; //the sql analyzer used by the resultset
+            std::unique_ptr<OSQLAnalyzer>               m_pSQLAnalyzer; //the sql analyzer used by the resultset
 
             rtl::Reference<OFileTable>                  m_pTable;       // the current table
             OValueRefRow                                m_aSelectRow;


More information about the Libreoffice-commits mailing list