summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/core/api/preparedstatement.cxx5
-rw-r--r--dbaccess/source/core/api/statement.cxx20
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx2
-rw-r--r--dbaccess/source/core/inc/callablestatement.hxx2
-rw-r--r--dbaccess/source/core/inc/connection.hxx (renamed from dbaccess/source/core/dataaccess/connection.hxx)8
-rw-r--r--dbaccess/source/core/inc/preparedstatement.hxx2
-rw-r--r--dbaccess/source/core/inc/statement.hxx11
-rw-r--r--solenv/clang-format/excludelist2
9 files changed, 30 insertions, 24 deletions
diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx
index 3691477a5ebd..ecb1a4c1e348 100644
--- a/dbaccess/source/core/api/preparedstatement.cxx
+++ b/dbaccess/source/core/api/preparedstatement.cxx
@@ -31,6 +31,7 @@
#include <strings.hxx>
#include "resultcolumn.hxx"
#include "resultset.hxx"
+#include <connection.hxx>
#include <comphelper/diagnose_ex.hxx>
using namespace ::com::sun::star::sdbc;
@@ -42,7 +43,7 @@ using namespace ::osl;
using namespace dbaccess;
-OPreparedStatement::OPreparedStatement(const Reference< XConnection > & _xConn,
+OPreparedStatement::OPreparedStatement(const rtl::Reference< OConnection > & _xConn,
const Reference< XInterface > & _xStatement)
:OStatementBase(_xConn, _xStatement)
{
@@ -220,7 +221,7 @@ sal_Bool OPreparedStatement::execute()
Reference< XConnection > OPreparedStatement::getConnection()
{
- return Reference< XConnection > (m_xParent, UNO_QUERY);
+ return m_xParent.get();
}
// XParameters
diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx
index 3a6dfe2a490e..7166de42a233 100644
--- a/dbaccess/source/core/api/statement.cxx
+++ b/dbaccess/source/core/api/statement.cxx
@@ -31,6 +31,7 @@
#include <comphelper/types.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <connectivity/dbexception.hxx>
+#include <connection.hxx>
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
@@ -43,10 +44,11 @@ using namespace dbaccess;
using namespace dbtools;
-OStatementBase::OStatementBase(const Reference< XConnection > & _xConn,
+OStatementBase::OStatementBase(const rtl::Reference< OConnection > & _xConn,
const Reference< XInterface > & _xStatement)
- :OSubComponent(m_aMutex, _xConn)
+ :WeakComponentImplHelper(m_aMutex)
,OPropertySetHelper(WeakComponentImplHelper::rBHelper)
+ ,m_xParent(_xConn.get())
,m_bUseBookmarks( false )
,m_bEscapeProcessing( true )
@@ -68,7 +70,7 @@ Sequence< Type > OStatementBase::getTypes()
cppu::UnoType<XCloseable>::get(),
cppu::UnoType<XMultipleResults>::get(),
cppu::UnoType<css::util::XCancellable>::get(),
- OSubComponent::getTypes() );
+ ::cppu::WeakComponentImplHelper<>::getTypes() );
Reference< XGeneratedResultSet > xGRes(m_xAggregateAsSet, UNO_QUERY);
if ( xGRes.is() )
aTypes = OTypeCollection(cppu::UnoType<XGeneratedResultSet>::get(),aTypes.getTypes());
@@ -82,7 +84,7 @@ Sequence< Type > OStatementBase::getTypes()
// css::uno::XInterface
Any OStatementBase::queryInterface( const Type & rType )
{
- Any aIface = OSubComponent::queryInterface( rType );
+ Any aIface = ::cppu::WeakComponentImplHelper<>::queryInterface( rType );
if (!aIface.hasValue())
{
aIface = ::cppu::queryInterface(
@@ -110,12 +112,12 @@ Any OStatementBase::queryInterface( const Type & rType )
void OStatementBase::acquire() noexcept
{
- OSubComponent::acquire();
+ ::cppu::WeakComponentImplHelper<>::acquire();
}
void OStatementBase::release() noexcept
{
- OSubComponent::release();
+ ::cppu::WeakComponentImplHelper<>::release();
}
void OStatementBase::disposeResultSet()
@@ -159,7 +161,7 @@ void OStatementBase::disposing()
m_xAggregateAsSet = nullptr;
// free the parent at last
- OSubComponent::disposing();
+ ::cppu::WeakComponentImplHelper<>::disposing();
}
// XCloseable
@@ -419,7 +421,7 @@ Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( )
// OStatement
-OStatement::OStatement( const Reference< XConnection >& _xConn, const Reference< XInterface > & _xStatement )
+OStatement::OStatement( const rtl::Reference< OConnection >& _xConn, const Reference< XInterface > & _xStatement )
:OStatementBase( _xConn, _xStatement )
,m_bAttemptedComposerCreation( false )
{
@@ -534,7 +536,7 @@ Sequence< sal_Int32 > OStatement::executeBatch( )
Reference< XConnection > OStatement::getConnection()
{
- return Reference< XConnection >( m_xParent, UNO_QUERY );
+ return m_xParent.get();
}
void SAL_CALL OStatement::disposing()
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index 2281226f8d7e..982303889a82 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -21,7 +21,7 @@
#include <iterator>
-#include "connection.hxx"
+#include <connection.hxx>
#include "datasource.hxx"
#include <strings.hrc>
#include <strings.hxx>
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index d97ede01612a..f8874911b960 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -23,7 +23,7 @@
#include <core_resource.hxx>
#include <strings.hrc>
#include <strings.hxx>
-#include "connection.hxx"
+#include <connection.hxx>
#include "SharedConnection.hxx"
#include "databasedocument.hxx"
#include <OAuthenticationContinuation.hxx>
diff --git a/dbaccess/source/core/inc/callablestatement.hxx b/dbaccess/source/core/inc/callablestatement.hxx
index 58e21189aa59..c5d7b94154d9 100644
--- a/dbaccess/source/core/inc/callablestatement.hxx
+++ b/dbaccess/source/core/inc/callablestatement.hxx
@@ -32,7 +32,7 @@ namespace dbaccess
public css::sdbc::XOutParameters
{
public:
- OCallableStatement(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ OCallableStatement(const rtl::Reference< OConnection > & _xConn,
const css::uno::Reference< css::uno::XInterface > & _xStatement)
:OPreparedStatement(_xConn, _xStatement){}
diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/inc/connection.hxx
index 4c1790207163..60d966ab64c5 100644
--- a/dbaccess/source/core/dataaccess/connection.hxx
+++ b/dbaccess/source/core/inc/connection.hxx
@@ -24,10 +24,10 @@
#include <cstddef>
#include <map>
-#include <querycontainer.hxx>
-#include <tablecontainer.hxx>
-#include <viewcontainer.hxx>
-#include <RefreshListener.hxx>
+#include "querycontainer.hxx"
+#include "tablecontainer.hxx"
+#include "viewcontainer.hxx"
+#include "RefreshListener.hxx"
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
diff --git a/dbaccess/source/core/inc/preparedstatement.hxx b/dbaccess/source/core/inc/preparedstatement.hxx
index cea06d79a81e..d39af31e13cb 100644
--- a/dbaccess/source/core/inc/preparedstatement.hxx
+++ b/dbaccess/source/core/inc/preparedstatement.hxx
@@ -42,7 +42,7 @@ namespace dbaccess
css::uno::Reference< css::sdbc::XParameters > m_xAggregateAsParameters;
public:
- OPreparedStatement(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ OPreparedStatement(const rtl::Reference< OConnection > & _xConn,
const css::uno::Reference< css::uno::XInterface > & _xStatement);
virtual ~OPreparedStatement() override;
diff --git a/dbaccess/source/core/inc/statement.hxx b/dbaccess/source/core/inc/statement.hxx
index f437040682fb..3ab67085164f 100644
--- a/dbaccess/source/core/inc/statement.hxx
+++ b/dbaccess/source/core/inc/statement.hxx
@@ -33,13 +33,15 @@
#include <comphelper/proparrhlp.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implbase3.hxx>
-#include <apitools.hxx>
+#include <cppuhelper/compbase.hxx>
+#include <unotools/weakref.hxx>
+namespace dbaccess { class OConnection; }
// OStatementBase
class OStatementBase : public cppu::BaseMutex,
- public OSubComponent,
+ public ::cppu::WeakComponentImplHelper<>,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper < OStatementBase >,
public css::util::XCancellable,
@@ -50,6 +52,7 @@ class OStatementBase : public cppu::BaseMutex,
public css::sdbc::XGeneratedResultSet
{
protected:
+ unotools::WeakReference<::dbaccess::OConnection> m_xParent;
::osl::Mutex m_aCancelMutex;
css::uno::WeakReferenceHelper m_aResultSet;
@@ -61,7 +64,7 @@ protected:
virtual ~OStatementBase() override;
public:
- OStatementBase(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ OStatementBase(const rtl::Reference< ::dbaccess::OConnection > & _xConn,
const css::uno::Reference< css::uno::XInterface > & _xStatement);
@@ -141,7 +144,7 @@ private:
bool m_bAttemptedComposerCreation;
public:
- OStatement(const css::uno::Reference< css::sdbc::XConnection > & _xConn,
+ OStatement(const rtl::Reference< ::dbaccess::OConnection > & _xConn,
const css::uno::Reference< css::uno::XInterface > & _xStatement);
DECLARE_XINTERFACE()
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index ab1aa49b892c..9075a86e174f 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -2603,7 +2603,6 @@ dbaccess/source/core/dataaccess/commandcontainer.hxx
dbaccess/source/core/dataaccess/commanddefinition.cxx
dbaccess/source/core/dataaccess/commanddefinition.hxx
dbaccess/source/core/dataaccess/connection.cxx
-dbaccess/source/core/dataaccess/connection.hxx
dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
dbaccess/source/core/dataaccess/databasecontext.cxx
dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -2642,6 +2641,7 @@ dbaccess/source/core/inc/column.hxx
dbaccess/source/core/inc/columnsettings.hxx
dbaccess/source/core/inc/commandbase.hxx
dbaccess/source/core/inc/composertools.hxx
+dbaccess/source/core/inc/connection.hxx
dbaccess/source/core/inc/containerapprove.hxx
dbaccess/source/core/inc/databasecontext.hxx
dbaccess/source/core/inc/datasettings.hxx