summaryrefslogtreecommitdiff
path: root/mysqlc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-01 13:54:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-02 11:21:36 +0100
commit1b67ad6ff8979d8851db1223886bb03745845755 (patch)
treef68fd6e34fcb3f1bb2b55b61e44cf0690a9f5f0a /mysqlc
parente91aa231ee934b2f18b387f37a6e9017b05f2256 (diff)
remove connectivity OSubComponent
push the logic that is still necessary down into the subclasses Change-Id: I99424f0b3c654c5652991a4140b17ceb02224e50 Reviewed-on: https://gerrit.libreoffice.org/49087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'mysqlc')
-rw-r--r--mysqlc/source/mysqlc_connection.cxx8
-rw-r--r--mysqlc/source/mysqlc_connection.hxx8
-rw-r--r--mysqlc/source/mysqlc_statement.cxx4
-rw-r--r--mysqlc/source/mysqlc_statement.hxx7
-rw-r--r--mysqlc/source/mysqlc_subcomponent.hxx33
5 files changed, 2 insertions, 58 deletions
diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index 65984285b81b..e53a3b560cb0 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -63,7 +63,6 @@ using ::osl::MutexGuard;
OConnection::OConnection(MysqlCDriver& _rDriver, sql::Driver * _cppDriver)
:OMetaConnection_BASE(m_aMutex)
- ,OSubComponent<OConnection, OConnection_BASE>(static_cast<cppu::OWeakObject*>(&_rDriver), this)
,m_xMetaData(nullptr)
,m_xDriver(&_rDriver)
,cppDriver(_cppDriver)
@@ -77,12 +76,6 @@ OConnection::~OConnection()
}
}
-void SAL_CALL OConnection::release()
- throw()
-{
- release_ChildImpl();
-}
-
void OConnection::construct(const rtl::OUString& url, const Sequence< PropertyValue >& info)
{
MutexGuard aGuard(m_aMutex);
@@ -505,7 +498,6 @@ void OConnection::disposing()
m_xMetaData = WeakReference< XDatabaseMetaData >();
- dispose_ChildImpl();
OConnection_BASE::disposing();
}
diff --git a/mysqlc/source/mysqlc_connection.hxx b/mysqlc/source/mysqlc_connection.hxx
index 63c121c99a2e..a305d6a9ab89 100644
--- a/mysqlc/source/mysqlc_connection.hxx
+++ b/mysqlc/source/mysqlc_connection.hxx
@@ -83,11 +83,8 @@ namespace connectivity
typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
class OConnection final : public OBase_Mutex,
- public OConnection_BASE,
- public connectivity::mysqlc::OSubComponent<OConnection, OConnection_BASE>
+ public OConnection_BASE
{
- friend class connectivity::mysqlc::OSubComponent<OConnection, OConnection_BASE>;
-
ConnectionSettings m_settings;
css::uno::Reference< css::container::XNameAccess > m_typeMap;
css::uno::Reference< css::util::XStringSubstitution > m_xParameterSubstitution;
@@ -120,9 +117,6 @@ namespace connectivity
// OComponentHelper
virtual void SAL_CALL disposing() SAL_OVERRIDE;
- // XInterface
- virtual void SAL_CALL release() throw() SAL_OVERRIDE;
-
// XServiceInfo
virtual rtl::OUString SAL_CALL getImplementationName() SAL_OVERRIDE;
diff --git a/mysqlc/source/mysqlc_statement.cxx b/mysqlc/source/mysqlc_statement.cxx
index 0448ac5dcabc..1d86127bd879 100644
--- a/mysqlc/source/mysqlc_statement.cxx
+++ b/mysqlc/source/mysqlc_statement.cxx
@@ -55,7 +55,6 @@ using ::osl::MutexGuard;
OCommonStatement::OCommonStatement(OConnection* _pConnection, sql::Statement *_cppStatement)
:OCommonStatement_IBase(m_aMutex)
,OPropertySetHelper(OCommonStatement_IBase::rBHelper)
- ,OStatement_CBase( static_cast<cppu::OWeakObject*>(_pConnection), this )
,m_xConnection(_pConnection)
,cppStatement(_cppStatement)
{
@@ -81,7 +80,6 @@ void OCommonStatement::disposing()
m_xConnection.clear();
delete cppStatement;
- dispose_ChildImpl();
OCommonStatement_IBase::disposing();
}
@@ -353,7 +351,7 @@ void SAL_CALL OCommonStatement::acquire()
void SAL_CALL OCommonStatement::release()
throw()
{
- release_ChildImpl();
+ OCommonStatement_IBase::release();
}
void SAL_CALL OStatement::acquire()
diff --git a/mysqlc/source/mysqlc_statement.hxx b/mysqlc/source/mysqlc_statement.hxx
index 5e9c0be3b611..1bb4d2a8d7be 100644
--- a/mysqlc/source/mysqlc_statement.hxx
+++ b/mysqlc/source/mysqlc_statement.hxx
@@ -51,10 +51,6 @@ namespace connectivity
css::sdbc::XCloseable,
css::sdbc::XMultipleResults> OCommonStatement_IBase;
- class OCommonStatement;
- typedef OSubComponent< OCommonStatement, OCommonStatement_IBase > OStatement_CBase;
-
-
//************ Class: OCommonStatement
// is a base class for the normal statement and for the prepared statement
@@ -62,11 +58,8 @@ namespace connectivity
,public OCommonStatement_IBase
,public ::cppu::OPropertySetHelper
,public OPropertyArrayUsageHelper<OCommonStatement>
- ,public OStatement_CBase
{
- friend class OSubComponent< OCommonStatement, OCommonStatement_IBase >;
-
private:
SQLWarning m_aLastWarning;
diff --git a/mysqlc/source/mysqlc_subcomponent.hxx b/mysqlc/source/mysqlc_subcomponent.hxx
index c0dc8eb3acb2..664f4bdd74c8 100644
--- a/mysqlc/source/mysqlc_subcomponent.hxx
+++ b/mysqlc/source/mysqlc_subcomponent.hxx
@@ -58,39 +58,6 @@ namespace connectivity
/// @throws css::lang::DisposedException
void checkDisposed(bool _bThrow);
- template <class SELF, class WEAK> class OSubComponent
- {
- protected:
- // the parent must support the tunnel implementation
- css::uno::Reference< css::uno::XInterface > m_xParent;
- SELF* m_pDerivedImplementation;
-
- public:
- OSubComponent(
- const css::uno::Reference< css::uno::XInterface >& _xParent,
- SELF* _pDerivedImplementation)
- :m_xParent(_xParent)
- ,m_pDerivedImplementation(_pDerivedImplementation)
- {
- }
-
- protected:
- void dispose_ChildImpl()
- {
- ::osl::MutexGuard aGuard(m_pDerivedImplementation->rBHelper.rMutex);
- m_xParent = nullptr;
- }
- void release_ChildImpl()
- {
- release(m_pDerivedImplementation->m_refCount,
- m_pDerivedImplementation->rBHelper,
- m_xParent,
- m_pDerivedImplementation);
-
- m_pDerivedImplementation->WEAK::release();
- }
- };
-
template <class TYPE>
class OPropertyArrayUsageHelper
{