diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-21 15:48:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-28 08:46:45 +0200 |
commit | 9aff9f22adf20aa0c00663648d1875e325b24d42 (patch) | |
tree | 1efa162271474938f2490adf2096505042eba1ed /dbaccess | |
parent | dc8e63784687292ffa178ff29f6fe2f9fd100eea (diff) |
loplugin:useuniqueptr in OQueryController
Change-Id: I13ca3ea6c27d4572274b70b0481a8479852b569a
Reviewed-on: https://gerrit.libreoffice.org/54857
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/inc/querycontroller.hxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 6e99796fc474..3f6df60719e8 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -61,9 +61,9 @@ namespace dbaui css::uno::Sequence< css::beans::PropertyValue > m_aFieldInformation; - ::svxform::OSystemParseContext* m_pParseContext; + std::unique_ptr<::svxform::OSystemParseContext> m_pParseContext; ::connectivity::OSQLParser m_aSqlParser; - ::connectivity::OSQLParseTreeIterator* m_pSqlIterator; + std::unique_ptr<::connectivity::OSQLParseTreeIterator> m_pSqlIterator; css::uno::Reference< css::sdb::XSQLQueryComposer > m_xComposer; /// if we're editing an existing view, this is non-NULL diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index f60e1a76f7b7..8f065adb3a43 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -239,8 +239,7 @@ OQueryController::OQueryController(const Reference< XComponentContext >& _rM) :OJoinController(_rM) ,OQueryController_PBase( getBroadcastHelper() ) ,m_pParseContext( new svxform::OSystemParseContext ) - ,m_aSqlParser( _rM, m_pParseContext ) - ,m_pSqlIterator(nullptr) + ,m_aSqlParser( _rM, m_pParseContext.get() ) ,m_nLimit(-1) ,m_nVisibleRows(0x400) ,m_nSplitPos(-1) @@ -343,8 +342,7 @@ void OQueryController::deleteIterator() { delete m_pSqlIterator->getParseTree(); m_pSqlIterator->dispose(); - delete m_pSqlIterator; - m_pSqlIterator = nullptr; + m_pSqlIterator.reset(); } } @@ -354,7 +352,7 @@ void OQueryController::disposing() deleteIterator(); - delete m_pParseContext; + m_pParseContext.reset(); clearFields(); OTableFields().swap(m_vUnUsedFieldsDesc); @@ -942,7 +940,7 @@ void OQueryController::setQueryComposer() OSL_ENSURE(m_xComposer.is(),"No querycomposer available!"); Reference<XTablesSupplier> xTablesSup(getConnection(), UNO_QUERY); deleteIterator(); - m_pSqlIterator = new ::connectivity::OSQLParseTreeIterator( getConnection(), xTablesSup->getTables(), m_aSqlParser ); + m_pSqlIterator.reset(new ::connectivity::OSQLParseTreeIterator( getConnection(), xTablesSup->getTables(), m_aSqlParser )); } } } |