loplugin:useuniqueptr in ORowSet

hold this by rtl::Reference since we are taking references to it
elsewhere and passing them around.

Change-Id: Iae68d7da67cf84f01deb6bb42c00e4c74d7a99d7
Reviewed-on: https://gerrit.libreoffice.org/54169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-05-08 12:42:55 +02:00
parent 858e6b2664
commit a245e5c60f
3 changed files with 12 additions and 12 deletions

View File

@@ -135,7 +135,6 @@ ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext )
,m_aRowsetListeners(*m_pMutex)
,m_aApproveListeners(*m_pMutex)
,m_aRowsChangeListener(*m_pMutex)
,m_pTables(nullptr)
,m_nFetchDirection(FetchDirection::FORWARD)
,m_nFetchSize(50)
,m_nMaxFieldSize(0)
@@ -2244,9 +2243,9 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
{
xTables.set( xTablesAccess->getTables(), UNO_QUERY_THROW );
}
else if ( m_pTables )
else if ( m_xTables )
{
xTables = m_pTables;
xTables = m_xTables.get();
}
else
{
@@ -2264,10 +2263,10 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
m_pTables = new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend);
xTables = m_pTables;
m_xTables = new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend);
xTables = m_xTables.get();
Sequence<OUString> aTableFilter { "%" };
m_pTables->construct(aTableFilter,Sequence< OUString>());
m_xTables->construct(aTableFilter,Sequence< OUString>());
}
return xTables;
@@ -2275,19 +2274,19 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw()
void ORowSet::impl_resetTables_nothrow()
{
if ( !m_pTables )
if ( !m_xTables )
return;
try
{
m_pTables->dispose();
m_xTables->dispose();
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
DELETEZ( m_pTables );
m_xTables.clear();
}
void ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute )

View File

@@ -104,7 +104,7 @@ namespace dbaccess
::dbtools::WarningsContainer m_aWarnings;
OTableContainer* m_pTables;
rtl::Reference<OTableContainer> m_xTables;
OUString m_aCommand;
OUString m_aDataSourceName;

View File

@@ -64,8 +64,6 @@ namespace dbaccess
virtual void disposing() override;
virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();}
virtual void SAL_CALL release() throw() override { OFilteredContainer::release();}
// css::lang::XServiceInfo
DECLARE_SERVICE_INFO();
@@ -77,6 +75,9 @@ namespace dbaccess
virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
public:
virtual void SAL_CALL acquire() throw() override { OFilteredContainer::acquire();}
virtual void SAL_CALL release() throw() override { OFilteredContainer::release();}
/** ctor of the container. The parent has to support the <type scope="css::sdbc">XConnection</type>
interface.<BR>
@param _rParent the object which acts as parent for the container.