diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-29 13:30:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-05 07:53:02 +0100 |
commit | c81791db5506f2576fac0466c760479902e7ccc8 (patch) | |
tree | fdbad80173b196bea4e972135d39bd09a6657a16 /connectivity | |
parent | 987cd20a33b396aa105b0abbec175b5592486c8f (diff) |
loplugin:useuniqueptr in OConnection
Change-Id: I0f1069eefc6d0afa8aa852af76099e79c63cbed9
Reviewed-on: https://gerrit.libreoffice.org/49181
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mork/MConnection.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MConnection.hxx | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 6dc6f2b19349..74a1d1f7ec63 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -41,16 +41,16 @@ OConnection::OConnection(MorkDriver* _pDriver) :m_xDriver(_pDriver) ,m_aColumnAlias( _pDriver->getFactory() ) { - m_pBook = new MorkParser(); - m_pHistory = new MorkParser(); + m_pBook.reset( new MorkParser() ); + m_pHistory.reset( new MorkParser() ); } OConnection::~OConnection() { if(!isClosed()) close(); - delete m_pBook; - delete m_pHistory; + m_pBook.reset(); + m_pHistory.reset(); } void OConnection::construct(const OUString& url) diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index 6c7e8a7fac87..c512e12316d1 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -35,9 +35,9 @@ namespace connectivity // driver object OColumnAlias m_aColumnAlias; // Mork Parser (abook) - MorkParser* m_pBook; + std::unique_ptr<MorkParser> m_pBook; // Mork Parser (history) - MorkParser* m_pHistory; + std::unique_ptr<MorkParser> m_pHistory; // Store Catalog css::uno::Reference< css::sdbcx::XTablesSupplier> m_xCatalog; @@ -48,7 +48,7 @@ namespace connectivity virtual ~OConnection() override; const rtl::Reference<MorkDriver>& getDriver() {return m_xDriver;}; - MorkParser* getMorkParser(const OString& t) {return t == "CollectedAddressBook" ? m_pHistory : m_pBook;}; + MorkParser* getMorkParser(const OString& t) {return t == "CollectedAddressBook" ? m_pHistory.get() : m_pBook.get();}; // OComponentHelper virtual void SAL_CALL disposing() override; |