diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-04 16:45:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-05 08:58:52 +0200 |
commit | 65b7024b982c10b7998e7cb0fb2b8165b7a8ffb6 (patch) | |
tree | f520cb65d71b99ec1d94c0cf3afdd6cc203bec84 /svx | |
parent | 83243003b46dfb258c2b41049b0e1cb82a2d7ddb (diff) |
loplugin:useuniqueptr in DbGridControl
Change-Id: Ia5b1181ae58ce69871a66f58080435f8511cc815
Reviewed-on: https://gerrit.libreoffice.org/53883
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 8093bddd31b9..97d156337440 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -1013,11 +1013,7 @@ void DbGridControl::dispose() osl::MutexGuard aGuard(m_aDestructionSafety); if (m_pFieldListeners) DisconnectFromFields(); - if (m_pCursorDisposeListener) - { - delete m_pCursorDisposeListener; - m_pCursorDisposeListener = nullptr; - } + m_pCursorDisposeListener.reset(); } if (m_nDeleteEvent) @@ -1442,7 +1438,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo RemoveRows(); DisconnectFromFields(); - DELETEZ(m_pCursorDisposeListener); + m_pCursorDisposeListener.reset(); { ::osl::MutexGuard aGuard(m_aAdjustSafety); @@ -1640,7 +1636,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo // start listening on the seek cursor if (m_pSeekCursor) - m_pCursorDisposeListener = new DisposeListenerGridBridge(*this, Reference< XComponent > (Reference< XInterface >(*m_pSeekCursor), UNO_QUERY)); + m_pCursorDisposeListener.reset(new DisposeListenerGridBridge(*this, Reference< XComponent > (Reference< XInterface >(*m_pSeekCursor), UNO_QUERY))); } void DbGridControl::RemoveColumns() |