mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-26 15:45:26 +00:00
improve type-safety in dbaccess::OConnection
Change-Id: I39ebd277431407b65c5c4a80698714399d39330f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182531 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@ -111,7 +111,7 @@ Reference< XStatement > OConnection::createStatement()
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
checkDisposed();
|
||||
|
||||
Reference< XStatement > xStatement;
|
||||
rtl::Reference< OStatement > xStatement;
|
||||
Reference< XStatement > xMasterStatement = m_xMasterConnection->createStatement();
|
||||
if ( xMasterStatement.is() )
|
||||
{
|
||||
@ -127,7 +127,7 @@ Reference< XPreparedStatement > OConnection::prepareStatement(const OUString& s
|
||||
checkDisposed();
|
||||
|
||||
// TODO convert the SQL to SQL the driver understands
|
||||
Reference< XPreparedStatement > xStatement;
|
||||
rtl::Reference< OPreparedStatement > xStatement;
|
||||
Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareStatement(sql);
|
||||
if ( xMasterStatement.is() )
|
||||
{
|
||||
@ -142,7 +142,7 @@ Reference< XPreparedStatement > OConnection::prepareCall(const OUString& sql)
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
checkDisposed();
|
||||
|
||||
Reference< XPreparedStatement > xStatement;
|
||||
rtl::Reference< OCallableStatement > xStatement;
|
||||
Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareCall(sql);
|
||||
if ( xMasterStatement.is() )
|
||||
{
|
||||
@ -428,7 +428,7 @@ void OConnection::disposing()
|
||||
|
||||
for (auto const& statement : m_aStatements)
|
||||
{
|
||||
Reference<XComponent> xComp(statement.get(),UNO_QUERY);
|
||||
rtl::Reference<OStatementBase> xComp(statement.get());
|
||||
::comphelper::disposeComponent(xComp);
|
||||
}
|
||||
m_aStatements.clear();
|
||||
|
@ -49,6 +49,8 @@
|
||||
#include <connectivity/warningscontainer.hxx>
|
||||
#include <unotools/weakref.hxx>
|
||||
|
||||
class OStatementBase;
|
||||
|
||||
namespace dbaccess
|
||||
{
|
||||
|
||||
@ -76,7 +78,9 @@ class OConnection final :public OConnection_Base
|
||||
unotools::WeakReference<ODatabaseSource> m_xParent;
|
||||
css::uno::Reference< css::sdbcx::XTablesSupplier >
|
||||
m_xMasterTables; // just to avoid the recreation of the catalog
|
||||
connectivity::OWeakRefArray m_aStatements;
|
||||
// contains OStatement and OPreparedStatement
|
||||
std::vector<unotools::WeakReference<OStatementBase>>
|
||||
m_aStatements;
|
||||
rtl::Reference< OQueryContainer > m_xQueries;
|
||||
connectivity::OWeakRefArray m_aComposers;
|
||||
|
||||
|
Reference in New Issue
Block a user