From 1b67ad6ff8979d8851db1223886bb03745845755 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 1 Feb 2018 13:54:31 +0200 Subject: 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 Reviewed-by: Noel Grandin --- connectivity/source/commontools/dbtools.cxx | 43 ---------------------- connectivity/source/drivers/ado/AConnection.cxx | 10 +---- connectivity/source/drivers/ado/AStatement.cxx | 4 +- connectivity/source/drivers/evoab2/NConnection.cxx | 9 +---- connectivity/source/drivers/evoab2/NConnection.hxx | 6 --- connectivity/source/drivers/evoab2/NResultSet.hxx | 1 - connectivity/source/drivers/evoab2/NStatement.cxx | 4 +- connectivity/source/drivers/evoab2/NStatement.hxx | 7 ---- connectivity/source/drivers/file/FConnection.cxx | 11 +----- connectivity/source/drivers/file/FStatement.cxx | 4 +- .../source/drivers/firebird/Connection.cxx | 7 ---- .../source/drivers/firebird/Connection.hxx | 8 +--- connectivity/source/drivers/firebird/ResultSet.hxx | 1 - .../drivers/firebird/StatementCommonBase.hxx | 1 - connectivity/source/drivers/jdbc/JConnection.cxx | 7 ---- connectivity/source/drivers/jdbc/JStatement.cxx | 7 ---- .../source/drivers/macab/MacabConnection.cxx | 11 +----- .../source/drivers/macab/MacabConnection.hxx | 10 +---- connectivity/source/drivers/mork/MConnection.cxx | 10 +---- connectivity/source/drivers/mork/MConnection.hxx | 8 +--- connectivity/source/drivers/mork/MStatement.cxx | 4 +- connectivity/source/drivers/mork/MStatement.hxx | 4 -- connectivity/source/drivers/odbc/OConnection.cxx | 10 +---- connectivity/source/drivers/odbc/OStatement.cxx | 9 +---- connectivity/source/inc/ado/AConnection.hxx | 8 +--- connectivity/source/inc/ado/AStatement.hxx | 4 +- connectivity/source/inc/file/FConnection.hxx | 9 +---- connectivity/source/inc/file/FStatement.hxx | 8 +--- connectivity/source/inc/java/sql/Connection.hxx | 5 --- connectivity/source/inc/java/sql/JStatement.hxx | 10 +---- connectivity/source/inc/odbc/OConnection.hxx | 6 --- connectivity/source/inc/odbc/OStatement.hxx | 13 ++----- connectivity/source/sdbcx/VCatalog.cxx | 8 ---- 33 files changed, 26 insertions(+), 241 deletions(-) (limited to 'connectivity/source') diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index daca0a341c63..834c7ba9aeda 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -81,7 +81,6 @@ #include #include #include -#include #include #include @@ -1944,48 +1943,6 @@ void getBooleanComparisonPredicate( const OUString& _rExpression, const bool _bV namespace connectivity { -void release(oslInterlockedCount& _refCount, - ::cppu::OBroadcastHelper& rBHelper, - Reference< XInterface >& _xInterface, - css::lang::XComponent* _pObject) throw () -{ - if (osl_atomic_decrement( &_refCount ) == 0) - { - osl_atomic_increment( &_refCount ); - - if (!rBHelper.bDisposed && !rBHelper.bInDispose) - { - // remember the parent - Reference< XInterface > xParent; - { - ::osl::MutexGuard aGuard( rBHelper.rMutex ); - xParent = _xInterface; - _xInterface = nullptr; - } - - // First dispose - try { - _pObject->dispose(); - } catch (css::uno::RuntimeException & e) { - SAL_WARN( - "connectivity.commontools", "Caught exception during dispose, " << e); - } - - // only the alive ref holds the object - OSL_ASSERT( _refCount == 1 ); - - // release the parent in the ~ - if (xParent.is()) - { - ::osl::MutexGuard aGuard( rBHelper.rMutex ); - _xInterface = xParent; - } - } - } - else - osl_atomic_increment( &_refCount ); -} - void checkDisposed(bool _bThrow) { if (_bThrow) diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index ad02964b85e3..049989f44786 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -45,8 +45,7 @@ using namespace com::sun::star::sdbcx; IMPLEMENT_SERVICE_INFO(OConnection,"com.sun.star.sdbcx.AConnection","com.sun.star.sdbc.Connection"); OConnection::OConnection(ODriver* _pDriver) - : OSubComponent(static_cast(_pDriver), this), - m_xCatalog(nullptr), + : m_xCatalog(nullptr), m_pDriver(_pDriver), m_pAdoConnection(nullptr), m_pCatalog(nullptr), @@ -153,11 +152,6 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& osl_atomic_decrement( &m_refCount ); } -void SAL_CALL OConnection::release() throw() -{ - release_ChildImpl(); -} - Reference< XStatement > SAL_CALL OConnection::createStatement( ) { ::osl::MutexGuard aGuard( m_aMutex ); @@ -490,8 +484,6 @@ void OConnection::disposing() delete m_pAdoConnection; m_pAdoConnection = nullptr; - - dispose_ChildImpl(); } sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) diff --git a/connectivity/source/drivers/ado/AStatement.cxx b/connectivity/source/drivers/ado/AStatement.cxx index 5bdf386468c4..f2ed68a78070 100644 --- a/connectivity/source/drivers/ado/AStatement.cxx +++ b/connectivity/source/drivers/ado/AStatement.cxx @@ -53,7 +53,6 @@ using namespace ::std; OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE(m_aMutex) ,OPropertySetHelper(OStatement_BASE::rBHelper) - ,OSubComponent(static_cast(_pConnection), this) ,m_pConnection(_pConnection) ,m_nMaxRows(0) ,m_nFetchSize(1) @@ -104,13 +103,12 @@ void OStatement_Base::disposing() if (m_pConnection) m_pConnection->release(); - dispose_ChildImpl(); OStatement_BASE::disposing(); } void SAL_CALL OStatement_Base::release() throw() { - release_ChildImpl(); + OStatement_BASE::release(); } Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) diff --git a/connectivity/source/drivers/evoab2/NConnection.cxx b/connectivity/source/drivers/evoab2/NConnection.cxx index fa6fd275e5b6..2971992b9dc1 100644 --- a/connectivity/source/drivers/evoab2/NConnection.cxx +++ b/connectivity/source/drivers/evoab2/NConnection.cxx @@ -41,8 +41,7 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::lang; OEvoabConnection::OEvoabConnection(OEvoabDriver& _rDriver) - : OSubComponent( static_cast(&_rDriver), this ) - , m_rDriver(_rDriver) + : m_rDriver(_rDriver) , m_eSDBCAddressType(SDBCAddress::EVO_LOCAL) , m_xCatalog(nullptr) { @@ -59,11 +58,6 @@ OEvoabConnection::~OEvoabConnection() } -void SAL_CALL OEvoabConnection::release() throw() -{ - release_ChildImpl(); -} - // XServiceInfo IMPLEMENT_SERVICE_INFO(OEvoabConnection, "com.sun.star.sdbc.drivers.evoab.Connection", "com.sun.star.sdbc.Connection") @@ -198,7 +192,6 @@ void OEvoabConnection::disposing() // we noticed that we should be destroyed in near future so we have to dispose our statements ::osl::MutexGuard aGuard(m_aMutex); OConnection_BASE::disposing(); - dispose_ChildImpl(); } // -------------------------------- stubbed methods ------------------------------------------------ diff --git a/connectivity/source/drivers/evoab2/NConnection.hxx b/connectivity/source/drivers/evoab2/NConnection.hxx index 3156985020ae..b7860bce0a3d 100644 --- a/connectivity/source/drivers/evoab2/NConnection.hxx +++ b/connectivity/source/drivers/evoab2/NConnection.hxx @@ -23,7 +23,6 @@ #include "NDriver.hxx" #include #include -#include #include #include #include @@ -49,10 +48,7 @@ namespace connectivity typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding class OEvoabConnection :public OConnection_BASE - ,public connectivity::OSubComponent { - friend class connectivity::OSubComponent; - private: const OEvoabDriver& m_rDriver; SDBCAddress::sdbc_address_type m_eSDBCAddressType; @@ -78,8 +74,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/drivers/evoab2/NResultSet.hxx b/connectivity/source/drivers/evoab2/NResultSet.hxx index f1128a77bd7b..40b0027cfe48 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.hxx +++ b/connectivity/source/drivers/evoab2/NResultSet.hxx @@ -40,7 +40,6 @@ #include #include #include "NStatement.hxx" -#include #include "NResultSetMetaData.hxx" namespace connectivity diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx index 17643d55f045..d21f41c10e56 100644 --- a/connectivity/source/drivers/evoab2/NStatement.cxx +++ b/connectivity/source/drivers/evoab2/NStatement.cxx @@ -70,7 +70,6 @@ EBookQuery * createTest( const OUString &aColumnName, OCommonStatement::OCommonStatement(OEvoabConnection* _pConnection) : OCommonStatement_IBase(m_aMutex) , ::comphelper::OPropertyContainer(OCommonStatement_IBase::rBHelper) - , OStatement_CBase( static_cast(_pConnection), this ) , m_xResultSet(nullptr) , m_xConnection(_pConnection) , m_aParser(_pConnection->getDriver().getComponentContext()) @@ -126,7 +125,6 @@ void OCommonStatement::disposing() m_xConnection.clear(); - dispose_ChildImpl(); OCommonStatement_IBase::disposing(); } @@ -532,7 +530,7 @@ void SAL_CALL OCommonStatement::acquire() throw() void SAL_CALL OCommonStatement::release() throw() { - release_ChildImpl(); + OCommonStatement_IBase::release(); } diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx b/connectivity/source/drivers/evoab2/NStatement.hxx index 65938fe47c9f..a2f918af0b9b 100644 --- a/connectivity/source/drivers/evoab2/NStatement.hxx +++ b/connectivity/source/drivers/evoab2/NStatement.hxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -147,17 +146,11 @@ namespace connectivity //************ Class: OCommonStatement // is a base class for the normal statement and for the prepared statement - class OCommonStatement; - typedef OSubComponent< OCommonStatement, OCommonStatement_IBase > OStatement_CBase; - class OCommonStatement :public cppu::BaseMutex ,public OCommonStatement_IBase ,public ::comphelper::OPropertyContainer ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement > - ,public OStatement_CBase { - friend class OSubComponent< OCommonStatement, OCommonStatement_IBase >; - private: css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created rtl::Reference m_xConnection; diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index ba5822a9696c..8012a33b31ed 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -56,8 +56,7 @@ using namespace ::ucbhelper; typedef connectivity::OMetaConnection OConnection_BASE; OConnection::OConnection(OFileDriver* _pDriver) - : OSubComponent(static_cast(_pDriver), this) - , m_pDriver(_pDriver) + : m_pDriver(_pDriver) , m_bAutoCommit(false) , m_bReadOnly(false) , m_bShowDeleted(false) @@ -74,12 +73,6 @@ OConnection::~OConnection() close(); } -void SAL_CALL OConnection::release() throw() -{ - release_ChildImpl(); -} - - bool OConnection::matchesExtension( const OUString& _rExt ) const { if ( isCaseSensitiveExtension() ) @@ -371,8 +364,6 @@ void OConnection::disposing() m_xDir.clear(); m_xContent.clear(); m_xCatalog = WeakReference< XTablesSupplier>(); - - dispose_ChildImpl(); } Reference< XTablesSupplier > OConnection::createCatalog() diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index e0ed9a16c35e..8c4c8bc2988e 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -122,8 +122,6 @@ void OStatement_BASE2::disposing() m_pConnection.clear(); - dispose_ChildImpl(); - if ( m_pParseTree ) { delete m_pParseTree; @@ -140,7 +138,7 @@ void SAL_CALL OStatement_Base::acquire() throw() void SAL_CALL OStatement_BASE2::release() throw() { - release_ChildImpl(); + OStatement_BASE::release(); } Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 9cb9fc340cc8..3c4ba3522020 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -83,7 +83,6 @@ static const OUStringLiteral our_sFBKLocation( "firebird.fbk" ); Connection::Connection(FirebirdDriver* _pDriver) : Connection_BASE(m_aMutex) - , OSubComponent(static_cast(_pDriver), this) , m_xDriver(_pDriver) , m_sConnectionURL() , m_sFirebirdURL() @@ -112,11 +111,6 @@ Connection::~Connection() close(); } -void SAL_CALL Connection::release() throw() -{ - release_ChildImpl(); -} - struct ConnectionGuard { oslInterlockedCount& m_refCount; @@ -928,7 +922,6 @@ void Connection::disposing() } // TODO: write to storage again? - dispose_ChildImpl(); cppu::WeakComponentImplHelperBase::disposing(); m_xDriver.clear(); diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx index e3c69e7e99c7..8f84b3f00113 100644 --- a/connectivity/source/drivers/firebird/Connection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -67,11 +66,8 @@ namespace connectivity typedef std::vector< ::connectivity::OTypeInfo> TTypeInfoVector; typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray; - class Connection : public Connection_BASE, - public connectivity::OSubComponent + class Connection : public Connection_BASE { - friend class connectivity::OSubComponent; - ::osl::Mutex m_aMutex; TTypeInfoVector m_aTypeInfo; // vector containing an entry @@ -218,8 +214,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/drivers/firebird/ResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx index aa7d2083c762..f6aac2e1dc1f 100644 --- a/connectivity/source/drivers/firebird/ResultSet.hxx +++ b/connectivity/source/drivers/firebird/ResultSet.hxx @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.hxx b/connectivity/source/drivers/firebird/StatementCommonBase.hxx index 856ebc807ff9..a127d42dfd09 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.hxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.hxx @@ -24,7 +24,6 @@ #include -#include #include #include diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 9ccc934255ee..5fdc586cc038 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -259,7 +259,6 @@ jclass java_sql_Connection::theClass = nullptr; java_sql_Connection::java_sql_Connection( const java_sql_Driver& _rDriver ) :java_lang_Object() - ,OSubComponent(static_cast(const_cast(&_rDriver)), this) ,m_xContext( _rDriver.getContext() ) ,m_pDriver( &_rDriver ) ,m_pDriverobject(nullptr) @@ -291,18 +290,12 @@ java_sql_Connection::~java_sql_Connection() } } -void SAL_CALL java_sql_Connection::release() throw() -{ - release_ChildImpl(); -} - void java_sql_Connection::disposing() { ::osl::MutexGuard aGuard(m_aMutex); m_aLogger.log( LogLevel::INFO, STR_LOG_SHUTDOWN_CONNECTION ); - dispose_ChildImpl(); java_sql_Connection_BASE::disposing(); if ( object ) diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index 16fbd290c197..fbbb0c9a36c9 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -89,7 +89,6 @@ void SAL_CALL OStatement_BASE2::disposing() ::comphelper::disposeComponent(m_xGeneratedStatement); m_pConnection.clear(); - dispose_ChildImpl(); java_sql_Statement_Base::disposing(); } @@ -109,12 +108,6 @@ void SAL_CALL java_sql_Statement_Base::disposing() } -void SAL_CALL OStatement_BASE2::release() throw() -{ - release_ChildImpl(); -} - - Any SAL_CALL java_sql_Statement_Base::queryInterface( const Type & rType ) { if ( m_pConnection.is() && !m_pConnection->isAutoRetrievingEnabled() && rType == cppu::UnoType::get()) diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx index fb3710df034d..eeea86def136 100644 --- a/connectivity/source/drivers/macab/MacabConnection.cxx +++ b/connectivity/source/drivers/macab/MacabConnection.cxx @@ -38,8 +38,7 @@ using namespace com::sun::star::sdbcx; IMPLEMENT_SERVICE_INFO(MacabConnection, "com.sun.star.sdbc.drivers.MacabConnection", "com.sun.star.sdbc.Connection") MacabConnection::MacabConnection(MacabDriver* _pDriver) - : OSubComponent(static_cast(_pDriver), this), - m_pAddressBook(nullptr), + : m_pAddressBook(nullptr), m_pDriver(_pDriver) { m_pDriver->acquire(); @@ -54,11 +53,6 @@ MacabConnection::~MacabConnection() m_pDriver = nullptr; } -void SAL_CALL MacabConnection::release() throw() -{ - release_ChildImpl(); -} - void MacabConnection::construct(const OUString&, const Sequence< PropertyValue >&) { osl_atomic_increment( &m_refCount ); @@ -279,9 +273,8 @@ void MacabConnection::disposing() m_pAddressBook = nullptr; } - m_xMetaData = css::uno::WeakReference< css::sdbc::XDatabaseMetaData>(); + m_xMetaData.clear(); - dispose_ChildImpl(); MacabConnection_BASE::disposing(); } diff --git a/connectivity/source/drivers/macab/MacabConnection.hxx b/connectivity/source/drivers/macab/MacabConnection.hxx index 38b41a13c0b3..976e2fde3758 100644 --- a/connectivity/source/drivers/macab/MacabConnection.hxx +++ b/connectivity/source/drivers/macab/MacabConnection.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MACAB_MACABCONNECTION_HXX #include -#include #include #include #include @@ -45,16 +44,12 @@ namespace connectivity class MacabDriver; class MacabAddressBook; - //typedef OMetaConnection_BASE MacabConnection_BASE; // implements basics and text encoding typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray; typedef connectivity::OMetaConnection MacabConnection_BASE; - class MacabConnection : public MacabConnection_BASE, - public OSubComponent + class MacabConnection : public MacabConnection_BASE { - friend class OSubComponent; - protected: // Data attributes @@ -74,9 +69,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; - // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 8ede63eb25fb..6dc6f2b19349 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -38,8 +38,7 @@ static const int defaultScope = 0x80; OConnection::OConnection(MorkDriver* _pDriver) - :OSubComponent(static_cast(_pDriver), this) - ,m_xDriver(_pDriver) + :m_xDriver(_pDriver) ,m_aColumnAlias( _pDriver->getFactory() ) { m_pBook = new MorkParser(); @@ -54,12 +53,6 @@ OConnection::~OConnection() delete m_pHistory; } -void SAL_CALL OConnection::release() throw() -{ - release_ChildImpl(); -} - - void OConnection::construct(const OUString& url) { SAL_INFO("connectivity.mork", "=> OConnection::construct()" ); @@ -349,7 +342,6 @@ void OConnection::disposing() { // we noticed that we should be destroyed in near future so we have to dispose our statements ::osl::MutexGuard aGuard(m_aMutex); - dispose_ChildImpl(); m_xCatalog.clear(); } diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index 3c2b2f179b10..6c7e8a7fac87 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -10,7 +10,6 @@ #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX -#include #include #include "MColumnAlias.hxx" @@ -28,11 +27,8 @@ namespace connectivity typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding - class OConnection final : public OConnection_BASE, - public connectivity::OSubComponent + class OConnection final : public OConnection_BASE { - friend class connectivity::OSubComponent; - // Data attributes rtl::Reference m_xDriver; // Pointer to the owning @@ -56,8 +52,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx index 34e94fa3f6e4..425eef8b898d 100644 --- a/connectivity/source/drivers/mork/MStatement.cxx +++ b/connectivity/source/drivers/mork/MStatement.cxx @@ -54,7 +54,6 @@ OStatement::OStatement( OConnection* _pConnection) : OCommonStatement( _pConnect OCommonStatement::OCommonStatement(OConnection* _pConnection ) :OCommonStatement_IBASE(m_aMutex) ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper) - ,OCommonStatement_SBASE(static_cast(_pConnection), this) ,m_pTable(nullptr) ,m_pConnection(_pConnection) ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) ) @@ -82,7 +81,6 @@ void OCommonStatement::disposing() m_pSQLIterator->dispose(); delete m_pParseTree; - dispose_ChildImpl(); OCommonStatement_IBASE::disposing(); } @@ -372,7 +370,7 @@ void SAL_CALL OCommonStatement::acquire() throw() void SAL_CALL OCommonStatement::release() throw() { - release_ChildImpl(); + OCommonStatement_IBASE::release(); } void SAL_CALL OStatement::acquire() throw() diff --git a/connectivity/source/drivers/mork/MStatement.hxx b/connectivity/source/drivers/mork/MStatement.hxx index dc4717915b45..71d980468ee5 100644 --- a/connectivity/source/drivers/mork/MStatement.hxx +++ b/connectivity/source/drivers/mork/MStatement.hxx @@ -43,16 +43,12 @@ namespace connectivity // is a base class for the normal statement and for the prepared statement class OCommonStatement; - typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE > OCommonStatement_SBASE; class OCommonStatement :public cppu::BaseMutex ,public OCommonStatement_IBASE ,public ::cppu::OPropertySetHelper ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement > - ,public OCommonStatement_SBASE { - friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >; - private: css::sdbc::SQLWarning m_aLastWarning; diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 5ec273fc82b3..d2fbcb436693 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -45,8 +45,7 @@ using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver) - : OSubComponent(static_cast(_pDriver), this) - ,m_xDriver(_pDriver) + :m_xDriver(_pDriver) ,m_aConnectionHandle(nullptr) ,m_pDriverHandleCopy(_pDriverHandle) ,m_nStatementCount(0) @@ -78,11 +77,6 @@ OConnection::~OConnection() } } -void SAL_CALL OConnection::release() throw() -{ - release_ChildImpl(); -} - oslGenericFunction OConnection::getOdbcFunction(ODBC3SQLFunctionId _nIndex) const { OSL_ENSURE(m_xDriver.get(),"OConnection::getOdbcFunction: m_xDriver is null!"); @@ -480,8 +474,6 @@ void OConnection::disposing() if(!m_bClosed) N3SQLDisconnect(m_aConnectionHandle); m_bClosed = true; - - dispose_ChildImpl(); } SQLHANDLE OConnection::createStatementHandle() diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 4ea8f46358b3..5f40aca6a69a 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -112,17 +112,10 @@ void SAL_CALL OStatement_Base::disposing() void OStatement_BASE2::disposing() { - ::osl::MutexGuard aGuard(m_aMutex); - - dispose_ChildImpl(); + ::osl::MutexGuard aGuard1(m_aMutex); OStatement_Base::disposing(); } -void SAL_CALL OStatement_BASE2::release() throw() -{ - release_ChildImpl(); -} - Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) { if ( m_pConnection.is() && !m_pConnection->isAutoRetrievingEnabled() && rType == cppu::UnoType::get()) diff --git a/connectivity/source/inc/ado/AConnection.hxx b/connectivity/source/inc/ado/AConnection.hxx index d546ab8ef154..a9c34814debe 100644 --- a/connectivity/source/inc/ado/AConnection.hxx +++ b/connectivity/source/inc/ado/AConnection.hxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -48,11 +47,8 @@ namespace connectivity typedef connectivity::OMetaConnection OConnection_BASE; - class OConnection : public OConnection_BASE, - public connectivity::OSubComponent + class OConnection : public OConnection_BASE { - friend class connectivity::OSubComponent; - protected: // Data attributes @@ -87,8 +83,6 @@ namespace connectivity DECLARE_SERVICE_INFO(); // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XConnection virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override; diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx index 3212f8220868..4f096b5fffc2 100644 --- a/connectivity/source/inc/ado/AStatement.hxx +++ b/connectivity/source/inc/ado/AStatement.hxx @@ -52,11 +52,9 @@ namespace connectivity class OStatement_Base : public cppu::BaseMutex, public OStatement_BASE, public ::cppu::OPropertySetHelper, - public ::comphelper::OPropertyArrayUsageHelper, - public connectivity::OSubComponent + public ::comphelper::OPropertyArrayUsageHelper { - friend class connectivity::OSubComponent; friend class OResultSet; css::sdbc::SQLWarning m_aLastWarning; diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx index fe535c9d0fdf..ddb3dbc63264 100644 --- a/connectivity/source/inc/file/FConnection.hxx +++ b/connectivity/source/inc/file/FConnection.hxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -42,12 +41,8 @@ namespace connectivity class ODatabaseMetaData; class OFileDriver; - class OOO_DLLPUBLIC_FILE OConnection : - public connectivity::OMetaConnection, - public connectivity::OSubComponent + class OOO_DLLPUBLIC_FILE OConnection : public connectivity::OMetaConnection { - friend class connectivity::OSubComponent; - protected: // Data attributes @@ -82,8 +77,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx index 936703b4d281..fd5006c83253 100644 --- a/connectivity/source/inc/file/FStatement.hxx +++ b/connectivity/source/inc/file/FStatement.hxx @@ -162,15 +162,11 @@ namespace connectivity virtual void SAL_CALL close( ) override; }; - class OOO_DLLPUBLIC_FILE OStatement_BASE2 : - public OStatement_Base, - public connectivity::OSubComponent + class OOO_DLLPUBLIC_FILE OStatement_BASE2 : public OStatement_Base { - friend class connectivity::OSubComponent; public: - OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ), - connectivity::OSubComponent(static_cast(_pConnection), this){} + OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ) {} // OComponentHelper virtual void SAL_CALL disposing() override; // XInterface diff --git a/connectivity/source/inc/java/sql/Connection.hxx b/connectivity/source/inc/java/sql/Connection.hxx index bab9329dfb1c..528f0eddf537 100644 --- a/connectivity/source/inc/java/sql/Connection.hxx +++ b/connectivity/source/inc/java/sql/Connection.hxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -39,10 +38,8 @@ namespace connectivity class java_sql_Connection : public java_sql_Connection_BASE, public java_lang_Object, - public OSubComponent, public OAutoRetrievingBase { - friend class OSubComponent; css::uno::Reference< css::uno::XComponentContext > m_xContext; const java_sql_Driver* m_pDriver; jobject m_pDriverobject; @@ -110,8 +107,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XConnection virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override; diff --git a/connectivity/source/inc/java/sql/JStatement.hxx b/connectivity/source/inc/java/sql/JStatement.hxx index 52b6c5fe5995..a6cde3aa2ac3 100644 --- a/connectivity/source/inc/java/sql/JStatement.hxx +++ b/connectivity/source/inc/java/sql/JStatement.hxx @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -196,19 +195,14 @@ namespace connectivity using ::cppu::OPropertySetHelper::getFastPropertyValue; }; - class OStatement_BASE2 :public java_sql_Statement_Base - ,public OSubComponent + class OStatement_BASE2 : public java_sql_Statement_Base { - friend class OSubComponent; public: - OStatement_BASE2(JNIEnv * pEnv, java_sql_Connection& _rCon ) : java_sql_Statement_Base( pEnv, _rCon ), - OSubComponent(static_cast(&_rCon), this){} + OStatement_BASE2(JNIEnv * pEnv, java_sql_Connection& _rCon ) : java_sql_Statement_Base( pEnv, _rCon ) {} // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; }; class java_sql_Statement : public OStatement_BASE2, diff --git a/connectivity/source/inc/odbc/OConnection.hxx b/connectivity/source/inc/odbc/OConnection.hxx index f9cd473b3b77..3cfda3792a8e 100644 --- a/connectivity/source/inc/odbc/OConnection.hxx +++ b/connectivity/source/inc/odbc/OConnection.hxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -46,11 +45,8 @@ namespace connectivity class OOO_DLLPUBLIC_ODBCBASE OConnection : public OConnection_BASE, - public connectivity::OSubComponent, public OAutoRetrievingBase { - friend class connectivity::OSubComponent; - protected: // Data attributes @@ -87,8 +83,6 @@ namespace connectivity // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx index e93f6c7ba5dd..29d4f51612ba 100644 --- a/connectivity/source/inc/odbc/OStatement.hxx +++ b/connectivity/source/inc/odbc/OStatement.hxx @@ -211,19 +211,14 @@ namespace connectivity using OPropertySetHelper::getFastPropertyValue; }; - class OOO_DLLPUBLIC_ODBCBASE OStatement_BASE2 : - public OStatement_Base - ,public ::connectivity::OSubComponent - + class OOO_DLLPUBLIC_ODBCBASE OStatement_BASE2 : public OStatement_Base { - friend class OSubComponent; public: - OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ), - ::connectivity::OSubComponent(static_cast(_pConnection), this){} + OStatement_BASE2(OConnection* _pConnection ) : + OStatement_Base(_pConnection ) + {} // OComponentHelper virtual void SAL_CALL disposing() override; - // XInterface - virtual void SAL_CALL release() throw() override; }; class OOO_DLLPUBLIC_ODBCBASE OStatement : diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx index 50d65c2a56c6..96f32461871e 100644 --- a/connectivity/source/sdbcx/VCatalog.cxx +++ b/connectivity/source/sdbcx/VCatalog.cxx @@ -37,7 +37,6 @@ using namespace ::com::sun::star::lang; IMPLEMENT_SERVICE_INFO(OCatalog,"com.sun.star.comp.connectivity.OCatalog","com.sun.star.sdbcx.DatabaseDefinition") OCatalog::OCatalog(const Reference< XConnection> &_xConnection) : OCatalog_BASE(m_aMutex) - ,connectivity::OSubComponent(_xConnection, this) ,m_pTables(nullptr) ,m_pViews(nullptr) ,m_pGroups(nullptr) @@ -57,12 +56,6 @@ OCatalog::~OCatalog() { } -void SAL_CALL OCatalog::release() throw() -{ - release_ChildImpl(); -} - - void SAL_CALL OCatalog::disposing() { ::osl::MutexGuard aGuard(m_aMutex); @@ -76,7 +69,6 @@ void SAL_CALL OCatalog::disposing() if(m_pUsers) m_pUsers->disposing(); - dispose_ChildImpl(); OCatalog_BASE::disposing(); } -- cgit v1.2.3