diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 14:39:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-18 08:35:05 +0200 |
commit | 2ed9c74136b3d20aa837632a1f9ad8259f808e86 (patch) | |
tree | 49eeed795788fd4ac567a2d18ed2eda069d1f23d /dbaccess/source/ui/misc | |
parent | a4d0eef39b063dad1fe3565feb6d2c9932b87216 (diff) |
use rtl::Reference in ODatabaseContext
Change-Id: I6ed51a1eabe240c199b9f250744729b19efdd24e
Reviewed-on: https://gerrit.libreoffice.org/43457
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui/misc')
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index c92c7af6df52..402cdf4a0ea8 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -84,7 +84,6 @@ ODatabaseImportExport::ODatabaseImportExport(const svx::ODataAccessDescriptor& _ ,m_xContext(_rM) ,m_nCommandType(CommandType::TABLE) ,m_bNeedToReInitialize(false) - ,m_pReader(nullptr) ,m_bInInitialize(false) ,m_bCheckOnly(false) { @@ -105,7 +104,6 @@ ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& ,m_xContext(_rM) ,m_nCommandType(css::sdb::CommandType::TABLE) ,m_bNeedToReInitialize(false) - ,m_pReader(nullptr) ,m_bInInitialize(false) ,m_bCheckOnly(false) { @@ -123,11 +121,7 @@ ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& ODatabaseImportExport::~ODatabaseImportExport() { acquire(); - dispose(); - - if(m_pReader) - m_pReader->release(); } void ODatabaseImportExport::dispose() @@ -575,13 +569,10 @@ bool ORTFImportExport::Read() SvParserState eState = SvParserState::Error; if ( m_pStream ) { - m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); - static_cast<ORTFReader*>(m_pReader)->AddFirstRef(); + tools::SvRef<ORTFReader> xReader(new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext)); if ( isCheckEnabled() ) - m_pReader->enableCheckOnly(); - eState = static_cast<ORTFReader*>(m_pReader)->CallParser(); - m_pReader->release(); - m_pReader = nullptr; + xReader->enableCheckOnly(); + eState = xReader->CallParser(); } return eState != SvParserState::Error; @@ -645,14 +636,11 @@ bool OHTMLImportExport::Read() SvParserState eState = SvParserState::Error; if ( m_pStream ) { - m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); - static_cast<OHTMLReader*>(m_pReader)->AddFirstRef(); + tools::SvRef<OHTMLReader> xReader(new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext)); if ( isCheckEnabled() ) - m_pReader->enableCheckOnly(); - m_pReader->SetTableName(m_sDefaultTableName); - eState = static_cast<OHTMLReader*>(m_pReader)->CallParser(); - m_pReader->release(); - m_pReader = nullptr; + xReader->enableCheckOnly(); + xReader->SetTableName(m_sDefaultTableName); + eState = xReader->CallParser(); } return eState != SvParserState::Error; |