diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-19 17:06:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-20 14:13:35 +0200 |
commit | 809e2d33b45b54b4438a4c55aed93efd73d2aa49 (patch) | |
tree | 27f4995f949f25e7f26b3ac94028cecf0624ecb8 | |
parent | Remove useless if() condition (diff) | |
download | core-809e2d33b45b54b4438a4c55aed93efd73d2aa49.tar.gz core-809e2d33b45b54b4438a4c55aed93efd73d2aa49.zip |
create comphelper::RefCountedMutex
and merge the two existing implementations of the idea - SotMutexHolder
from package and RefCountedMutex from connectivity
Change-Id: I87f09f359ac798cf934381a2c75225dab71dd43e
Reviewed-on: https://gerrit.libreoffice.org/38972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
81 files changed, 610 insertions, 622 deletions
diff --git a/comphelper/source/misc/sharedmutex.cxx b/comphelper/source/misc/sharedmutex.cxx index 21188c3cfe01..e53e2700d76f 100644 --- a/comphelper/source/misc/sharedmutex.cxx +++ b/comphelper/source/misc/sharedmutex.cxx @@ -19,6 +19,7 @@ #include <comphelper/sharedmutex.hxx> +#include <comphelper/refcountedmutex.hxx> namespace comphelper @@ -43,6 +44,10 @@ namespace comphelper return *this; } + RefCountedMutex::~RefCountedMutex() + { + } + } // namespace comphelper diff --git a/connectivity/Library_postgresql-sdbc-impl.mk b/connectivity/Library_postgresql-sdbc-impl.mk index 2ff0b635b890..53cebd01a242 100644 --- a/connectivity/Library_postgresql-sdbc-impl.mk +++ b/connectivity/Library_postgresql-sdbc-impl.mk @@ -20,6 +20,7 @@ $(eval $(call gb_Library_set_precompiled_header,postgresql-sdbc-impl,$(SRCDIR)/c $(eval $(call gb_Library_use_sdk_api,postgresql-sdbc-impl)) $(eval $(call gb_Library_use_libraries,postgresql-sdbc-impl,\ + comphelper \ cppu \ cppuhelper \ dbtools \ diff --git a/connectivity/Library_postgresql-sdbc.mk b/connectivity/Library_postgresql-sdbc.mk index 8f7efcd02995..48613ab91bfc 100644 --- a/connectivity/Library_postgresql-sdbc.mk +++ b/connectivity/Library_postgresql-sdbc.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Library_use_libraries,postgresql-sdbc,\ cppu \ cppuhelper \ sal \ + salhelper \ )) $(eval $(call gb_Library_set_componentfile,postgresql-sdbc,connectivity/source/drivers/postgresql/postgresql-sdbc)) diff --git a/connectivity/source/drivers/postgresql/pq_array.cxx b/connectivity/source/drivers/postgresql/pq_array.cxx index 77b509bd641d..d89fe00f4ca6 100644 --- a/connectivity/source/drivers/postgresql/pq_array.cxx +++ b/connectivity/source/drivers/postgresql/pq_array.cxx @@ -102,7 +102,7 @@ css::uno::Reference< css::sdbc::XResultSet > Array::getResultSetAtIndex( } return new SequenceResultSet( - m_refMutex, m_owner, getStatics().resultSetArrayColumnNames, ret, m_tc ); + m_xMutex, m_owner, getStatics().resultSetArrayColumnNames, ret, m_tc ); } diff --git a/connectivity/source/drivers/postgresql/pq_array.hxx b/connectivity/source/drivers/postgresql/pq_array.hxx index 41f5ee9f7056..c0ed6aa97efd 100644 --- a/connectivity/source/drivers/postgresql/pq_array.hxx +++ b/connectivity/source/drivers/postgresql/pq_array.hxx @@ -50,18 +50,18 @@ class Array : public cppu::WeakImplHelper< css::sdbc::XArray > std::vector< css::uno::Any > m_data; css::uno::Reference< css::uno::XInterface > m_owner; css::uno::Reference< css::script::XTypeConverter > m_tc; - rtl::Reference< RefCountedMutex > m_refMutex; + rtl::Reference< comphelper::RefCountedMutex > m_xMutex; public: Array( - const rtl::Reference< RefCountedMutex > & mutex, + const rtl::Reference< comphelper::RefCountedMutex > & mutex, const std::vector< css::uno::Any > & data, const css::uno::Reference< css::uno::XInterface > & owner, const css::uno::Reference< css::script::XTypeConverter > &tc) : m_data( data ), m_owner( owner ), m_tc( tc ), - m_refMutex( mutex ) + m_xMutex( mutex ) {} public: // XArray diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx index 3d96f771e346..2c7498271cb9 100644 --- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx @@ -126,16 +126,16 @@ static ::cppu::IPropertyArrayHelper & getResultSetPropertyArrayHelper() } BaseResultSet::BaseResultSet( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< XInterface > & owner, sal_Int32 rowCount, sal_Int32 colCount, const Reference< css::script::XTypeConverter > & tc ) - : BaseResultSet_BASE( refMutex->mutex ) + : BaseResultSet_BASE( refMutex->GetMutex() ) , OPropertySetHelper( BaseResultSet_BASE::rBHelper ) , m_owner( owner ) , m_tc( tc ) - , m_refMutex( refMutex ) + , m_xMutex( refMutex ) , m_row( -1 ) , m_rowCount( rowCount ) , m_fieldCount( colCount ) @@ -144,7 +144,7 @@ BaseResultSet::BaseResultSet( POSTGRE_TRACE( "ctor BaseResultSet" ); } -// LEM TODO: refMutex->mutex should live longer than OComponentHelper, +// LEM TODO: refMutex->GetMutex() should live longer than OComponentHelper, // but calling OComponentHelper::dispose explicitly here calls // BaseResultSet::~BaseResultSet in an infinite loop :( BaseResultSet::~BaseResultSet() @@ -201,12 +201,12 @@ Sequence< sal_Int8> BaseResultSet::getImplementationId() // { // ResultSetGuard guard(*this); // checkClosed(); -// return new ResultSetMetaData( m_refMutex, this, &m_result ); +// return new ResultSetMetaData( m_xMutex, this, &m_result ); // } sal_Bool BaseResultSet::next( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); m_row ++; return m_row < m_rowCount; @@ -214,49 +214,49 @@ sal_Bool BaseResultSet::next( ) sal_Bool BaseResultSet::isBeforeFirst( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_row == -1; } sal_Bool BaseResultSet::isAfterLast( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_row >= m_rowCount; } sal_Bool BaseResultSet::isFirst( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_row == 0 && m_rowCount; } sal_Bool BaseResultSet::isLast( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_row >= 0 && m_row + 1 == m_rowCount; } void BaseResultSet::beforeFirst( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); m_row = -1; } void BaseResultSet::afterLast( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); m_row = m_rowCount; } sal_Bool BaseResultSet::first( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); bool bRet = ( m_rowCount > 0 ); if( bRet ) @@ -266,7 +266,7 @@ sal_Bool BaseResultSet::first( ) sal_Bool BaseResultSet::last( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); bool bRet = ( m_rowCount > 0 ); if( bRet ) @@ -276,14 +276,14 @@ sal_Bool BaseResultSet::last( ) sal_Int32 BaseResultSet::getRow( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_row +1; } sal_Bool BaseResultSet::absolute( sal_Int32 row ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); if( row > 0 ) { @@ -302,7 +302,7 @@ sal_Bool BaseResultSet::absolute( sal_Int32 row ) sal_Bool BaseResultSet::relative( sal_Int32 rows ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); m_row += rows; @@ -315,7 +315,7 @@ sal_Bool BaseResultSet::relative( sal_Int32 rows ) sal_Bool BaseResultSet::previous( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); bool bRet = ( m_row != -1 ); if( bRet ) @@ -345,7 +345,7 @@ sal_Bool BaseResultSet::rowDeleted( ) Reference< XInterface > BaseResultSet::getStatement() { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return m_owner; } @@ -374,7 +374,7 @@ Any BaseResultSet::convertTo( const Any & val , const Type & type ) sal_Bool BaseResultSet::getBoolean( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -399,7 +399,7 @@ sal_Bool BaseResultSet::getBoolean( sal_Int32 columnIndex ) sal_Int8 BaseResultSet::getByte( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -410,7 +410,7 @@ sal_Int8 BaseResultSet::getByte( sal_Int32 columnIndex ) sal_Int16 BaseResultSet::getShort( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -421,7 +421,7 @@ sal_Int16 BaseResultSet::getShort( sal_Int32 columnIndex ) OUString BaseResultSet::getString( sal_Int32 columnIndex ) { - MutexGuard guard(m_refMutex->mutex); + MutexGuard guard(m_xMutex->GetMutex()); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -433,7 +433,7 @@ OUString BaseResultSet::getString( sal_Int32 columnIndex ) sal_Int32 BaseResultSet::getInt( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -444,7 +444,7 @@ sal_Int32 BaseResultSet::getInt( sal_Int32 columnIndex ) sal_Int64 BaseResultSet::getLong( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -455,7 +455,7 @@ sal_Int64 BaseResultSet::getLong( sal_Int32 columnIndex ) float BaseResultSet::getFloat( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -466,7 +466,7 @@ float BaseResultSet::getFloat( sal_Int32 columnIndex ) double BaseResultSet::getDouble( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); double d = 0.; @@ -476,7 +476,7 @@ double BaseResultSet::getDouble( sal_Int32 columnIndex ) Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( columnIndex ); checkRowIndex(); @@ -550,7 +550,7 @@ Reference< css::sdbc::XClob > BaseResultSet::getClob( sal_Int32 /* columnIndex * Reference< css::sdbc::XArray > BaseResultSet::getArray( sal_Int32 columnIndex ) { - return new Array( m_refMutex, parseArray( getString( columnIndex ) ), *this, m_tc ); + return new Array( m_xMutex, parseArray( getString( columnIndex ) ), *this, m_tc ); } ::cppu::IPropertyArrayHelper & BaseResultSet::getInfoHelper() diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx index 2ac107c1925a..27ec2e62a5f1 100644 --- a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx @@ -72,7 +72,7 @@ protected: css::uno::Any m_props[BASERESULTSET_SIZE]; css::uno::Reference< css::uno::XInterface > m_owner; css::uno::Reference< css::script::XTypeConverter > m_tc; - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; sal_Int32 m_row; sal_Int32 m_rowCount; sal_Int32 m_fieldCount; @@ -96,7 +96,7 @@ protected: protected: BaseResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, sal_Int32 rowCount, sal_Int32 columnCount, diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index fff200b205b5..f996fa6034fb 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -159,11 +159,11 @@ static LogLevel readLogLevelFromConfiguration() } Connection::Connection( - const rtl::Reference< RefCountedMutex > &refMutex, + const rtl::Reference< comphelper::RefCountedMutex > &refMutex, const css::uno::Reference< css::uno::XComponentContext > & ctx ) - : ConnectionBase( refMutex->mutex ), + : ConnectionBase( refMutex->GetMutex() ), m_ctx( ctx ) , - m_refMutex( refMutex ) + m_xMutex( refMutex ) { m_settings.m_nLogLevel = readLogLevelFromConfiguration(); @@ -205,7 +205,7 @@ void Connection::close() CloseableList lst; DisposeableList lstDispose; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); // silently ignore, if the connection has been closed already if( m_settings.pConnection ) { @@ -248,7 +248,7 @@ void Connection::close() void Connection::removeFromWeakMap( const ::rtl::ByteSequence & id ) { // shrink the list ! - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); WeakHashMap::iterator ii = m_myStatements.find( id ); if( ii != m_myStatements.end() ) m_myStatements.erase( ii ); @@ -256,10 +256,10 @@ void Connection::removeFromWeakMap( const ::rtl::ByteSequence & id ) Reference< XStatement > Connection::createStatement() { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); - Statement *stmt = new Statement( m_refMutex, this , &m_settings ); + Statement *stmt = new Statement( m_xMutex, this , &m_settings ); Reference< XStatement > ret( stmt ); ::rtl::ByteSequence id( 16 ); rtl_createUuid( reinterpret_cast<sal_uInt8*>(id.getArray()), nullptr, false ); @@ -270,11 +270,11 @@ Reference< XStatement > Connection::createStatement() Reference< XPreparedStatement > Connection::prepareStatement( const OUString& sql ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); OString byteSql = OUStringToOString( sql, ConnectionSettings::encoding ); - PreparedStatement *stmt = new PreparedStatement( m_refMutex, this, &m_settings, byteSql ); + PreparedStatement *stmt = new PreparedStatement( m_xMutex, this, &m_settings, byteSql ); Reference< XPreparedStatement > ret = stmt; ::rtl::ByteSequence id( 16 ); @@ -325,10 +325,10 @@ sal_Bool Connection::isClosed() Reference< XDatabaseMetaData > Connection::getMetaData() { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); if( ! m_meta.is() ) - m_meta = new DatabaseMetaData( m_refMutex, this, &m_settings ); + m_meta = new DatabaseMetaData( m_xMutex, this, &m_settings ); return m_meta; } @@ -351,7 +351,7 @@ void Connection::setCatalog( const OUString& ) OUString Connection::getCatalog() { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if( m_settings.pConnection == nullptr ) { throw SQLException( "pq_connection: connection is closed", *this, @@ -376,7 +376,7 @@ Reference< XNameAccess > Connection::getTypeMap() { Reference< XNameAccess > t; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); t = m_typeMap; } return t; @@ -384,7 +384,7 @@ Reference< XNameAccess > Connection::getTypeMap() void Connection::setTypeMap( const Reference< XNameAccess >& typeMap ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); m_typeMap = typeMap; } Any Connection::getWarnings() @@ -603,9 +603,9 @@ Reference< XNameAccess > Connection::getTables() { log(&m_settings, LogLevel::Info, "Connection::getTables() got called"); } - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if( !m_settings.tables.is() ) - m_settings.tables = Tables::create( m_refMutex, this, &m_settings , &m_settings.pTablesImpl); + m_settings.tables = Tables::create( m_xMutex, this, &m_settings , &m_settings.pTablesImpl); else // TODO: how to overcome the performance problem ? Reference< css::util::XRefreshable > ( m_settings.tables, UNO_QUERY )->refresh(); @@ -618,9 +618,9 @@ Reference< XNameAccess > Connection::getViews() { log(&m_settings, LogLevel::Info, "Connection::getViews() got called"); } - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if( !m_settings.views.is() ) - m_settings.views = Views::create( m_refMutex, this, &m_settings, &(m_settings.pViewsImpl) ); + m_settings.views = Views::create( m_xMutex, this, &m_settings, &(m_settings.pViewsImpl) ); else // TODO: how to overcome the performance problem ? Reference< css::util::XRefreshable > ( m_settings.views, UNO_QUERY )->refresh(); @@ -635,9 +635,9 @@ Reference< XNameAccess > Connection::getUsers() log(&m_settings, LogLevel::Info, "Connection::getUsers() got called"); } - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if( !m_settings.users.is() ) - m_settings.users = Users::create( m_refMutex, this, &m_settings ); + m_settings.users = Users::create( m_xMutex, this, &m_settings ); return m_settings.users; } @@ -645,7 +645,7 @@ Reference< XNameAccess > Connection::getUsers() Reference< XInterface > ConnectionCreateInstance( const Reference< XComponentContext > & ctx ) { - ::rtl::Reference< RefCountedMutex > ref = new RefCountedMutex; + ::rtl::Reference< comphelper::RefCountedMutex > ref = new comphelper::RefCountedMutex; return * new Connection( ref, ctx ); } diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx index 06bc37e0cb12..f3b33009d050 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.hxx +++ b/connectivity/source/drivers/postgresql/pq_connection.hxx @@ -52,7 +52,7 @@ #include <rtl/ref.hxx> #include <rtl/byteseq.hxx> -#include <salhelper/simplereferenceobject.hxx> +#include <comphelper/refcountedmutex.hxx> #include <cppuhelper/weakref.hxx> #include <cppuhelper/compbase.hxx> @@ -69,12 +69,6 @@ namespace pq_sdbc_driver #define POSTGRE_TRACE(x) ((void)0) #endif -class RefCountedMutex : public salhelper::SimpleReferenceObject -{ -public: - osl::Mutex mutex; -}; - struct ConnectionSettings; @@ -160,7 +154,7 @@ class Connection : public ConnectionBase css::uno::Reference< css::uno::XComponentContext > m_ctx; css::uno::Reference< css::container::XNameAccess > m_typeMap; ConnectionSettings m_settings; - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; css::uno::Reference< css::sdbc::XDatabaseMetaData > m_meta; WeakHashMap m_myStatements; @@ -171,7 +165,7 @@ private: public: Connection( - const rtl::Reference< RefCountedMutex > &refMutex, + const rtl::Reference< comphelper::RefCountedMutex > &refMutex, const css::uno::Reference< css::uno::XComponentContext > & ctx ); virtual ~Connection( ) override; diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index eab6b50e0ace..554635ec0ed9 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -118,10 +118,10 @@ namespace pq_sdbc_driver #define DEFERRABILITY_NONE 7 DatabaseMetaData::DatabaseMetaData( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) - : m_refMutex( refMutex ), + : m_xMutex( refMutex ), m_pSettings( pSettings ), m_origin( origin ), m_getIntSetting_stmt ( m_origin->prepareStatement("SELECT setting FROM pg_catalog.pg_settings WHERE name=?") ) @@ -899,7 +899,7 @@ sal_Int32 DatabaseMetaData::getMaxCharLiteralLength( ) // Copied / adapted / simplified from JDBC driver sal_Int32 DatabaseMetaData::getIntSetting(const OUString& settingName) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); Reference< XParameters > params(m_getIntSetting_stmt, UNO_QUERY_THROW ); params->setString(1, settingName ); @@ -1093,9 +1093,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getProcedures( // LEM TODO: implement // LEM TODO: at least fake the columns, even if no row. - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > > (), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > > (), m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getProcedureColumns( @@ -1105,11 +1105,11 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getProcedureColumns( const OUString& columnNamePattern ) { (void) catalog; (void) schemaPattern; (void) procedureNamePattern; (void) columnNamePattern; - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); // LEM TODO: implement // LEM TODO: at least fake the columns, even if no row. return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getTables( @@ -1121,7 +1121,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables( (void) catalog; (void) types; Statics &statics = getStatics(); - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -1194,7 +1194,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables( closeable->close(); return new SequenceResultSet( - m_refMutex, *this, statics.tablesRowNames, vec, m_pSettings->tc ); + m_xMutex, *this, statics.tablesRowNames, vec, m_pSettings->tc ); } namespace @@ -1252,7 +1252,7 @@ namespace css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -1281,24 +1281,24 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas( ) if( closeable.is() ) closeable->close(); return new SequenceResultSet( - m_refMutex, *this, getStatics().schemaNames, vec, m_pSettings->tc ); + m_xMutex, *this, getStatics().schemaNames, vec, m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getCatalogs( ) { // LEM TODO: return the current catalog like JDBC driver? // at least fake the columns, even if no content - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getTableTypes( ) { // LEM TODO: this can be made dynamic, see JDBC driver - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, getStatics().tableTypeNames, getStatics().tableTypeData, + m_xMutex, *this, getStatics().tableTypeNames, getStatics().tableTypeData, m_pSettings->tc ); } @@ -1456,7 +1456,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns( Statics &statics = getStatics(); // continue ! - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -1628,7 +1628,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns( closeable->close(); return new SequenceResultSet( - m_refMutex, *this, statics.columnRowNames, vec, m_pSettings->tc ); + m_xMutex, *this, statics.columnRowNames, vec, m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges( @@ -1639,7 +1639,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges( { (void) catalog; - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -1668,7 +1668,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTablePrivileges( const OUString& schemaPattern, const OUString& tableNamePattern ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -1697,9 +1697,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getBestRowIdentifier( sal_Bool ) { //LEM TODO: implement! See JDBC driver - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getVersionColumns( @@ -1708,9 +1708,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getVersionColumns( const OUString& ) { //LEM TODO: implement! See JDBC driver - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); } css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( @@ -1719,7 +1719,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( const OUString& table ) { //LEM TODO: review - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); // 1. TABLE_CAT string => table catalog (may be NULL ) // 2. TABLE_SCHEM string => table schema (may be NULL ) @@ -1837,7 +1837,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys( elements ++; } return new SequenceResultSet( - m_refMutex, *this, getStatics().primaryKeyNames, ret, m_pSettings->tc ); + m_xMutex, *this, getStatics().primaryKeyNames, ret, m_pSettings->tc ); } // Copied / adapted / simplified from JDBC driver @@ -2317,7 +2317,7 @@ namespace css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( ) { // Note: Indexes start at 0 (in the API doc, they start at 1) - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(m_pSettings, LogLevel::Info)) { @@ -2355,7 +2355,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo( ) std::sort( vec.begin(), vec.end(), TypeInfoByDataTypeSorter() ); return new SequenceResultSet( - m_refMutex, + m_xMutex, *this, getStatics().typeinfoColumnNames, vec, @@ -2372,7 +2372,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo( sal_Bool ) { //LEM TODO: review - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); /* 1. TABLE_CAT string -> table catalog (may be NULL ) @@ -2484,7 +2484,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo( } } return new SequenceResultSet( - m_refMutex, *this, getStatics().indexinfoColumnNames, + m_xMutex, *this, getStatics().indexinfoColumnNames, vec, m_pSettings->tc ); } @@ -2559,9 +2559,9 @@ sal_Bool DatabaseMetaData::supportsBatchUpdates( ) css::uno::Reference< XResultSet > DatabaseMetaData::getUDTs( const css::uno::Any&, const OUString&, const OUString&, const css::uno::Sequence< sal_Int32 >& ) { //LEM TODO: implement! See JDBC driver - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); return new SequenceResultSet( - m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); + m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc ); } css::uno::Reference< css::sdbc::XConnection > DatabaseMetaData::getConnection() diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx index 2bb4ce1a0ddf..c016886f2643 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx @@ -48,7 +48,7 @@ namespace pq_sdbc_driver class DatabaseMetaData : public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData > { - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; ConnectionSettings *m_pSettings; css::uno::Reference< css::sdbc::XConnection > m_origin; css::uno::Reference< css::sdbc::XPreparedStatement > m_getIntSetting_stmt; @@ -75,7 +75,7 @@ class DatabaseMetaData : public: DatabaseMetaData( - const ::rtl::Reference< RefCountedMutex > & reMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx index 8a556c1a207f..4b46576d8667 100644 --- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx @@ -55,7 +55,7 @@ namespace pq_sdbc_driver { FakedUpdateableResultSet::FakedUpdateableResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **pSettings, PGresult *result, diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx index 74ed8c8415ee..65113344cdec 100644 --- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx @@ -56,7 +56,7 @@ class FakedUpdateableResultSet : public: FakedUpdateableResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **pSettings, PGresult *result, diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index dfa72d49ed3a..fba81ea56942 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -158,16 +158,16 @@ static bool isQuoted( const OString & str ) } PreparedStatement::PreparedStatement( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< XConnection > & conn, struct ConnectionSettings *pSettings, const OString & stmt ) - : PreparedStatement_BASE(refMutex->mutex) + : PreparedStatement_BASE(refMutex->GetMutex()) , OPropertySetHelper(PreparedStatement_BASE::rBHelper) , m_connection(conn) , m_pSettings(pSettings) , m_stmt(stmt) - , m_refMutex(refMutex) + , m_xMutex(refMutex) , m_multipleResultAvailable(false) , m_multipleResultUpdateCount(0) , m_lastOidInserted( InvalidOid ) @@ -266,7 +266,7 @@ void PreparedStatement::close( ) Reference< XConnection > r; Reference< XCloseable > resultSet; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); m_pSettings = nullptr; r = m_connection; m_connection.clear(); @@ -318,7 +318,7 @@ sal_Int32 PreparedStatement::executeUpdate( ) sal_Bool PreparedStatement::execute( ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); OStringBuffer buf( m_stmt.getLength() *2 ); @@ -379,7 +379,7 @@ sal_Bool PreparedStatement::execute( ) m_lastTableInserted.clear(); struct CommandData data; - data.refMutex = m_refMutex; + data.refMutex = m_xMutex; data.ppSettings = &m_pSettings; data.pLastOidInserted = &m_lastOidInserted; data.pLastQuery = &m_lastQuery; @@ -398,7 +398,7 @@ Reference< XConnection > PreparedStatement::getConnection( ) { Reference< XConnection > ret; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); ret = m_connection; } @@ -409,7 +409,7 @@ Reference< XConnection > PreparedStatement::getConnection( ) void PreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) { (void)sqlType; - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); m_vars[parameterIndex-1] = OString( "NULL" ); @@ -419,7 +419,7 @@ void PreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) { (void) sqlType; (void) typeName; - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); m_vars[parameterIndex-1] = OString( "NULL" ); @@ -428,7 +428,7 @@ void PreparedStatement::setObjectNull( void PreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); if( x ) @@ -450,7 +450,7 @@ void PreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) void PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) { // printf( "setString %d %d\n ", parameterIndex, x); - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -462,7 +462,7 @@ void PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) void PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -474,7 +474,7 @@ void PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) void PreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -486,7 +486,7 @@ void PreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) void PreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -500,7 +500,7 @@ void PreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x ) { // printf( "setString %d %s\n ", parameterIndex, // OUStringToOString( x , RTL_TEXTENCODING_ASCII_US ).getStr()); - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -516,7 +516,7 @@ void PreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x ) void PreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); checkClosed(); checkColumnIndex( parameterIndex ); OStringBuffer buf( 20 ); @@ -664,7 +664,7 @@ void PreparedStatement::setArray( void PreparedStatement::clearParameters( ) { - MutexGuard guard(m_refMutex->mutex ); + MutexGuard guard(m_xMutex->GetMutex() ); m_vars = OStringVector ( m_vars.size() ); } @@ -775,7 +775,7 @@ sal_Bool PreparedStatement::getMoreResults( ) Reference< XResultSet > PreparedStatement::getGeneratedValues( ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); return getGeneratedValuesFromLastInsert( m_pSettings, m_connection, m_lastOidInserted, m_lastTableInserted, m_lastQuery ); } diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx index 91e94bb85724..97491bafe964 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx @@ -82,7 +82,7 @@ private: css::uno::Reference< css::sdbc::XCloseable > m_lastResultset; OString m_stmt; OString m_executedStatement; - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; OStringVector m_vars; OStringVector m_splittedStatement; bool m_multipleResultAvailable; @@ -96,7 +96,7 @@ public: * @param ppConnection The piece of memory, pConnection points to, is accessible * as long as a reference to paramenter con is held. */ - PreparedStatement( const rtl::Reference< RefCountedMutex > & refMutex, + PreparedStatement( const rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection> & con, struct ConnectionSettings *pSettings, const OString &stmt ); diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx index 51b7989c613b..3839e72e3a73 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx @@ -76,7 +76,7 @@ void ResultSet::checkClosed() } -ResultSet::ResultSet( const ::rtl::Reference< RefCountedMutex > & refMutex, +ResultSet::ResultSet( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< XInterface > & owner, ConnectionSettings **ppSettings, PGresult * result, @@ -130,7 +130,7 @@ void ResultSet::close( ) { Reference< XInterface > owner; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if( m_result ) { PQclear(m_result ); @@ -144,15 +144,15 @@ void ResultSet::close( ) Reference< XResultSetMetaData > ResultSet::getMetaData( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); return new ResultSetMetaData( - m_refMutex, this, this, m_ppSettings, m_result, m_schema, m_table ); + m_xMutex, this, this, m_ppSettings, m_result, m_schema, m_table ); } sal_Int32 ResultSet::findColumn( const OUString& columnName ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); sal_Int32 res = PQfnumber( m_result, OUStringToOString( columnName, ConnectionSettings::encoding ).getStr()); diff --git a/connectivity/source/drivers/postgresql/pq_resultset.hxx b/connectivity/source/drivers/postgresql/pq_resultset.hxx index 40e4df23e547..4b2bb6f41fb9 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.hxx @@ -69,7 +69,7 @@ protected: public: ResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **pSettings, PGresult *result, diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx index 46f490278bf7..646444bf0542 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx @@ -113,14 +113,14 @@ static void extractPrecisionAndScale( sal_Int32 atttypmod, sal_Int32 *precision, } ResultSetMetaData::ResultSetMetaData( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XResultSet > & origin, ResultSet * pResultSet, ConnectionSettings **ppSettings, PGresult *pResult, const OUString &schemaName, const OUString &tableName ) : - m_refMutex( refMutex ), + m_xMutex( refMutex ), m_ppSettings( ppSettings ), m_origin( origin ), m_tableName( tableName ), @@ -225,7 +225,7 @@ sal_Int32 ResultSetMetaData::getIntColumnProperty( const OUString & name, int in sal_Int32 ret = def; // give defensive answers, when data is not available try { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( index ); Reference< XPropertySet > set = getColumnByIndex( index ); @@ -245,7 +245,7 @@ bool ResultSetMetaData::getBoolColumnProperty( const OUString & name, int index, bool ret = def; try { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( index ); Reference< XPropertySet > set = getColumnByIndex( index ); if( set.is() ) @@ -324,7 +324,7 @@ sal_Bool ResultSetMetaData::isSigned( sal_Int32 column ) sal_Int32 ResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( column ); return m_colDesc[column-1].displaySize; } @@ -336,7 +336,7 @@ OUString ResultSetMetaData::getColumnLabel( sal_Int32 column ) OUString ResultSetMetaData::getColumnName( sal_Int32 column ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( column ); return m_colDesc[column-1].name; @@ -350,14 +350,14 @@ OUString ResultSetMetaData::getSchemaName( sal_Int32 column ) sal_Int32 ResultSetMetaData::getPrecision( sal_Int32 column ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( column ); return m_colDesc[column-1].precision; } sal_Int32 ResultSetMetaData::getScale( sal_Int32 column ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( column ); return m_colDesc[column-1].scale; } @@ -391,7 +391,7 @@ OUString ResultSetMetaData::getColumnTypeName( sal_Int32 column ) OUString ret; // give defensive answers, when data is not available try { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkColumnIndex( column ); Reference< XPropertySet > set = getColumnByIndex( column ); diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx index 70ba16e5d3b6..1beede2b835d 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx @@ -64,7 +64,7 @@ class ResultSet; class ResultSetMetaData : public ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData > { - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; ConnectionSettings **m_ppSettings; css::uno::Reference< css::sdbc::XResultSet > m_origin; css::uno::Reference< css::beans::XPropertySet > m_table; @@ -90,7 +90,7 @@ class ResultSetMetaData : public: ResultSetMetaData( - const ::rtl::Reference< RefCountedMutex > & reMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex, const css::uno::Reference< css::sdbc::XResultSet > & origin, ResultSet *pResultSet, ConnectionSettings **pSettings, diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx index 5fb50e7e63a9..eefa362335c8 100644 --- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx @@ -61,7 +61,7 @@ Any SequenceResultSet::getValue( sal_Int32 columnIndex ) } SequenceResultSet::SequenceResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, const std::vector< OUString > &colNames, const std::vector< std::vector< Any > > &data, diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx index bf22e9de8d52..3b97e24a3001 100644 --- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx @@ -70,7 +70,7 @@ protected: public: SequenceResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, const std::vector< OUString > &colNames, const std::vector< std::vector< css::uno::Any > > &data, diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 39063d8e6548..6abd625c1a5c 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -152,14 +152,14 @@ static ::cppu::IPropertyArrayHelper & getStatementPropertyArrayHelper() return *pArrayHelper; } -Statement::Statement( const ::rtl::Reference< RefCountedMutex > & refMutex, +Statement::Statement( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< XConnection > & conn, struct ConnectionSettings *pSettings ) - : Statement_BASE( refMutex->mutex ) + : Statement_BASE( refMutex->GetMutex() ) , OPropertySetHelper( Statement_BASE::rBHelper ) , m_connection( conn ) , m_pSettings( pSettings ) - , m_refMutex( refMutex ) + , m_xMutex( refMutex ) , m_multipleResultAvailable(false) , m_multipleResultUpdateCount(0) , m_lastOidInserted(InvalidOid) @@ -221,7 +221,7 @@ void Statement::close( ) Reference< XConnection > r; Reference< XCloseable > resultSet; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); m_pSettings = nullptr; r = m_connection; m_connection.clear(); @@ -820,7 +820,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( sal_Bool Statement::execute( const OUString& sql ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); OString cmd = OUStringToOString( sql, m_pSettings ); @@ -828,7 +828,7 @@ sal_Bool Statement::execute( const OUString& sql ) m_lastTableInserted.clear(); struct CommandData data; - data.refMutex = m_refMutex; + data.refMutex = m_xMutex; data.ppSettings = &m_pSettings; data.pLastOidInserted = &m_lastOidInserted; data.pLastQuery = &m_lastQuery; @@ -847,7 +847,7 @@ Reference< XConnection > Statement::getConnection( ) { Reference< XConnection > ret; { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); ret = m_connection; } @@ -966,7 +966,7 @@ void Statement::disposing() Reference< XResultSet > Statement::getGeneratedValues( ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); return getGeneratedValuesFromLastInsert( m_pSettings, m_connection, m_lastOidInserted, m_lastTableInserted, m_lastQuery ); } diff --git a/connectivity/source/drivers/postgresql/pq_statement.hxx b/connectivity/source/drivers/postgresql/pq_statement.hxx index 0ac5e40a711e..8b91ec596642 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.hxx +++ b/connectivity/source/drivers/postgresql/pq_statement.hxx @@ -78,7 +78,7 @@ private: css::uno::Reference< css::sdbc::XConnection > m_connection; ConnectionSettings *m_pSettings; css::uno::Reference< css::sdbc::XCloseable > m_lastResultset; - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; bool m_multipleResultAvailable; sal_Int32 m_multipleResultUpdateCount; sal_Int32 m_lastOidInserted; @@ -90,7 +90,7 @@ public: * @param ppConnection The piece of memory, pConnection points to, is accessible * as long as a reference to paramenter con is held. */ - Statement( const rtl::Reference< RefCountedMutex > & refMutex, + Statement( const rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection> & con, struct ConnectionSettings *pSettings ); @@ -174,7 +174,7 @@ struct CommandData OUString *pLastTableInserted; css::uno::Reference< css::sdbc::XCloseable > *pLastResultset; OString *pLastQuery; - ::rtl::Reference< RefCountedMutex > refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > refMutex; css::uno::Reference< css::uno::XInterface > owner; css::uno::Reference< css::sdbcx::XTablesSupplier > tableSupplier; sal_Int32 concurrency; diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx index 12c525f68f01..773053b9fe98 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx @@ -84,7 +84,7 @@ namespace pq_sdbc_driver css::uno::Reference< css::sdbc::XCloseable > UpdateableResultSet::createFromPGResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **ppSettings, PGresult *result, @@ -193,7 +193,7 @@ OUString UpdateableResultSet::buildWhereClause() void UpdateableResultSet::insertRow( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(*m_ppSettings, LogLevel::Info)) { log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::insertRow got called"); @@ -287,7 +287,7 @@ void UpdateableResultSet::insertRow( ) void UpdateableResultSet::updateRow( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); if (isLog(*m_ppSettings, LogLevel::Info)) { log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::updateRow got called"); @@ -375,7 +375,7 @@ void UpdateableResultSet::deleteRow( ) void UpdateableResultSet::cancelRowUpdates( ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); m_updateableField = UpdateableFieldVector(); } @@ -399,7 +399,7 @@ void UpdateableResultSet::checkUpdate( sal_Int32 columnIndex) void UpdateableResultSet::updateNull( sal_Int32 columnIndex ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); m_updateableField[columnIndex-1].value = Any(); @@ -407,7 +407,7 @@ void UpdateableResultSet::updateNull( sal_Int32 columnIndex ) void UpdateableResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); @@ -429,7 +429,7 @@ void UpdateableResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) void UpdateableResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) { updateLong( columnIndex, x ); -// MutexGuard guard( m_refMutex->mutex ); +// MutexGuard guard( m_xMutex->GetMutex() ); // checkClosed(); // checkUpdate( columnIndex ); @@ -439,7 +439,7 @@ void UpdateableResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) void UpdateableResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); @@ -453,7 +453,7 @@ void UpdateableResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) void UpdateableResultSet::updateFloat( sal_Int32 columnIndex, float x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); @@ -462,7 +462,7 @@ void UpdateableResultSet::updateFloat( sal_Int32 columnIndex, float x ) void UpdateableResultSet::updateDouble( sal_Int32 columnIndex, double x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); @@ -471,7 +471,7 @@ void UpdateableResultSet::updateDouble( sal_Int32 columnIndex, double x ) void UpdateableResultSet::updateString( sal_Int32 columnIndex, const OUString& x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); @@ -480,7 +480,7 @@ void UpdateableResultSet::updateString( sal_Int32 columnIndex, const OUString& x void UpdateableResultSet::updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); checkClosed(); checkUpdate( columnIndex ); diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx index 9c21521d81cd..9da077ea6db7 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx @@ -74,7 +74,7 @@ class UpdateableResultSet : protected: UpdateableResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, const std::vector< OUString > &colNames, const std::vector< std::vector< css::uno::Any > > &data, @@ -113,7 +113,7 @@ protected: public: static css::uno::Reference< css::sdbc::XCloseable > createFromPGResultSet( - const ::rtl::Reference< RefCountedMutex > & mutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & mutex, const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **ppSettings, PGresult *result, diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx index 8da5422c5cea..e27719b52c59 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.cxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx @@ -60,15 +60,15 @@ namespace pq_sdbc_driver ReflectionBase::ReflectionBase( const OUString &implName, const css::uno::Sequence< OUString > &supportedServices, - const ::rtl::Reference< RefCountedMutex >& refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex, const css::uno::Reference< css::sdbc::XConnection > &conn, ConnectionSettings *pSettings, cppu::IPropertyArrayHelper & props /* must survive this object !*/ ) - : ReflectionBase_BASE( refMutex->mutex ), + : ReflectionBase_BASE( refMutex->GetMutex() ), OPropertySetHelper( ReflectionBase_BASE::rBHelper ), m_implName( implName ), m_supportedServices( supportedServices ), - m_refMutex( refMutex ), + m_xMutex( refMutex ), m_conn( conn ), m_pSettings( pSettings ), m_propsDesc( props ), @@ -152,7 +152,7 @@ Sequence< OUString > ReflectionBase::getSupportedServiceNames() Sequence< css::uno::Type > ReflectionBase::getTypes() { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); static Sequence< css::uno::Type > collection( ::comphelper::concatSequences( ::cppu::OPropertySetHelper::getTypes(), diff --git a/connectivity/source/drivers/postgresql/pq_xbase.hxx b/connectivity/source/drivers/postgresql/pq_xbase.hxx index bf5359fe5fc4..6e7ac8413f47 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.hxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.hxx @@ -60,7 +60,7 @@ class ReflectionBase : protected: const OUString m_implName; const css::uno::Sequence< OUString > m_supportedServices; - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; css::uno::Reference< css::sdbc::XConnection > m_conn; ConnectionSettings *m_pSettings; cppu::IPropertyArrayHelper & m_propsDesc; @@ -69,7 +69,7 @@ public: ReflectionBase( const OUString &implName, const css::uno::Sequence< OUString > &supportedServices, - const ::rtl::Reference< RefCountedMutex >& refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex, const css::uno::Reference< css::sdbc::XConnection > &conn, ConnectionSettings *pSettings, cppu::IPropertyArrayHelper & props /* must survive this object !*/ ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumn.cxx b/connectivity/source/drivers/postgresql/pq_xcolumn.cxx index 5caf2d0f88af..bda0a88a0407 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumn.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumn.cxx @@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet; namespace pq_sdbc_driver { -Column::Column( const ::rtl::Reference< RefCountedMutex > & refMutex, +Column::Column( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -60,13 +60,13 @@ Column::Column( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > Column::createDataDescriptor( ) { ColumnDescriptor * pColumn = new ColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pColumn ); } ColumnDescriptor::ColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -81,7 +81,7 @@ ColumnDescriptor::ColumnDescriptor( Reference< XPropertySet > ColumnDescriptor::createDataDescriptor( ) { ColumnDescriptor * pColumn = new ColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pColumn ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumn.hxx b/connectivity/source/drivers/postgresql/pq_xcolumn.hxx index 1a8d9ff30502..ea4e099fcd2b 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumn.hxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumn.hxx @@ -52,7 +52,7 @@ namespace pq_sdbc_driver class Column : public ReflectionBase { public: - Column( const ::rtl::Reference< RefCountedMutex > & refMutex, + Column( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -66,7 +66,7 @@ class ColumnDescriptor : public ReflectionBase { public: ColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index a1c0562b31de..e8e16991c910 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -104,7 +104,7 @@ static Any isAutoIncrement( const OUString & defaultValue ) } Columns::Columns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -226,7 +226,7 @@ OUString columnMetaData2SDBCX( // class CommentChanger : public cppu::WeakImplHelper< XPropertyChangeListener > // { -// ::rtl::Reference< RefCountedMutex > m_refMutex; +// ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; // css::uno::Reference< css::sdbc::XConnection > m_connection; // ConnectionSettings *m_pSettings; // OUString m_schema; @@ -235,13 +235,13 @@ OUString columnMetaData2SDBCX( // public: // CommentChanger( -// const ::rtl::Reference< RefCountedMutex > & refMutex, +// const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, // const css::uno::Reference< css::sdbc::XConnection > & connection, // ConnectionSettings *pSettings, // const OUString & schema, // const OUString & table, // const OUString & column ) : -// m_refMutex( refMutex ), +// m_xMutex( refMutex ), // m_connection( connection ), // m_pSettings( pSettings ), // m_schema ( schema ), @@ -253,13 +253,13 @@ OUString columnMetaData2SDBCX( // // Methods // virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException) // { -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // m_connection.clear(); // } // // Methods // virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) throw (css::uno::RuntimeException) // { -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // OUStringBuffer buf( 128 ); // OUString comment; // evt.NewValue >>= comment; @@ -289,7 +289,7 @@ void Columns::refresh() buf.append( OUStringToOString( m_tableName, ConnectionSettings::encoding ) ); log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() ); } - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics &st = getStatics(); Reference< XDatabaseMetaData > meta = m_origin->getMetaData(); @@ -307,14 +307,14 @@ void Columns::refresh() while( rs->next() ) { Column * pColumn = - new Column( m_refMutex, m_origin, m_pSettings ); + new Column( m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pColumn; OUString name = columnMetaData2SDBCX( pColumn, xRow ); // pColumn->addPropertyChangeListener( // st.HELP_TEXT, // new CommentChanger( -// m_refMutex, +// m_xMutex, // m_origin, // m_pSettings, // m_schemaName, @@ -462,7 +462,7 @@ void alterColumnByDescriptor( void Columns::appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& future ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Reference< XPropertySet > past = createDataDescriptor(); past->setPropertyValue( st.IS_NULLABLE, makeAny( css::sdbc::ColumnValue::NULLABLE ) ); @@ -496,7 +496,7 @@ void Columns::appendByDescriptor( void Columns::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -527,11 +527,11 @@ void Columns::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Columns::createDataDescriptor() { - return new ColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new ColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > Columns::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -548,7 +548,7 @@ Reference< css::container::XNameAccess > Columns::create( ColumnDescriptors::ColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) : Container( refMutex, origin, pSettings, "COLUMN-DESCRIPTOR" ) @@ -557,7 +557,7 @@ ColumnDescriptors::ColumnDescriptors( Reference< css::beans::XPropertySet > ColumnDescriptors::createDataDescriptor() { - return new ColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new ColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } } diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx index d8ca464653ce..86bc585be296 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx @@ -63,7 +63,7 @@ class Columns : public Container public: // instances Columns 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -72,7 +72,7 @@ public: // instances Columns 'exception safe' protected: Columns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -104,7 +104,7 @@ class ColumnDescriptors : public Container { public: ColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx index 7894ba65d7d2..56a1fc67c62b 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx @@ -134,12 +134,12 @@ public: }; Container::Container( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &type) - : ContainerBase( refMutex->mutex ), - m_refMutex( refMutex ), + : ContainerBase( refMutex->GetMutex() ), + m_xMutex( refMutex ), m_pSettings( pSettings ), m_origin( origin ), m_type( type ) @@ -266,7 +266,7 @@ void Container::rename( const OUString &oldName, const OUString &newName ) { Any newValue; { - osl::MutexGuard guard ( m_refMutex->mutex ); + osl::MutexGuard guard ( m_xMutex->GetMutex() ); String2IntMap::iterator ii = m_name2index.find( oldName ); if( ii != m_name2index.end() ) { @@ -282,7 +282,7 @@ void Container::rename( const OUString &oldName, const OUString &newName ) void Container::dropByName( const OUString& elementName ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); String2IntMap::const_iterator ii = m_name2index.find( elementName ); if( ii == m_name2index.end() ) { @@ -296,7 +296,7 @@ void Container::dropByName( const OUString& elementName ) void Container::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >=(sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -346,7 +346,7 @@ void Container::append( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( hasByName( name ) ) { diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx index fd595c639e08..0e788d1abb05 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx @@ -107,7 +107,7 @@ typedef ::cppu::WeakComponentImplHelper class /* abstract */ Container : public ContainerBase { protected: - ::rtl::Reference< RefCountedMutex > m_refMutex; + ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex; ConnectionSettings *m_pSettings; css::uno::Reference< css::sdbc::XConnection > m_origin; String2IntMap m_name2index; // maps the element name to an index @@ -116,7 +116,7 @@ protected: public: Container( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString & type // for exception messages diff --git a/connectivity/source/drivers/postgresql/pq_xindex.cxx b/connectivity/source/drivers/postgresql/pq_xindex.cxx index 60169554e9d6..8a88ed64ca86 100644 --- a/connectivity/source/drivers/postgresql/pq_xindex.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindex.cxx @@ -62,7 +62,7 @@ using com::sun::star::beans::XPropertySet; namespace pq_sdbc_driver { -Index::Index( const ::rtl::Reference< RefCountedMutex > & refMutex, +Index::Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, const OUString & schemaName, @@ -81,7 +81,7 @@ Index::Index( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > Index::createDataDescriptor( ) { IndexDescriptor * pIndex = new IndexDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pIndex->copyValuesFrom( this ); return Reference< XPropertySet > ( pIndex ); @@ -95,7 +95,7 @@ Reference< XNameAccess > Index::getColumns( ) getPropertyValue( getStatics().PRIVATE_COLUMN_INDEXES ) >>= columnNames; OUString indexName = extractStringProperty( this, getStatics().NAME ); m_indexColumns = IndexColumns::create( - m_refMutex, m_conn, m_pSettings, m_schemaName, + m_xMutex, m_conn, m_pSettings, m_schemaName, m_tableName, indexName, columnNames ); } return m_indexColumns; @@ -137,7 +137,7 @@ Any Index::queryInterface( const Type & reqType ) IndexDescriptor::IndexDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -152,7 +152,7 @@ IndexDescriptor::IndexDescriptor( Reference< XPropertySet > IndexDescriptor::createDataDescriptor( ) { IndexDescriptor * pIndex = new IndexDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pIndex->copyValuesFrom( this ); return Reference< XPropertySet > ( pIndex ); } @@ -162,12 +162,12 @@ Reference< XNameAccess > IndexDescriptor::getColumns( ) if( ! m_indexColumns.is() ) { m_indexColumns = IndexColumnDescriptors::create( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); // Sequence< OUString > columnNames; // getPropertyValue( getStatics().PRIVATE_COLUMN_INDEXES ) >>= columnNames; // OUString indexName = extractStringProperty( this, getStatics().NAME ); // m_indexColumns = IndexColumns::create( -// m_refMutex, m_conn, m_pSettings, m_schemaName, +// m_xMutex, m_conn, m_pSettings, m_schemaName, // m_tableName, indexName, columnNames ); } return m_indexColumns; diff --git a/connectivity/source/drivers/postgresql/pq_xindex.hxx b/connectivity/source/drivers/postgresql/pq_xindex.hxx index 7f22f1215575..26e5613630a2 100644 --- a/connectivity/source/drivers/postgresql/pq_xindex.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindex.hxx @@ -59,7 +59,7 @@ class Index : public ReflectionBase, OUString m_tableName; public: - Index( const ::rtl::Reference< RefCountedMutex > & refMutex, + Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, const OUString &schemaName, @@ -93,7 +93,7 @@ class IndexDescriptor : public ReflectionBase, public: IndexDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx index ef2ceffebaa7..824a89ce33be 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx @@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet; namespace pq_sdbc_driver { -IndexColumn::IndexColumn( const ::rtl::Reference< RefCountedMutex > & refMutex, +IndexColumn::IndexColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -60,7 +60,7 @@ IndexColumn::IndexColumn( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > IndexColumn::createDataDescriptor( ) { IndexColumnDescriptor * pIndexColumn = new IndexColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pIndexColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pIndexColumn ); @@ -68,7 +68,7 @@ Reference< XPropertySet > IndexColumn::createDataDescriptor( ) IndexColumnDescriptor::IndexColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -83,7 +83,7 @@ IndexColumnDescriptor::IndexColumnDescriptor( Reference< XPropertySet > IndexColumnDescriptor::createDataDescriptor( ) { IndexColumnDescriptor * pIndexColumn = new IndexColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pIndexColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pIndexColumn ); diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx b/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx index 9dada6d18b10..5e7ae8d4fa65 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx @@ -53,7 +53,7 @@ class IndexColumn : public ReflectionBase { public: IndexColumn( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -67,7 +67,7 @@ class IndexColumnDescriptor : public ReflectionBase { public: IndexColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx index 638bf731d346..1bc732dbdcc3 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx @@ -72,7 +72,7 @@ namespace pq_sdbc_driver { IndexColumns::IndexColumns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -112,7 +112,7 @@ void IndexColumns::refresh() log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() ); } - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics &st = getStatics(); Reference< XDatabaseMetaData > meta = m_origin->getMetaData(); @@ -134,7 +134,7 @@ void IndexColumns::refresh() continue; IndexColumn * pIndexColumn = - new IndexColumn( m_refMutex, m_origin, m_pSettings ); + new IndexColumn( m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pIndexColumn; columnMetaData2SDBCX( pIndexColumn, xRow ); @@ -160,7 +160,7 @@ void IndexColumns::appendByDescriptor( throw css::sdbc::SQLException( "SDBC-POSTGRESQL: IndexesColumns.appendByDescriptor not yet implemented", *this, OUString(), 1, Any() ); -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // Statics & st = getStatics(); // Reference< XPropertySet > past = createDataDescriptor(); // past->setPropertyValue( st.IS_NULLABLE, makeAny( css::sdbc::ColumnValue::NULLABLE ) ); @@ -198,7 +198,7 @@ void IndexColumns::dropByIndex( sal_Int32 index ) throw css::sdbc::SQLException( "SDBC-POSTGRESQL: IndexesColumns.dropByIndex not yet implemented", *this, OUString(), 1, Any() ); -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // if( index < 0 || index >= m_values.getLength() ) // { // OUStringBuffer buf( 128 ); @@ -231,11 +231,11 @@ void IndexColumns::dropByIndex( sal_Int32 index ) Reference< css::beans::XPropertySet > IndexColumns::createDataDescriptor() { - return new IndexColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new IndexColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > IndexColumns::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -253,14 +253,14 @@ Reference< css::container::XNameAccess > IndexColumns::create( IndexColumnDescriptors::IndexColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) : Container( refMutex, origin, pSettings, getStatics().INDEX_COLUMN ) {} Reference< css::container::XNameAccess > IndexColumnDescriptors::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) { @@ -269,7 +269,7 @@ Reference< css::container::XNameAccess > IndexColumnDescriptors::create( css::uno::Reference< css::beans::XPropertySet > IndexColumnDescriptors::createDataDescriptor() { - return new IndexColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new IndexColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } }; diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx index 9c1b856dbfd4..f41c390f4ef1 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx @@ -51,7 +51,7 @@ class IndexColumns : public Container public: // instances IndexColumns 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -61,7 +61,7 @@ public: // instances IndexColumns 'exception safe' protected: IndexColumns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -92,13 +92,13 @@ class IndexColumnDescriptors : public Container public: // instances IndexColumns 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); protected: IndexColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx index 082a887f1407..126e895d6e19 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx @@ -76,7 +76,7 @@ namespace pq_sdbc_driver { Indexes::Indexes( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -104,7 +104,7 @@ void Indexes::refresh() log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() ); } - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Int2StringMap column2NameMap; @@ -144,7 +144,7 @@ void Indexes::refresh() static const sal_Int32 C_COLUMNS = 7; OUString currentIndexName = row->getString( C_INDEXNAME ); Index *pIndex = - new Index( m_refMutex, m_origin, m_pSettings, + new Index( m_xMutex, m_origin, m_pSettings, m_schemaName, m_tableName ); (void) C_SCHEMA; (void) C_TABLENAME; @@ -241,7 +241,7 @@ void Indexes::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -267,11 +267,11 @@ void Indexes::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Indexes::createDataDescriptor() { - return new IndexDescriptor( m_refMutex, m_origin, m_pSettings ); + return new IndexDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > Indexes::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString & schemaName, @@ -285,14 +285,14 @@ Reference< css::container::XNameAccess > Indexes::create( IndexDescriptors::IndexDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) : Container( refMutex, origin, pSettings, getStatics().INDEX ) {} Reference< css::container::XNameAccess > IndexDescriptors::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) { @@ -301,7 +301,7 @@ Reference< css::container::XNameAccess > IndexDescriptors::create( css::uno::Reference< css::beans::XPropertySet > IndexDescriptors::createDataDescriptor() { - return new IndexDescriptor( m_refMutex, m_origin, m_pSettings ); + return new IndexDescriptor( m_xMutex, m_origin, m_pSettings ); } }; diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.hxx b/connectivity/source/drivers/postgresql/pq_xindexes.hxx index a4d0e48d9467..661c680d67ec 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.hxx @@ -48,7 +48,7 @@ class Indexes : public Container public: // instances Columns 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -56,7 +56,7 @@ public: // instances Columns 'exception safe' protected: Indexes( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -83,13 +83,13 @@ class IndexDescriptors : public Container { public: // instances IndexDescriptors 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); protected: IndexDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xkey.cxx b/connectivity/source/drivers/postgresql/pq_xkey.cxx index 0e3ab48782e4..ab7e3768e836 100644 --- a/connectivity/source/drivers/postgresql/pq_xkey.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkey.cxx @@ -62,7 +62,7 @@ using com::sun::star::beans::XPropertySet; namespace pq_sdbc_driver { -Key::Key( const ::rtl::Reference< RefCountedMutex > & refMutex, +Key::Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, const OUString & schemaName, @@ -81,7 +81,7 @@ Key::Key( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > Key::createDataDescriptor( ) { KeyDescriptor * pKeyDescriptor = new KeyDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pKeyDescriptor->copyValuesFrom( this ); return Reference< XPropertySet > ( pKeyDescriptor ); @@ -97,7 +97,7 @@ Reference< XNameAccess > Key::getColumns( ) getPropertyValue( getStatics().PRIVATE_FOREIGN_COLUMNS ) >>= foreignColumnNames; m_keyColumns = KeyColumns::create( - m_refMutex, m_conn, m_pSettings, m_schemaName, + m_xMutex, m_conn, m_pSettings, m_schemaName, m_tableName, columnNames, foreignColumnNames ); } return m_keyColumns; @@ -138,7 +138,7 @@ Any Key::queryInterface( const Type & reqType ) } -KeyDescriptor::KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex, +KeyDescriptor::KeyDescriptor( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -154,7 +154,7 @@ KeyDescriptor::KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMut Reference< XPropertySet > KeyDescriptor::createDataDescriptor( ) { KeyDescriptor * pKeyDescriptor = new KeyDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pKeyDescriptor->copyValuesFrom( this ); return Reference< XPropertySet > ( pKeyDescriptor ); @@ -165,7 +165,7 @@ Reference< XNameAccess > KeyDescriptor::getColumns( ) // TODO: cash columns object ! if( !m_keyColumns.is() ) { - m_keyColumns = new KeyColumnDescriptors( m_refMutex, m_conn, m_pSettings ); + m_keyColumns = new KeyColumnDescriptors( m_xMutex, m_conn, m_pSettings ); } return m_keyColumns; } diff --git a/connectivity/source/drivers/postgresql/pq_xkey.hxx b/connectivity/source/drivers/postgresql/pq_xkey.hxx index 1b22047e89c4..3174d189206b 100644 --- a/connectivity/source/drivers/postgresql/pq_xkey.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkey.hxx @@ -59,7 +59,7 @@ class Key : public ReflectionBase, OUString m_tableName; public: - Key( const ::rtl::Reference< RefCountedMutex > & refMutex, + Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, const OUString &schemaName, @@ -91,7 +91,7 @@ class KeyDescriptor : public ReflectionBase, public css::sdbcx::XColumnsSupplier css::uno::Reference< css::container::XNameAccess > m_keyColumns; public: - KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex, + KeyDescriptor( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx index 57c4f400067a..c7ffbcd3d6f2 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx @@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet; namespace pq_sdbc_driver { -KeyColumn::KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex, +KeyColumn::KeyColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -60,14 +60,14 @@ KeyColumn::KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > KeyColumn::createDataDescriptor( ) { KeyColumnDescriptor * pKeyColumn = new KeyColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pKeyColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pKeyColumn ); } KeyColumnDescriptor::KeyColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -82,7 +82,7 @@ KeyColumnDescriptor::KeyColumnDescriptor( Reference< XPropertySet > KeyColumnDescriptor::createDataDescriptor( ) { KeyColumnDescriptor * pKeyColumn = new KeyColumnDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pKeyColumn->copyValuesFrom( this ); return Reference< XPropertySet > ( pKeyColumn ); diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx b/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx index bf102777b730..14baf7f66cf2 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx @@ -52,7 +52,7 @@ namespace pq_sdbc_driver class KeyColumn : public ReflectionBase { public: - KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex, + KeyColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -66,7 +66,7 @@ class KeyColumnDescriptor : public ReflectionBase { public: KeyColumnDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx index 62dbc334d461..0ae1af1ffdb2 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx @@ -68,7 +68,7 @@ namespace pq_sdbc_driver { KeyColumns::KeyColumns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -100,7 +100,7 @@ void KeyColumns::refresh() log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() ); } - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics &st = getStatics(); Reference< XDatabaseMetaData > meta = m_origin->getMetaData(); @@ -129,7 +129,7 @@ void KeyColumns::refresh() continue; KeyColumn * pKeyColumn = - new KeyColumn( m_refMutex, m_origin, m_pSettings ); + new KeyColumn( m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pKeyColumn; OUString name = columnMetaData2SDBCX( pKeyColumn, xRow ); @@ -164,7 +164,7 @@ void KeyColumns::appendByDescriptor( "KeyColumns::appendByDescriptor not implemented yet", *this, OUString(), 1, Any() ); -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // Statics & st = getStatics(); // Reference< XPropertySet > past = createDataDescriptor(); // past->setPropertyValue( st.IS_NULLABLE, makeAny( css::sdbc::ColumnValue::NULLABLE ) ); @@ -180,7 +180,7 @@ void KeyColumns::dropByIndex( sal_Int32 index ) throw css::sdbc::SQLException( "KeyColumns::dropByIndex not implemented yet", *this, OUString(), 1, Any() ); -// osl::MutexGuard guard( m_refMutex->mutex ); +// osl::MutexGuard guard( m_xMutex->GetMutex() ); // if( index < 0 || index >= m_values.getLength() ) // { // OUStringBuffer buf( 128 ); @@ -213,11 +213,11 @@ void KeyColumns::dropByIndex( sal_Int32 index ) Reference< css::beans::XPropertySet > KeyColumns::createDataDescriptor() { - return new KeyColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new KeyColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > KeyColumns::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -235,7 +235,7 @@ Reference< css::container::XNameAccess > KeyColumns::create( KeyColumnDescriptors::KeyColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) : Container( refMutex, origin, pSettings, "KEY_COLUMN" ) @@ -243,7 +243,7 @@ KeyColumnDescriptors::KeyColumnDescriptors( Reference< css::beans::XPropertySet > KeyColumnDescriptors::createDataDescriptor() { - return new KeyColumnDescriptor( m_refMutex, m_origin, m_pSettings ); + return new KeyColumnDescriptor( m_xMutex, m_origin, m_pSettings ); } }; diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx index 2c5d1a7c34a3..508804dc4d91 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx @@ -51,7 +51,7 @@ class KeyColumns : public Container public: // instances KeyColumns 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -61,7 +61,7 @@ public: // instances KeyColumns 'exception safe' protected: KeyColumns( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -90,7 +90,7 @@ class KeyColumnDescriptors : public Container { public: KeyColumnDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.cxx b/connectivity/source/drivers/postgresql/pq_xkeys.cxx index 9cab799c9b6f..dadf75079c3d 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeys.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeys.cxx @@ -69,7 +69,7 @@ namespace pq_sdbc_driver { Keys::Keys( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -118,7 +118,7 @@ void Keys::refresh() log( m_pSettings, LogLevel::Info, buf.getStr() ); } - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Int2StringMap mainMap; @@ -152,7 +152,7 @@ void Keys::refresh() while( rs->next() ) { Key * pKey = - new Key( m_refMutex, m_origin, m_pSettings , m_schemaName, m_tableName ); + new Key( m_xMutex, m_origin, m_pSettings , m_schemaName, m_tableName ); Reference< css::beans::XPropertySet > prop = pKey; pKey->setPropertyValue_NoBroadcast_public( @@ -208,7 +208,7 @@ void Keys::refresh() void Keys::appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); OUStringBuffer buf( 128 ); buf.append( "ALTER TABLE " ); @@ -224,7 +224,7 @@ void Keys::appendByDescriptor( void Keys::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -251,11 +251,11 @@ void Keys::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Keys::createDataDescriptor() { - return new KeyDescriptor( m_refMutex, m_origin, m_pSettings ); + return new KeyDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XIndexAccess > Keys::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString & schemaName, @@ -269,14 +269,14 @@ Reference< css::container::XIndexAccess > Keys::create( } KeyDescriptors::KeyDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) : Container( refMutex, origin, pSettings, getStatics().KEY ) {} Reference< css::container::XIndexAccess > KeyDescriptors::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings) { @@ -285,7 +285,7 @@ Reference< css::container::XIndexAccess > KeyDescriptors::create( css::uno::Reference< css::beans::XPropertySet > KeyDescriptors::createDataDescriptor() { - return new KeyDescriptor( m_refMutex, m_origin, m_pSettings ); + return new KeyDescriptor( m_xMutex, m_origin, m_pSettings ); } }; diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.hxx b/connectivity/source/drivers/postgresql/pq_xkeys.hxx index 27ec7c64ca62..22d56dad3f95 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeys.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkeys.hxx @@ -48,7 +48,7 @@ class Keys : public Container public: // instances Columns 'exception safe' static css::uno::Reference< css::container::XIndexAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -56,7 +56,7 @@ public: // instances Columns 'exception safe' protected: Keys( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, const OUString &schemaName, @@ -83,13 +83,13 @@ class KeyDescriptors : public Container { public: // instances Columns 'exception safe' static css::uno::Reference< css::container::XIndexAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); protected: KeyDescriptors( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xtable.cxx b/connectivity/source/drivers/postgresql/pq_xtable.cxx index 17728bb71b20..148c21a927c2 100644 --- a/connectivity/source/drivers/postgresql/pq_xtable.cxx +++ b/connectivity/source/drivers/postgresql/pq_xtable.cxx @@ -73,7 +73,7 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -Table::Table( const ::rtl::Reference< RefCountedMutex > & refMutex, +Table::Table( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -89,7 +89,7 @@ Table::Table( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > Table::createDataDescriptor( ) { TableDescriptor * pTable = new TableDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pTable->copyValuesFrom( this ); return Reference< XPropertySet > ( pTable ); @@ -100,7 +100,7 @@ Reference< XNameAccess > Table::getColumns( ) if( ! m_columns.is() ) { m_columns = Columns::create( - m_refMutex, + m_xMutex, m_conn, m_pSettings, extractStringProperty( this, getStatics().SCHEMA_NAME ), @@ -115,7 +115,7 @@ Reference< XNameAccess > Table::getIndexes() if( ! m_indexes.is() ) { m_indexes = ::pq_sdbc_driver::Indexes::create( - m_refMutex, + m_xMutex, m_conn, m_pSettings, extractStringProperty( this, getStatics().SCHEMA_NAME ), @@ -129,7 +129,7 @@ Reference< XIndexAccess > Table::getKeys( ) if( ! m_keys.is() ) { m_keys = ::pq_sdbc_driver::Keys::create( - m_refMutex, + m_xMutex, m_conn, m_pSettings, extractStringProperty( this, getStatics().SCHEMA_NAME ), @@ -140,7 +140,7 @@ Reference< XIndexAccess > Table::getKeys( ) void Table::rename( const OUString& newName ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); OUString oldName = extractStringProperty(this,st.NAME ); @@ -319,7 +319,7 @@ void Table::setName( const OUString& aName ) TableDescriptor::TableDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -336,7 +336,7 @@ Reference< XNameAccess > TableDescriptor::getColumns( ) { if( ! m_columns.is() ) { - m_columns = new ColumnDescriptors(m_refMutex, m_conn, m_pSettings ); + m_columns = new ColumnDescriptors(m_xMutex, m_conn, m_pSettings ); } return m_columns; } @@ -346,7 +346,7 @@ Reference< XNameAccess > TableDescriptor::getIndexes() if( ! m_indexes.is() ) { m_indexes = ::pq_sdbc_driver::IndexDescriptors::create( - m_refMutex, + m_xMutex, m_conn, m_pSettings); } @@ -358,7 +358,7 @@ Reference< XIndexAccess > TableDescriptor::getKeys( ) if( ! m_keys.is() ) { m_keys = ::pq_sdbc_driver::KeyDescriptors::create( - m_refMutex, + m_xMutex, m_conn, m_pSettings ); } @@ -408,7 +408,7 @@ Any TableDescriptor::queryInterface( const Type & reqType ) Reference< XPropertySet > TableDescriptor::createDataDescriptor( ) { TableDescriptor * pTable = new TableDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); // TODO: deep copies pTable->m_values = m_values; diff --git a/connectivity/source/drivers/postgresql/pq_xtable.hxx b/connectivity/source/drivers/postgresql/pq_xtable.hxx index 09fe3cbac88c..69e9d6435c8a 100644 --- a/connectivity/source/drivers/postgresql/pq_xtable.hxx +++ b/connectivity/source/drivers/postgresql/pq_xtable.hxx @@ -69,7 +69,7 @@ class Table : public ReflectionBase, Columns *m_pColumns; public: - Table( const ::rtl::Reference< RefCountedMutex > & refMutex, + Table( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -129,7 +129,7 @@ class TableDescriptor public: TableDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xtables.cxx b/connectivity/source/drivers/postgresql/pq_xtables.cxx index a713235b23e6..feaaf745fad1 100644 --- a/connectivity/source/drivers/postgresql/pq_xtables.cxx +++ b/connectivity/source/drivers/postgresql/pq_xtables.cxx @@ -73,7 +73,7 @@ using com::sun::star::sdbcx::XKeysSupplier; namespace pq_sdbc_driver { Tables::Tables( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) : Container( refMutex, origin, pSettings, getStatics().TABLE ) @@ -86,7 +86,7 @@ void Tables::refresh() { try { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Reference< XDatabaseMetaData > meta = m_origin->getMetaData(); @@ -105,7 +105,7 @@ void Tables::refresh() // if creating all these tables turns out to have too bad performance, we might // instead offer a factory interface Table * pTable = - new Table( m_refMutex, m_origin, m_pSettings ); + new Table( m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pTable; OUString name = xRow->getString( TABLE_INDEX_NAME+1); @@ -237,7 +237,7 @@ static void appendKeyList( void Tables::appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Reference< XStatement > stmt = m_origin->createStatement(); @@ -311,7 +311,7 @@ void Tables::appendByDescriptor( void Tables::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -350,11 +350,11 @@ void Tables::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Tables::createDataDescriptor() { - return new TableDescriptor( m_refMutex, m_origin, m_pSettings ); + return new TableDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > Tables::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, Tables **ppTables) diff --git a/connectivity/source/drivers/postgresql/pq_xtables.hxx b/connectivity/source/drivers/postgresql/pq_xtables.hxx index a3390cc2c1c3..33eab3a5b8c4 100644 --- a/connectivity/source/drivers/postgresql/pq_xtables.hxx +++ b/connectivity/source/drivers/postgresql/pq_xtables.hxx @@ -47,14 +47,14 @@ class Tables : public Container public: // instances Tables 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, Tables ** ppTables); protected: Tables( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xuser.cxx b/connectivity/source/drivers/postgresql/pq_xuser.cxx index b41af2736076..d310dada9aaf 100644 --- a/connectivity/source/drivers/postgresql/pq_xuser.cxx +++ b/connectivity/source/drivers/postgresql/pq_xuser.cxx @@ -63,7 +63,7 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -User::User( const ::rtl::Reference< RefCountedMutex > & refMutex, +User::User( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -77,7 +77,7 @@ User::User( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > User::createDataDescriptor( ) { - UserDescriptor * pUser = new UserDescriptor( m_refMutex, m_conn, m_pSettings ); + UserDescriptor * pUser = new UserDescriptor( m_xMutex, m_conn, m_pSettings ); pUser->copyValuesFrom( this ); return Reference< XPropertySet > ( pUser ); @@ -172,7 +172,7 @@ void User::revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int UserDescriptor::UserDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings ) : ReflectionBase( @@ -186,7 +186,7 @@ UserDescriptor::UserDescriptor( Reference< XPropertySet > UserDescriptor::createDataDescriptor( ) { - UserDescriptor * pUser = new UserDescriptor( m_refMutex, m_conn, m_pSettings ); + UserDescriptor * pUser = new UserDescriptor( m_xMutex, m_conn, m_pSettings ); pUser->copyValuesFrom( this ); return Reference< XPropertySet > ( pUser ); diff --git a/connectivity/source/drivers/postgresql/pq_xuser.hxx b/connectivity/source/drivers/postgresql/pq_xuser.hxx index 445e6814ec0f..950cd998b0d5 100644 --- a/connectivity/source/drivers/postgresql/pq_xuser.hxx +++ b/connectivity/source/drivers/postgresql/pq_xuser.hxx @@ -54,7 +54,7 @@ class User : public ReflectionBase, { public: - User( const ::rtl::Reference< RefCountedMutex > & refMutex, + User( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -84,7 +84,7 @@ class UserDescriptor : public ReflectionBase { public: UserDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xusers.cxx b/connectivity/source/drivers/postgresql/pq_xusers.cxx index 49fe64f99828..d34fca1505d6 100644 --- a/connectivity/source/drivers/postgresql/pq_xusers.cxx +++ b/connectivity/source/drivers/postgresql/pq_xusers.cxx @@ -63,7 +63,7 @@ using com::sun::star::sdbc::XResultSet; namespace pq_sdbc_driver { Users::Users( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) : Container( refMutex, origin, pSettings, getStatics().USER ) @@ -76,7 +76,7 @@ void Users::refresh() { try { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Reference< XStatement > stmt = m_origin->createStatement(); @@ -92,7 +92,7 @@ void Users::refresh() while( rs->next() ) { User * pUser = - new User( m_refMutex, m_origin, m_pSettings ); + new User( m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pUser; OUString name = xRow->getString( 1); @@ -119,7 +119,7 @@ void Users::refresh() void Users::appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); OUStringBuffer update( 128 ); update.append( "CREATE USER " ); @@ -147,7 +147,7 @@ void Users::dropByName( const OUString& elementName ) void Users::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -175,11 +175,11 @@ void Users::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Users::createDataDescriptor() { - return new UserDescriptor( m_refMutex, m_origin, m_pSettings ); + return new UserDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > Users::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) { diff --git a/connectivity/source/drivers/postgresql/pq_xusers.hxx b/connectivity/source/drivers/postgresql/pq_xusers.hxx index ef05a2b1307c..ef30c963bf83 100644 --- a/connectivity/source/drivers/postgresql/pq_xusers.hxx +++ b/connectivity/source/drivers/postgresql/pq_xusers.hxx @@ -47,13 +47,13 @@ class Users : public Container public: // instances Tables 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); protected: Users( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_xview.cxx b/connectivity/source/drivers/postgresql/pq_xview.cxx index ea63b8f34b58..2c8b6b7035b5 100644 --- a/connectivity/source/drivers/postgresql/pq_xview.cxx +++ b/connectivity/source/drivers/postgresql/pq_xview.cxx @@ -65,7 +65,7 @@ using com::sun::star::sdbc::SQLException; namespace pq_sdbc_driver { -View::View( const ::rtl::Reference< RefCountedMutex > & refMutex, +View::View( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -80,7 +80,7 @@ View::View( const ::rtl::Reference< RefCountedMutex > & refMutex, Reference< XPropertySet > View::createDataDescriptor( ) { ViewDescriptor * pView = new ViewDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pView->copyValuesFrom( this ); return Reference< XPropertySet > ( pView ); @@ -88,7 +88,7 @@ Reference< XPropertySet > View::createDataDescriptor( ) void View::rename( const OUString& newName ) { - MutexGuard guard( m_refMutex->mutex ); + MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); @@ -204,7 +204,7 @@ void View::setName( const OUString& aName ) ViewDescriptor::ViewDescriptor( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings) : ReflectionBase( @@ -219,7 +219,7 @@ ViewDescriptor::ViewDescriptor( Reference< XPropertySet > ViewDescriptor::createDataDescriptor( ) { ViewDescriptor * pView = new ViewDescriptor( - m_refMutex, m_conn, m_pSettings ); + m_xMutex, m_conn, m_pSettings ); pView->copyValuesFrom( this ); return Reference< XPropertySet > ( pView ); diff --git a/connectivity/source/drivers/postgresql/pq_xview.hxx b/connectivity/source/drivers/postgresql/pq_xview.hxx index 39fdc0d7f69c..d5c86981f6f4 100644 --- a/connectivity/source/drivers/postgresql/pq_xview.hxx +++ b/connectivity/source/drivers/postgresql/pq_xview.hxx @@ -53,7 +53,7 @@ class View : public ReflectionBase, public css::sdbcx::XRename { public: - View( const ::rtl::Reference< RefCountedMutex > & refMutex, + View( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); @@ -84,7 +84,7 @@ public: class ViewDescriptor : public ReflectionBase { public: - ViewDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex, + ViewDescriptor( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings); diff --git a/connectivity/source/drivers/postgresql/pq_xviews.cxx b/connectivity/source/drivers/postgresql/pq_xviews.cxx index 5fa0cf57fa2c..1dad00db42ba 100644 --- a/connectivity/source/drivers/postgresql/pq_xviews.cxx +++ b/connectivity/source/drivers/postgresql/pq_xviews.cxx @@ -64,7 +64,7 @@ using com::sun::star::sdbc::XResultSet; namespace pq_sdbc_driver { Views::Views( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings ) : Container( refMutex, origin, pSettings, getStatics().VIEW ) @@ -77,7 +77,7 @@ void Views::refresh() { try { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics & st = getStatics(); Reference< XStatement > stmt = m_origin->createStatement(); @@ -105,7 +105,7 @@ void Views::refresh() table = xRow->getString( 2 ); command = xRow->getString( 3 ); - View *pView = new View (m_refMutex, m_origin, m_pSettings ); + View *pView = new View (m_xMutex, m_origin, m_pSettings ); Reference< css::beans::XPropertySet > prop = pView; pView->setPropertyValue_NoBroadcast_public(st.NAME , makeAny(table) ); @@ -133,7 +133,7 @@ void Views::refresh() void Views::appendByDescriptor( const css::uno::Reference< css::beans::XPropertySet >& descriptor ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); Statics &st = getStatics(); OUString name,schema,command; @@ -172,7 +172,7 @@ void Views::dropByName( const OUString& elementName ) void Views::dropByIndex( sal_Int32 index ) { - osl::MutexGuard guard( m_refMutex->mutex ); + osl::MutexGuard guard( m_xMutex->GetMutex() ); if( index < 0 || index >= (sal_Int32)m_values.size() ) { throw css::lang::IndexOutOfBoundsException( @@ -199,11 +199,11 @@ void Views::dropByIndex( sal_Int32 index ) css::uno::Reference< css::beans::XPropertySet > Views::createDataDescriptor() { - return new ViewDescriptor( m_refMutex, m_origin, m_pSettings ); + return new ViewDescriptor( m_xMutex, m_origin, m_pSettings ); } Reference< css::container::XNameAccess > Views::create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, Views **ppViews) diff --git a/connectivity/source/drivers/postgresql/pq_xviews.hxx b/connectivity/source/drivers/postgresql/pq_xviews.hxx index bfca9392529f..5ce5b879bd0e 100644 --- a/connectivity/source/drivers/postgresql/pq_xviews.hxx +++ b/connectivity/source/drivers/postgresql/pq_xviews.hxx @@ -47,14 +47,14 @@ class Views : public Container public: // instances Views 'exception safe' static css::uno::Reference< css::container::XNameAccess > create( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, Views **ppViews ); protected: Views( - const ::rtl::Reference< RefCountedMutex > & refMutex, + const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings); diff --git a/package/inc/mutexholder.hxx b/include/comphelper/refcountedmutex.hxx index dac105f0157c..d7eb1a43b51a 100644 --- a/package/inc/mutexholder.hxx +++ b/include/comphelper/refcountedmutex.hxx @@ -17,36 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_PACKAGE_INC_MUTEXHOLDER_HXX -#define INCLUDED_PACKAGE_INC_MUTEXHOLDER_HXX +#ifndef INCLUDED_COMPHELPER_REFCOUNTEDMUTEX_HXX +#define INCLUDED_COMPHELPER_REFCOUNTEDMUTEX_HXX +#include <comphelper/comphelperdllapi.h> #include <osl/mutex.hxx> -#include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> -class SotMutexHolder +namespace comphelper { -friend class rtl::Reference<SotMutexHolder>; - - ::osl::Mutex m_aMutex; - sal_Int32 m_nRefCount; - - void acquire() - { - m_nRefCount++; - } - - void release() - { - if ( !--m_nRefCount ) - delete this; - } +class COMPHELPER_DLLPUBLIC RefCountedMutex : public salhelper::SimpleReferenceObject +{ + osl::Mutex m_aMutex; public: - SotMutexHolder() : m_nRefCount( 0 ) {} + ~RefCountedMutex() override; ::osl::Mutex& GetMutex() { return m_aMutex; } }; -#endif +} // namespace comphelper + +#endif // INCLUDED_COMPHELPER_REFCOUNTEDMUTEX_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/Library_xstor.mk b/package/Library_xstor.mk index 0b8f0657f8f6..03e7f5c90db9 100644 --- a/package/Library_xstor.mk +++ b/package/Library_xstor.mk @@ -25,6 +25,7 @@ $(eval $(call gb_Library_use_libraries,xstor,\ cppu \ cppuhelper \ sal \ + salhelper \ )) $(eval $(call gb_Library_add_exception_objects,xstor,\ diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 0362011e62d3..54e6dc74f6b9 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -26,13 +26,12 @@ #include <com/sun/star/xml/crypto/XCipherContext.hpp> #include <com/sun/star/xml/crypto/XDigestContext.hpp> +#include <comphelper/refcountedmutex.hxx> #include <package/Inflater.hxx> #include <ByteGrabber.hxx> #include <HashMaps.hxx> #include <EncryptionData.hxx> -#include <mutexholder.hxx> - #include <memory> namespace com { namespace sun { namespace star { @@ -55,7 +54,7 @@ class ZipEnumeration; class ZipFile { - rtl::Reference<SotMutexHolder> m_aMutexHolder; + rtl::Reference<comphelper::RefCountedMutex> m_aMutexHolder; EntryHash aEntries; ByteGrabber aGrabber; @@ -67,7 +66,7 @@ class ZipFile // aMediaType parameter is used only for raw stream header creation css::uno::Reference < css::io::XInputStream > createStreamForZipEntry( - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, ZipEntry & rEntry, const ::rtl::Reference < EncryptionData > &rData, sal_Int8 nStreamMode, @@ -89,12 +88,12 @@ class ZipFile public: - ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, + ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, css::uno::Reference < css::io::XInputStream > &xInput, const css::uno::Reference < css::uno::XComponentContext > &rxContext, bool bInitialise ); - ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, + ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, css::uno::Reference < css::io::XInputStream > &xInput, const css::uno::Reference < css::uno::XComponentContext > &rxContext, bool bInitialise, @@ -109,7 +108,7 @@ public: ZipEntry& rEntry, const ::rtl::Reference < EncryptionData > &rData, bool bDecrypt, - const rtl::Reference<SotMutexHolder>& aMutexHolder ); + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ); static css::uno::Reference< css::xml::crypto::XDigestContext > StaticGetDigestContextForChecksum( const css::uno::Reference< css::uno::XComponentContext >& xArgContext, @@ -135,7 +134,7 @@ public: const css::uno::Reference < css::io::XInputStream >& rStream ); static css::uno::Reference< css::io::XInputStream > StaticGetDataFromRawStream( - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::io::XInputStream >& xStream, const ::rtl::Reference < EncryptionData > &rData ); @@ -149,19 +148,19 @@ public: ZipEntry& rEntry, const ::rtl::Reference < EncryptionData > &rData, bool bDecrypt, - const rtl::Reference<SotMutexHolder>& aMutexHolder ); + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ); css::uno::Reference< css::io::XInputStream > getDataStream( ZipEntry& rEntry, const ::rtl::Reference < EncryptionData > &rData, bool bDecrypt, - const rtl::Reference<SotMutexHolder>& aMutexHolder ); + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ); css::uno::Reference< css::io::XInputStream > getWrappedRawStream( ZipEntry& rEntry, const ::rtl::Reference < EncryptionData > &rData, const OUString& aMediaType, - const rtl::Reference<SotMutexHolder>& aMutexHolder ); + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ); std::unique_ptr<ZipEnumeration> entries(); }; diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 42f04801b643..cd5a8caba757 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -31,10 +31,10 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/xml/crypto/CipherID.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <comphelper/refcountedmutex.hxx> #include <HashMaps.hxx> #include <osl/file.h> -#include <mutexholder.hxx> #include <vector> #include <memory> @@ -69,7 +69,7 @@ class ZipPackage : public cppu::WeakImplHelper > { protected: - rtl::Reference<SotMutexHolder> m_aMutexHolder; + rtl::Reference<comphelper::RefCountedMutex> m_aMutexHolder; css::uno::Sequence< css::beans::NamedValue > m_aStorageEncryptionKeys; css::uno::Sequence< sal_Int8 > m_aEncryptionKey; @@ -126,7 +126,7 @@ public: sal_Int32 GetChecksumAlgID() const { return m_nChecksumDigestID; } sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == css::xml::crypto::CipherID::AES_CBC_W3C_PADDING ? 32 : 16; } - rtl::Reference<SotMutexHolder>& GetSharedMutexRef() { return m_aMutexHolder; } + rtl::Reference<comphelper::RefCountedMutex>& GetSharedMutexRef() { return m_aMutexHolder; } void ConnectTo( const css::uno::Reference< css::io::XInputStream >& xInStream ); const css::uno::Sequence< sal_Int8 > GetEncryptionKey(); diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx index ed0799779273..2ae82d23c164 100644 --- a/package/inc/ZipPackageStream.hxx +++ b/package/inc/ZipPackageStream.hxx @@ -26,10 +26,10 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <ZipPackageEntry.hxx> #include <rtl/ref.hxx> +#include <comphelper/refcountedmutex.hxx> #include <cppuhelper/implbase.hxx> #include <EncryptionData.hxx> -#include <mutexholder.hxx> #define PACKAGE_STREAM_NOTSET 0 #define PACKAGE_STREAM_PACKAGEMEMBER 1 diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index b4c32af3e182..112e882c42de 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -29,10 +29,9 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <comphelper/interfacecontainer2.hxx> +#include <comphelper/refcountedmutex.hxx> #include <cppuhelper/implbase.hxx> -#include <mutexholder.hxx> - #include <ZipFile.hxx> #include <HashMaps.hxx> @@ -44,7 +43,7 @@ class OZipFileAccess : public ::cppu::WeakImplHelper< css::lang::XComponent, css::lang::XServiceInfo > { - rtl::Reference<SotMutexHolder> m_aMutexHolder; + rtl::Reference<comphelper::RefCountedMutex> m_aMutexHolder; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::io::XInputStream > m_xContentStream; std::unique_ptr<ZipFile> m_pZipFile; diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 0f73bdc2f6b6..2fc6927e4f04 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -34,15 +34,15 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) : m_pImpl( &aImpl ) -, m_rMutexRef( m_pImpl->m_rMutexRef ) +, m_xMutex( m_pImpl->m_xMutex ) , m_xStream( xStream ) , m_pInterfaceContainer( nullptr ) , m_aProperties( aProps ) , m_bDisposed( false ) , m_nStorageType( nStorageType ) { - OSL_ENSURE( m_pImpl->m_rMutexRef.is(), "No mutex is provided!" ); - if ( !m_pImpl->m_rMutexRef.is() ) + OSL_ENSURE( m_pImpl->m_xMutex.is(), "No mutex is provided!" ); + if ( !m_pImpl->m_xMutex.is() ) throw uno::RuntimeException(); // just a disaster assert(m_xStream.is()); @@ -52,7 +52,7 @@ OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > const & const uno::Sequence< beans::PropertyValue >& aProps, sal_Int32 nStorageType ) : m_pImpl( nullptr ) -, m_rMutexRef( new SotMutexHolder ) +, m_xMutex( new comphelper::RefCountedMutex ) , m_xStream( xStream ) , m_pInterfaceContainer( nullptr ) , m_aProperties( aProps ) @@ -64,7 +64,7 @@ OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > const & OInputCompStream::~OInputCompStream() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_bDisposed ) { @@ -106,7 +106,7 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -118,7 +118,7 @@ sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -131,7 +131,7 @@ sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& a void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -144,7 +144,7 @@ void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL OInputCompStream::available( ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -162,7 +162,7 @@ void SAL_CALL OInputCompStream::closeInput( ) uno::Reference< io::XInputStream > SAL_CALL OInputCompStream::getInputStream() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -174,7 +174,7 @@ uno::Reference< io::XInputStream > SAL_CALL OInputCompStream::getInputStream() uno::Reference< io::XOutputStream > SAL_CALL OInputCompStream::getOutputStream() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -187,7 +187,7 @@ uno::Reference< io::XOutputStream > SAL_CALL OInputCompStream::getOutputStream() void OInputCompStream::InternalDispose() { // can be called only by OWriteStream_Impl - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -214,7 +214,7 @@ void OInputCompStream::InternalDispose() void SAL_CALL OInputCompStream::dispose( ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -240,7 +240,7 @@ void SAL_CALL OInputCompStream::dispose( ) void SAL_CALL OInputCompStream::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -248,14 +248,14 @@ void SAL_CALL OInputCompStream::addEventListener( const uno::Reference< lang::XE } if ( !m_pInterfaceContainer ) - m_pInterfaceContainer = new ::comphelper::OInterfaceContainerHelper2( m_rMutexRef->GetMutex() ); + m_pInterfaceContainer = new ::comphelper::OInterfaceContainerHelper2( m_xMutex->GetMutex() ); m_pInterfaceContainer->addInterface( xListener ); } void SAL_CALL OInputCompStream::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -268,7 +268,7 @@ void SAL_CALL OInputCompStream::removeEventListener( const uno::Reference< lang: sal_Bool SAL_CALL OInputCompStream::hasByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -292,7 +292,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const OUString& sID ) OUString SAL_CALL OInputCompStream::getTargetByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -313,7 +313,7 @@ OUString SAL_CALL OInputCompStream::getTargetByID( const OUString& sID ) OUString SAL_CALL OInputCompStream::getTypeByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -334,7 +334,7 @@ OUString SAL_CALL OInputCompStream::getTypeByID( const OUString& sID ) uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -361,7 +361,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::getRelationshipsByType( const OUString& sType ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -394,7 +394,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::getAllRelationships() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -421,7 +421,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g void SAL_CALL OInputCompStream::insertRelationshipByID( const OUString& /*sID*/, const uno::Sequence< beans::StringPair >& /*aEntry*/, sal_Bool /*bReplace*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -437,7 +437,7 @@ void SAL_CALL OInputCompStream::insertRelationshipByID( const OUString& /*sID*/ void SAL_CALL OInputCompStream::removeRelationshipByID( const OUString& /*sID*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -453,7 +453,7 @@ void SAL_CALL OInputCompStream::removeRelationshipByID( const OUString& /*sID*/ void SAL_CALL OInputCompStream::insertRelationships( const uno::Sequence< uno::Sequence< beans::StringPair > >& /*aEntries*/, sal_Bool /*bReplace*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -469,7 +469,7 @@ void SAL_CALL OInputCompStream::insertRelationships( const uno::Sequence< uno:: void SAL_CALL OInputCompStream::clearRelationships() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -485,7 +485,7 @@ void SAL_CALL OInputCompStream::clearRelationships() uno::Reference< beans::XPropertySetInfo > SAL_CALL OInputCompStream::getPropertySetInfo() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -499,7 +499,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OInputCompStream::getProperty void SAL_CALL OInputCompStream::setPropertyValue( const OUString& aPropertyName, const uno::Any& /*aValue*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -521,7 +521,7 @@ void SAL_CALL OInputCompStream::setPropertyValue( const OUString& aPropertyName, uno::Any SAL_CALL OInputCompStream::getPropertyValue( const OUString& aProp ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -554,7 +554,7 @@ void SAL_CALL OInputCompStream::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -569,7 +569,7 @@ void SAL_CALL OInputCompStream::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -584,7 +584,7 @@ void SAL_CALL OInputCompStream::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { @@ -599,7 +599,7 @@ void SAL_CALL OInputCompStream::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 3c37aaf0975e..68c2ce2262ae 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -29,8 +29,9 @@ #include <com/sun/star/embed/XRelationshipAccess.hpp> #include <cppuhelper/implbase.hxx> #include <comphelper/interfacecontainer2.hxx> +#include <comphelper/refcountedmutex.hxx> +#include <rtl/ref.hxx> -#include "mutexholder.hxx" struct OWriteStream_Impl; @@ -41,7 +42,7 @@ class OInputCompStream : public cppu::WeakImplHelper < css::io::XInputStream { protected: OWriteStream_Impl* m_pImpl; - rtl::Reference<SotMutexHolder> m_rMutexRef; + rtl::Reference<comphelper::RefCountedMutex> m_xMutex; css::uno::Reference < css::io::XInputStream > m_xStream; ::comphelper::OInterfaceContainerHelper2* m_pInterfaceContainer; css::uno::Sequence < css::beans::PropertyValue > m_aProperties; diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index 444637e90278..2e8527b5fbdf 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.cxx @@ -56,7 +56,7 @@ uno::Sequence< uno::Type > SAL_CALL OInputSeekStream::getTypes() if ( pTypeCollection == nullptr ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; if ( pTypeCollection == nullptr ) { @@ -101,7 +101,7 @@ void SAL_CALL OInputSeekStream::release() void SAL_CALL OInputSeekStream::seek( sal_Int64 location ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -119,7 +119,7 @@ void SAL_CALL OInputSeekStream::seek( sal_Int64 location ) sal_Int64 SAL_CALL OInputSeekStream::getPosition() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); @@ -137,7 +137,7 @@ sal_Int64 SAL_CALL OInputSeekStream::getPosition() sal_Int64 SAL_CALL OInputSeekStream::getLength() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bDisposed ) { SAL_INFO("package.xstor", "Disposed!"); diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 9c4c6f3cc680..7c5d67400fd4 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -43,12 +43,12 @@ #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/ofopxmlhelper.hxx> +#include <comphelper/refcountedmutex.hxx> #include <rtl/digest.h> #include <rtl/instance.hxx> #include <PackageConstants.hxx> -#include <mutexholder.hxx> #include "selfterminatefilestream.hxx" #include "owriteablestream.hxx" @@ -62,14 +62,14 @@ using namespace ::com::sun::star; struct WSInternalData_Impl { - rtl::Reference<SotMutexHolder> m_rSharedMutexRef; + rtl::Reference<comphelper::RefCountedMutex> m_xSharedMutex; ::std::unique_ptr< ::cppu::OTypeCollection> m_pTypeCollection; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners sal_Int32 m_nStorageType; // the mutex reference MUST NOT be empty - WSInternalData_Impl( const rtl::Reference<SotMutexHolder>& rMutexRef, sal_Int32 nStorageType ) - : m_rSharedMutexRef( rMutexRef ) + WSInternalData_Impl( const rtl::Reference<comphelper::RefCountedMutex>& rMutexRef, sal_Int32 nStorageType ) + : m_xSharedMutex( rMutexRef ) , m_pTypeCollection() , m_aListenersContainer( rMutexRef->GetMutex() ) , m_nStorageType( nStorageType ) @@ -268,7 +268,8 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, sal_Int32 nStorageType, bool bDefaultCompress, const uno::Reference< io::XInputStream >& xRelInfoStream ) -: m_pAntiImpl( nullptr ) +: m_xMutex( new comphelper::RefCountedMutex ) +, m_pAntiImpl( nullptr ) , m_bHasDataToFlush( false ) , m_bFlushed( false ) , m_xPackageStream( xPackageStream ) @@ -336,7 +337,7 @@ void OWriteStream_Impl::CleanCacheStream() void OWriteStream_Impl::InsertIntoPackageFolder( const OUString& aName, const uno::Reference< container::XNameContainer >& xParentPackageFolder ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SAL_WARN_IF( !m_bFlushed, "package.xstor", "This method must not be called for nonflushed streams!" ); if ( m_bFlushed ) @@ -462,7 +463,7 @@ void OWriteStream_Impl::SetEncrypted( const ::comphelper::SequenceAsHashMap& aEn void OWriteStream_Impl::DisposeWrappers() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_pAntiImpl ) { try { @@ -694,7 +695,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetTempFileAsInputStream() void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputStream >& xInStream, const uno::Sequence< beans::PropertyValue >& aProps ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; // this call can be made only during parent storage commit // the parent storage is responsible for the correct handling @@ -775,7 +776,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt void OWriteStream_Impl::Commit() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "No package stream is set!" ); @@ -878,7 +879,7 @@ void OWriteStream_Impl::Revert() // can be called only from parent storage // means complete reload of the stream - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; if ( !m_bHasDataToFlush ) return; // nothing to do @@ -984,7 +985,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( bool OWriteStream_Impl::IsTransacted() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; return ( m_pAntiImpl && m_pAntiImpl->m_bTransacted ); } @@ -1088,7 +1089,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProper void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream >& xDestStream, const ::comphelper::SequenceAsHashMap& aEncryptionData ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( m_bUseCommonEncryption, "package.xstor", "The stream can not be encrypted!" ); @@ -1130,7 +1131,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRel void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream >& xDestStream ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; if ( m_pAntiImpl ) { @@ -1148,7 +1149,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMode, const ::comphelper::SequenceAsHashMap& aEncryptionData, bool bHierarchyAccess ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "No package stream is set!" ); @@ -1203,7 +1204,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMode, bool bHierarchyAccess ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "No package stream is set!" ); @@ -1348,7 +1349,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream_Impl( sal_Int32 nStre uno::Reference< io::XInputStream > OWriteStream_Impl::GetPlainRawInStream() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "No package stream is set!" ); @@ -1361,7 +1362,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetPlainRawInStream() uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "No package stream is set!" ); @@ -1377,7 +1378,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream() ::comphelper::SequenceAsHashMap OWriteStream_Impl::GetCommonRootEncryptionData() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; if ( m_nStorageType != embed::StorageFormats::PACKAGE || !m_pParent ) throw packages::NoEncryptionException(); @@ -1387,7 +1388,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream() void OWriteStream_Impl::InputStreamDisposed( OInputCompStream* pStream ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); m_aInputStreamsList.remove( pStream ); } @@ -1425,7 +1426,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io: void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTargetStream ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "The source stream for copying is incomplete!" ); if ( !m_xPackageStream.is() ) @@ -1461,7 +1462,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTargetStream, const ::comphelper::SequenceAsHashMap& aEncryptionData ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SAL_WARN_IF( !m_xPackageStream.is(), "package.xstor", "The source stream for copying is incomplete!" ); if ( !m_xPackageStream.is() ) @@ -1634,12 +1635,12 @@ OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, bool bTransacted ) , m_bTransacted( bTransacted ) { OSL_ENSURE( pImpl, "No base implementation!" ); - OSL_ENSURE( m_pImpl->m_rMutexRef.is(), "No mutex!" ); + OSL_ENSURE( m_pImpl->m_xMutex.is(), "No mutex!" ); - if ( !m_pImpl || !m_pImpl->m_rMutexRef.is() ) + if ( !m_pImpl || !m_pImpl->m_xMutex.is() ) throw uno::RuntimeException(); // just a disaster - m_pData.reset(new WSInternalData_Impl(pImpl->m_rMutexRef, m_pImpl->m_nStorageType)); + m_pData.reset(new WSInternalData_Impl(pImpl->m_xMutex, m_pImpl->m_nStorageType)); } OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, uno::Reference< io::XStream > const & xStream, bool bTransacted ) @@ -1650,12 +1651,12 @@ OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, uno::Reference< io::XStrea , m_bTransacted( bTransacted ) { OSL_ENSURE( pImpl && xStream.is(), "No base implementation!" ); - OSL_ENSURE( m_pImpl->m_rMutexRef.is(), "No mutex!" ); + OSL_ENSURE( m_pImpl->m_xMutex.is(), "No mutex!" ); - if ( !m_pImpl || !m_pImpl->m_rMutexRef.is() ) + if ( !m_pImpl || !m_pImpl->m_xMutex.is() ) throw uno::RuntimeException(); // just a disaster - m_pData.reset(new WSInternalData_Impl(pImpl->m_rMutexRef, m_pImpl->m_nStorageType)); + m_pData.reset(new WSInternalData_Impl(pImpl->m_xMutex, m_pImpl->m_nStorageType)); if ( xStream.is() ) { @@ -1668,7 +1669,7 @@ OWriteStream::OWriteStream( OWriteStream_Impl* pImpl, uno::Reference< io::XStrea OWriteStream::~OWriteStream() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( m_pImpl ) { m_refCount++; @@ -1723,7 +1724,7 @@ void OWriteStream::CheckInitOnDemand() void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStream >& xDest ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -1866,7 +1867,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() { if (! m_pData->m_pTypeCollection) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if (! m_pData->m_pTypeCollection) { @@ -1981,7 +1982,7 @@ uno::Sequence< sal_Int8 > SAL_CALL OWriteStream::getImplementationId() sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -1999,7 +2000,7 @@ sal_Int32 SAL_CALL OWriteStream::readBytes( uno::Sequence< sal_Int8 >& aData, sa sal_Int32 SAL_CALL OWriteStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2017,7 +2018,7 @@ sal_Int32 SAL_CALL OWriteStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData void SAL_CALL OWriteStream::skipBytes( sal_Int32 nBytesToSkip ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2035,7 +2036,7 @@ void SAL_CALL OWriteStream::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL OWriteStream::available( ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2054,7 +2055,7 @@ sal_Int32 SAL_CALL OWriteStream::available( ) void SAL_CALL OWriteStream::closeInput( ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2077,7 +2078,7 @@ void SAL_CALL OWriteStream::closeInput( ) uno::Reference< io::XInputStream > SAL_CALL OWriteStream::getInputStream() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2093,7 +2094,7 @@ uno::Reference< io::XInputStream > SAL_CALL OWriteStream::getInputStream() uno::Reference< io::XOutputStream > SAL_CALL OWriteStream::getOutputStream() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); try { @@ -2119,7 +2120,7 @@ uno::Reference< io::XOutputStream > SAL_CALL OWriteStream::getOutputStream() void SAL_CALL OWriteStream::writeBytes( const uno::Sequence< sal_Int8 >& aData ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); // the write method makes initialization itself, since it depends from the aData length // NO CheckInitOnDemand()! @@ -2187,7 +2188,7 @@ void SAL_CALL OWriteStream::flush() // during own commit but a user can explicitly flush the stream // so the changes will be available through cloning functionality. - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2229,7 +2230,7 @@ void OWriteStream::CloseOutput_Impl() void SAL_CALL OWriteStream::closeOutput() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2250,7 +2251,7 @@ void SAL_CALL OWriteStream::closeOutput() void SAL_CALL OWriteStream::seek( sal_Int64 location ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2268,7 +2269,7 @@ void SAL_CALL OWriteStream::seek( sal_Int64 location ) sal_Int64 SAL_CALL OWriteStream::getPosition() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2286,7 +2287,7 @@ sal_Int64 SAL_CALL OWriteStream::getPosition() sal_Int64 SAL_CALL OWriteStream::getLength() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2304,7 +2305,7 @@ sal_Int64 SAL_CALL OWriteStream::getLength() void SAL_CALL OWriteStream::truncate() { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2329,7 +2330,7 @@ void SAL_CALL OWriteStream::dispose() { // should be an internal method since it can be called only from parent storage { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2388,7 +2389,7 @@ void SAL_CALL OWriteStream::dispose() void SAL_CALL OWriteStream::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2403,7 +2404,7 @@ void SAL_CALL OWriteStream::addEventListener( void SAL_CALL OWriteStream::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2417,7 +2418,7 @@ void SAL_CALL OWriteStream::removeEventListener( void SAL_CALL OWriteStream::setEncryptionPassword( const OUString& aPass ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2436,7 +2437,7 @@ void SAL_CALL OWriteStream::setEncryptionPassword( const OUString& aPass ) void SAL_CALL OWriteStream::removeEncryption() { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2455,7 +2456,7 @@ void SAL_CALL OWriteStream::removeEncryption() void SAL_CALL OWriteStream::setEncryptionData( const uno::Sequence< beans::NamedValue >& aEncryptionData ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); CheckInitOnDemand(); @@ -2474,7 +2475,7 @@ void SAL_CALL OWriteStream::setEncryptionData( const uno::Sequence< beans::Named sal_Bool SAL_CALL OWriteStream::hasEncryptionData() { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if (!m_pImpl) return false; @@ -2507,7 +2508,7 @@ sal_Bool SAL_CALL OWriteStream::hasEncryptionData() sal_Bool SAL_CALL OWriteStream::hasByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2533,7 +2534,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const OUString& sID ) OUString SAL_CALL OWriteStream::getTargetByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2554,7 +2555,7 @@ OUString SAL_CALL OWriteStream::getTargetByID( const OUString& sID ) OUString SAL_CALL OWriteStream::getTypeByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2575,7 +2576,7 @@ OUString SAL_CALL OWriteStream::getTypeByID( const OUString& sID ) uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2602,7 +2603,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRelationshipsByType( const OUString& sType ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2635,7 +2636,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getAllRelationships() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2651,7 +2652,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getAl void SAL_CALL OWriteStream::insertRelationshipByID( const OUString& sID, const uno::Sequence< beans::StringPair >& aEntry, sal_Bool bReplace ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2711,7 +2712,7 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const OUString& sID, const void SAL_CALL OWriteStream::removeRelationshipByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2749,7 +2750,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const OUString& sID ) void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequence< beans::StringPair > >& aEntries, sal_Bool bReplace ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2828,7 +2829,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ void SAL_CALL OWriteStream::clearRelationships() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2846,7 +2847,7 @@ void SAL_CALL OWriteStream::clearRelationships() uno::Reference< beans::XPropertySetInfo > SAL_CALL OWriteStream::getPropertySetInfo() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); //TODO: return uno::Reference< beans::XPropertySetInfo >(); @@ -2854,7 +2855,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OWriteStream::getPropertySetI void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2976,7 +2977,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const OUString& aPropertyName, con uno::Any SAL_CALL OWriteStream::getPropertyValue( const OUString& aProp ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3035,7 +3036,7 @@ void SAL_CALL OWriteStream::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3050,7 +3051,7 @@ void SAL_CALL OWriteStream::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3065,7 +3066,7 @@ void SAL_CALL OWriteStream::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3080,7 +3081,7 @@ void SAL_CALL OWriteStream::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3154,7 +3155,7 @@ void SAL_CALL OWriteStream::commit() try { BroadcastTransaction( STOR_MESS_PRECOMMIT ); - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3211,7 +3212,7 @@ void SAL_CALL OWriteStream::revert() BroadcastTransaction( STOR_MESS_PREREVERT ); - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3255,7 +3256,7 @@ void SAL_CALL OWriteStream::revert() void SAL_CALL OWriteStream::addTransactionListener( const uno::Reference< embed::XTransactionListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3272,7 +3273,7 @@ void SAL_CALL OWriteStream::addTransactionListener( const uno::Reference< embed: void SAL_CALL OWriteStream::removeTransactionListener( const uno::Reference< embed::XTransactionListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index dde8375155bd..a5c92fe6c3fa 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -42,25 +42,18 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.h> +#include <comphelper/refcountedmutex.hxx> #include <comphelper/sequenceashashmap.hxx> #include <list> #include <memory> #include "ocompinstream.hxx" -#include "mutexholder.hxx" namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } -struct MutexHolder -{ - const rtl::Reference<SotMutexHolder> m_rMutexRef; - - MutexHolder() : m_rMutexRef( new SotMutexHolder ) {} -}; - namespace package { bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 ); } @@ -72,8 +65,10 @@ typedef ::std::list< OInputCompStream* > InputStreamsList_Impl; struct OStorage_Impl; class OWriteStream; -struct OWriteStream_Impl : public MutexHolder +struct OWriteStream_Impl { + rtl::Reference<comphelper::RefCountedMutex> m_xMutex; + friend struct OStorage_Impl; friend class OWriteStream; friend class OInputCompStream; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 58f30b9d29cf..5a06602448ca 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -73,7 +73,7 @@ typedef ::std::list< uno::WeakReference< lang::XComponent > > WeakComponentList; struct StorInternalData_Impl { - rtl::Reference<SotMutexHolder> m_rSharedMutexRef; + rtl::Reference<comphelper::RefCountedMutex> m_xSharedMutex; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners ::std::unique_ptr< ::cppu::OTypeCollection> m_pTypeCollection; bool m_bIsRoot; @@ -87,8 +87,8 @@ struct StorInternalData_Impl ::rtl::Reference< OHierarchyHolder_Impl > m_rHierarchyHolder; // the mutex reference MUST NOT be empty - StorInternalData_Impl( const rtl::Reference<SotMutexHolder>& rMutexRef, bool bRoot, sal_Int32 nStorageType, bool bReadOnlyWrap ) - : m_rSharedMutexRef( rMutexRef ) + StorInternalData_Impl( const rtl::Reference<comphelper::RefCountedMutex>& rMutexRef, bool bRoot, sal_Int32 nStorageType, bool bReadOnlyWrap ) + : m_xSharedMutex( rMutexRef ) , m_aListenersContainer( rMutexRef->GetMutex() ) , m_pTypeCollection() , m_bIsRoot( bRoot ) @@ -173,7 +173,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > const & xInpu const uno::Sequence< beans::PropertyValue >& xProperties, uno::Reference< uno::XComponentContext > const & xContext, sal_Int32 nStorageType ) -: m_rMutexRef( new SotMutexHolder ) +: m_xMutex( new comphelper::RefCountedMutex ) , m_pAntiImpl( nullptr ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) , m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) @@ -214,7 +214,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > const & xStream, const uno::Sequence< beans::PropertyValue >& xProperties, uno::Reference< uno::XComponentContext > const & xContext, sal_Int32 nStorageType ) -: m_rMutexRef( new SotMutexHolder ) +: m_xMutex( new comphelper::RefCountedMutex ) , m_pAntiImpl( nullptr ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) , m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) @@ -257,7 +257,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, uno::Reference< lang::XSingleServiceFactory > const & xPackage, uno::Reference< uno::XComponentContext > const & xContext, sal_Int32 nStorageType ) -: m_rMutexRef( new SotMutexHolder ) +: m_xMutex( new comphelper::RefCountedMutex ) , m_pAntiImpl( nullptr ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) , m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) @@ -286,7 +286,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, OStorage_Impl::~OStorage_Impl() { { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_pAntiImpl ) // root storage wrapper must set this member to NULL before destruction of object { SAL_WARN_IF( m_bIsRoot, "package.xstor", "The root storage wrapper must be disposed already" ); @@ -406,7 +406,7 @@ void OStorage_Impl::OpenOwnPackage() { SAL_WARN_IF( !m_bIsRoot, "package.xstor", "Opening of the package has no sense!" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xPackageFolder.is() ) { @@ -486,7 +486,7 @@ void OStorage_Impl::OpenOwnPackage() SotElementList_Impl& OStorage_Impl::GetChildrenList() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); ReadContents(); return m_aChildrenList; @@ -562,7 +562,7 @@ void OStorage_Impl::ReadRelInfoIfNecessary() void OStorage_Impl::ReadContents() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( m_bListCreated ) return; @@ -634,7 +634,7 @@ void OStorage_Impl::ReadContents() void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDest, bool bDirect ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); uno::Reference< beans::XPropertySet > xPropSet( xDest, uno::UNO_QUERY ); if ( !xPropSet.is() ) @@ -729,7 +729,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, SAL_WARN_IF( !xDest.is(), "package.xstor", "No destination storage!" ); SAL_WARN_IF( aName.isEmpty(), "package.xstor", "Empty element name!" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); uno::Reference< container::XNameAccess > xDestAccess( xDest, uno::UNO_QUERY_THROW ); if ( xDestAccess->hasByName( aName ) @@ -938,7 +938,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelatio void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& xNewStor ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "A committed storage is incomplete!" ); if ( !m_xPackageFolder.is() ) @@ -958,7 +958,7 @@ void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& x void OStorage_Impl::InsertIntoPackageFolder( const OUString& aName, const uno::Reference< container::XNameContainer >& xParentPackageFolder ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SAL_WARN_IF( !m_xPackageFolder.is(), "package.xstor", "An inserted storage is incomplete!" ); uno::Reference< lang::XUnoTunnel > xTunnel( m_xPackageFolder, uno::UNO_QUERY_THROW ); @@ -969,7 +969,7 @@ void OStorage_Impl::InsertIntoPackageFolder( const OUString& aName, void OStorage_Impl::Commit() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_bIsModified ) return; @@ -1209,7 +1209,7 @@ void OStorage_Impl::Commit() void OStorage_Impl::Revert() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !( m_nStorageMode & embed::ElementModes::WRITE ) ) return; // nothing to do @@ -1270,7 +1270,7 @@ void OStorage_Impl::Revert() ::comphelper::SequenceAsHashMap OStorage_Impl::GetCommonRootEncryptionData() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ; if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( THROW_WHERE ); @@ -1295,7 +1295,7 @@ SotElement_Impl* OStorage_Impl::FindElement( const OUString& rName ) { SAL_WARN_IF( rName.isEmpty(), "package.xstor", "Name is empty!" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); ReadContents(); @@ -1416,7 +1416,7 @@ SotElement_Impl* OStorage_Impl::InsertElement( const OUString& aName, bool bIsSt { OSL_ENSURE( FindElement( aName ) == nullptr, "Should not try to insert existing element" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); SotElement_Impl* pDeletedElm = nullptr; @@ -1455,7 +1455,7 @@ void OStorage_Impl::OpenSubStorage( SotElement_Impl* pElement, sal_Int32 nStorag SAL_WARN_IF( !pElement, "package.xstor", "pElement is not set!" ); SAL_WARN_IF( !pElement->m_bIsStorage, "package.xstor", "Storage flag is not set!" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if (!pElement->m_xStorage) { @@ -1476,7 +1476,7 @@ void OStorage_Impl::OpenSubStream( SotElement_Impl* pElement ) SAL_WARN_IF( !pElement, "package.xstor", "pElement is not set!" ); SAL_WARN_IF( pElement->m_bIsStorage, "package.xstor", "Storage flag is set!" ); - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if (!pElement->m_xStream) { @@ -1496,7 +1496,7 @@ void OStorage_Impl::OpenSubStream( SotElement_Impl* pElement ) uno::Sequence< OUString > OStorage_Impl::GetElementNames() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); ReadContents(); @@ -1780,7 +1780,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > const & xInputStream, : m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xContext, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; - m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_xMutex, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); } OStorage::OStorage( uno::Reference< io::XStream > const & xStream, @@ -1791,16 +1791,16 @@ OStorage::OStorage( uno::Reference< io::XStream > const & xStream, : m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xContext, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; - m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_xMutex, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, false)); } OStorage::OStorage( OStorage_Impl* pImpl, bool bReadOnlyWrap ) : m_pImpl( pImpl ) { // this call can be done only from OStorage_Impl implementation to create child storage - OSL_ENSURE( m_pImpl && m_pImpl->m_rMutexRef.is(), "The provided pointer & mutex MUST NOT be empty!" ); + OSL_ENSURE( m_pImpl && m_pImpl->m_xMutex.is(), "The provided pointer & mutex MUST NOT be empty!" ); - m_pData.reset(new StorInternalData_Impl( m_pImpl->m_rMutexRef, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, bReadOnlyWrap)); + m_pData.reset(new StorInternalData_Impl( m_pImpl->m_xMutex, m_pImpl->m_bIsRoot, m_pImpl->m_nStorageType, bReadOnlyWrap)); OSL_ENSURE( ( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE ) == embed::ElementModes::WRITE || m_pData->m_bReadOnlyWrap, @@ -1812,7 +1812,7 @@ OStorage::OStorage( OStorage_Impl* pImpl, bool bReadOnlyWrap ) OStorage::~OStorage() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( m_pImpl ) { m_refCount++; // to call dispose @@ -2003,7 +2003,7 @@ void OStorage::BroadcastTransaction( sal_Int8 nMessage ) SotElement_Impl* OStorage::OpenStreamElement_Impl( const OUString& aStreamName, sal_Int32 nOpenMode, bool bEncr ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); OSL_ENSURE( !m_pData->m_bReadOnlyWrap || ( nOpenMode & embed::ElementModes::WRITE ) != embed::ElementModes::WRITE, "An element can not be opened for writing in readonly storage!\n" ); @@ -2133,7 +2133,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() { if (! m_pData->m_pTypeCollection) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if (! m_pData->m_pTypeCollection) { @@ -2204,7 +2204,7 @@ uno::Sequence< sal_Int8 > SAL_CALL OStorage::getImplementationId() // XStorage void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& xDest ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2257,7 +2257,7 @@ void SAL_CALL OStorage::copyToStorage( const uno::Reference< embed::XStorage >& uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( const OUString& aStreamName, sal_Int32 nOpenMode ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2346,7 +2346,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( const OUString& aStorName, sal_Int32 nStorageMode ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2482,7 +2482,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const OUString& aStreamName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2555,7 +2555,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStreamElement( void SAL_CALL OStorage::copyLastCommitTo( const uno::Reference< embed::XStorage >& xTargetStorage ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2608,7 +2608,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( const OUString& aStorName, const uno::Reference< embed::XStorage >& xTargetStorage ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2689,7 +2689,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2747,7 +2747,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName ) sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2805,7 +2805,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName ) void SAL_CALL OStorage::removeElement( const OUString& aElementName ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2881,7 +2881,7 @@ void SAL_CALL OStorage::removeElement( const OUString& aElementName ) void SAL_CALL OStorage::renameElement( const OUString& aElementName, const OUString& aNewName ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -2968,7 +2968,7 @@ void SAL_CALL OStorage::copyElementTo( const OUString& aElementName, const uno::Reference< embed::XStorage >& xDest, const OUString& aNewName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3049,7 +3049,7 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, const uno::Reference< embed::XStorage >& xDest, const OUString& aNewName ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3141,7 +3141,7 @@ void SAL_CALL OStorage::moveElementTo( const OUString& aElementName, uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStream( const OUString& aStreamName, sal_Int32 nOpenMode, const uno::Sequence< beans::NamedValue >& aEncryptionData ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3230,7 +3230,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( const OUString& aStreamName, const uno::Sequence< beans::NamedValue >& aEncryptionData ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3302,7 +3302,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStream( uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( const OUString& sStreamName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3393,7 +3393,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( const OUString& sStreamName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3493,7 +3493,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( void SAL_CALL OStorage::insertRawEncrStreamElement( const OUString& aStreamName, const uno::Reference< io::XInputStream >& xInStream ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3575,7 +3575,7 @@ void SAL_CALL OStorage::commit() try { BroadcastTransaction( STOR_MESS_PRECOMMIT ); - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3630,7 +3630,7 @@ void SAL_CALL OStorage::revert() BroadcastTransaction( STOR_MESS_PREREVERT ); - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3690,7 +3690,7 @@ void SAL_CALL OStorage::revert() // XTransactionBroadcaster void SAL_CALL OStorage::addTransactionListener( const uno::Reference< embed::XTransactionListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3704,7 +3704,7 @@ void SAL_CALL OStorage::addTransactionListener( const uno::Reference< embed::XTr void SAL_CALL OStorage::removeTransactionListener( const uno::Reference< embed::XTransactionListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3723,7 +3723,7 @@ void SAL_CALL OStorage::removeTransactionListener( const uno::Reference< embed:: sal_Bool SAL_CALL OStorage::isModified() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3736,7 +3736,7 @@ sal_Bool SAL_CALL OStorage::isModified() void SAL_CALL OStorage::setModified( sal_Bool bModified ) { - ::osl::ResettableMutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::ResettableMutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3761,7 +3761,7 @@ void SAL_CALL OStorage::setModified( sal_Bool bModified ) void SAL_CALL OStorage::addModifyListener( const uno::Reference< util::XModifyListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3777,7 +3777,7 @@ void SAL_CALL OStorage::addModifyListener( void SAL_CALL OStorage::removeModifyListener( const uno::Reference< util::XModifyListener >& aListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3794,7 +3794,7 @@ void SAL_CALL OStorage::removeModifyListener( uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3850,7 +3850,7 @@ uno::Any SAL_CALL OStorage::getByName( const OUString& aName ) uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3880,7 +3880,7 @@ uno::Sequence< OUString > SAL_CALL OStorage::getElementNames() sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3919,7 +3919,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName ) uno::Type SAL_CALL OStorage::getElementType() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3933,7 +3933,7 @@ uno::Type SAL_CALL OStorage::getElementType() sal_Bool SAL_CALL OStorage::hasElements() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3964,7 +3964,7 @@ sal_Bool SAL_CALL OStorage::hasElements() // XComponent void SAL_CALL OStorage::dispose() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -3995,7 +3995,7 @@ void SAL_CALL OStorage::dispose() void SAL_CALL OStorage::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4010,7 +4010,7 @@ void SAL_CALL OStorage::addEventListener( void SAL_CALL OStorage::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4031,7 +4031,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const OUString& aPass ) void SAL_CALL OStorage::removeEncryption() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4096,7 +4096,7 @@ void SAL_CALL OStorage::removeEncryption() void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValue >& aEncryptionData ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4152,7 +4152,7 @@ void SAL_CALL OStorage::setEncryptionData( const uno::Sequence< beans::NamedValu sal_Bool SAL_CALL OStorage::hasEncryptionData() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); return m_pImpl && m_pImpl->m_bHasCommonEncryptionData; } @@ -4161,7 +4161,7 @@ sal_Bool SAL_CALL OStorage::hasEncryptionData() void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::NamedValue >& aAlgorithms ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4221,7 +4221,7 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4282,7 +4282,7 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms() uno::Reference< beans::XPropertySetInfo > SAL_CALL OStorage::getPropertySetInfo() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4296,7 +4296,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL OStorage::getPropertySetInfo( void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4398,7 +4398,7 @@ void SAL_CALL OStorage::setPropertyValue( const OUString& aPropertyName, const u uno::Any SAL_CALL OStorage::getPropertyValue( const OUString& aPropertyName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4494,7 +4494,7 @@ void SAL_CALL OStorage::addPropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4509,7 +4509,7 @@ void SAL_CALL OStorage::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4524,7 +4524,7 @@ void SAL_CALL OStorage::addVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4539,7 +4539,7 @@ void SAL_CALL OStorage::removeVetoableChangeListener( const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4556,7 +4556,7 @@ void SAL_CALL OStorage::removeVetoableChangeListener( sal_Bool SAL_CALL OStorage::hasByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4582,7 +4582,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const OUString& sID ) OUString SAL_CALL OStorage::getTargetByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4603,7 +4603,7 @@ OUString SAL_CALL OStorage::getTargetByID( const OUString& sID ) OUString SAL_CALL OStorage::getTypeByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4624,7 +4624,7 @@ OUString SAL_CALL OStorage::getTypeByID( const OUString& sID ) uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4651,7 +4651,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelationshipsByType( const OUString& sType ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4685,7 +4685,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRelationships() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4722,7 +4722,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno::Sequence< beans::StringPair >& aEntry, sal_Bool bReplace ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4782,7 +4782,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const OUString& sID, const uno: void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4820,7 +4820,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const OUString& sID ) void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence< beans::StringPair > >& aEntries, sal_Bool bReplace ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4899,7 +4899,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence void SAL_CALL OStorage::clearRelationships() { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -4930,7 +4930,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( const uno::Reference< io::XInputStream >& xInStream, const uno::Sequence< beans::PropertyValue >& aProps ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5005,7 +5005,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( const uno::Reference< embed::XOptimizedStorage >& xDest, const OUString& aNewName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5085,7 +5085,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStream >& xStream ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5143,7 +5143,7 @@ void SAL_CALL OStorage::writeAndAttachToStream( const uno::Reference< io::XStrea void SAL_CALL OStorage::attachToURL( const OUString& sURL, sal_Bool bReadOnly ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5211,7 +5211,7 @@ void SAL_CALL OStorage::attachToURL( const OUString& sURL, uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementName, const OUString& aPropertyName ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5297,7 +5297,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const OUString& aElementNam void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, const uno::Reference< io::XStream >& xTargetStream ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5368,7 +5368,7 @@ void SAL_CALL OStorage::copyStreamElementData( const OUString& aStreamName, cons // XHierarchicalStorageAccess uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamElementByHierarchicalName( const OUString& aStreamPath, ::sal_Int32 nOpenMode ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5431,7 +5431,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const OUString& aStreamPath ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { @@ -5458,7 +5458,7 @@ void SAL_CALL OStorage::removeStreamElementByHierarchicalName( const OUString& a // XHierarchicalStorageAccess2 uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncryptedStreamByHierarchicalName( const OUString& aStreamPath, ::sal_Int32 nOpenMode, const uno::Sequence< beans::NamedValue >& aEncryptionData ) { - ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_pData->m_xSharedMutex->GetMutex() ); if ( !m_pImpl ) { diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index 4fb4ed0900c6..50d2ac6d1f72 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -46,9 +46,9 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/weakref.hxx> #include <cppuhelper/interfacecontainer.h> +#include <comphelper/refcountedmutex.hxx> #include <comphelper/sequenceashashmap.hxx> - -#include "mutexholder.hxx" +#include <rtl/ref.hxx> #include <list> #include <memory> @@ -116,7 +116,7 @@ struct OStorage_Impl { typedef std::list<StorageHolder_Impl> StorageHoldersType; - rtl::Reference<SotMutexHolder> m_rMutexRef; + rtl::Reference<comphelper::RefCountedMutex> m_xMutex; OStorage* m_pAntiImpl; // only valid if external references exists StorageHoldersType m_aReadOnlyWrapList; // only valid if readonly external reference exists diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index bc905ddd64c6..e82e720795d3 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -40,7 +40,7 @@ using com::sun::star::packages::zip::ZipIOException; XUnbufferedStream::XUnbufferedStream( const uno::Reference< uno::XComponentContext >& xContext, - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, ZipEntry & rEntry, Reference < XInputStream > const & xNewZipStream, const ::rtl::Reference< EncryptionData >& rData, @@ -108,7 +108,7 @@ XUnbufferedStream::XUnbufferedStream( // allows to read package raw stream XUnbufferedStream::XUnbufferedStream( const uno::Reference< uno::XComponentContext >& /*xContext*/, - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, const Reference < XInputStream >& xRawStream, const ::rtl::Reference< EncryptionData >& rData ) : maMutexHolder( aMutexHolder ) diff --git a/package/source/zipapi/XUnbufferedStream.hxx b/package/source/zipapi/XUnbufferedStream.hxx index d46320eac21d..4c05b9dad3d9 100644 --- a/package/source/zipapi/XUnbufferedStream.hxx +++ b/package/source/zipapi/XUnbufferedStream.hxx @@ -25,12 +25,12 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/xml/crypto/XCipherContext.hpp> +#include <comphelper/refcountedmutex.hxx> #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> #include <package/Inflater.hxx> #include <ZipEntry.hxx> #include <CRC32.hxx> -#include <mutexholder.hxx> namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; @@ -47,7 +47,7 @@ class XUnbufferedStream : public cppu::WeakImplHelper > { protected: - rtl::Reference<SotMutexHolder> maMutexHolder; + rtl::Reference<comphelper::RefCountedMutex> maMutexHolder; css::uno::Reference < css::io::XInputStream > mxZipStream; css::uno::Reference < css::io::XSeekable > mxZipSeek; @@ -65,7 +65,7 @@ protected: public: XUnbufferedStream( const css::uno::Reference< css::uno::XComponentContext >& xContext, - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, ZipEntry & rEntry, css::uno::Reference < css::io::XInputStream > const & xNewZipStream, const ::rtl::Reference< EncryptionData >& rData, @@ -77,7 +77,7 @@ public: // allows to read package raw stream XUnbufferedStream( const css::uno::Reference< css::uno::XComponentContext >& xContext, - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, const css::uno::Reference < css::io::XInputStream >& xRawStream, const ::rtl::Reference< EncryptionData >& rData ); diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 8bb4a06764ff..2a45119f11d2 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -71,7 +71,7 @@ using ZipUtils::Inflater; /** This class is used to read entries from a zip file */ -ZipFile::ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, +ZipFile::ZipFile( const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder, uno::Reference < XInputStream > &xInput, const uno::Reference < XComponentContext > & rxContext, bool bInitialise ) @@ -92,7 +92,7 @@ ZipFile::ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, } } -ZipFile::ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, +ZipFile::ZipFile( const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, uno::Reference < XInputStream > &xInput, const uno::Reference < XComponentContext > & rxContext, bool bInitialise, bool bForceRecovery) @@ -383,7 +383,7 @@ bool ZipFile::StaticFillData ( ::rtl::Reference< BaseEncryptionData > & rData, return bOk; } -uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const rtl::Reference<SotMutexHolder>& aMutexHolder, +uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< XInputStream >& xStream, const ::rtl::Reference< EncryptionData > &rData ) @@ -604,7 +604,7 @@ public: } uno::Reference< XInputStream > ZipFile::createStreamForZipEntry( - const rtl::Reference<SotMutexHolder>& aMutexHolder, + const rtl::Reference< comphelper::RefCountedMutex >& aMutexHolder, ZipEntry & rEntry, const ::rtl::Reference< EncryptionData > &rData, sal_Int8 nStreamMode, @@ -635,7 +635,7 @@ std::unique_ptr<ZipEnumeration> ZipFile::entries() uno::Reference< XInputStream > ZipFile::getInputStream( ZipEntry& rEntry, const ::rtl::Reference< EncryptionData > &rData, bool bIsEncrypted, - const rtl::Reference<SotMutexHolder>& aMutexHolder ) + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); @@ -662,7 +662,7 @@ uno::Reference< XInputStream > ZipFile::getInputStream( ZipEntry& rEntry, uno::Reference< XInputStream > ZipFile::getDataStream( ZipEntry& rEntry, const ::rtl::Reference< EncryptionData > &rData, bool bIsEncrypted, - const rtl::Reference<SotMutexHolder>& aMutexHolder ) + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); @@ -698,7 +698,7 @@ uno::Reference< XInputStream > ZipFile::getDataStream( ZipEntry& rEntry, uno::Reference< XInputStream > ZipFile::getRawData( ZipEntry& rEntry, const ::rtl::Reference< EncryptionData >& rData, bool bIsEncrypted, - const rtl::Reference<SotMutexHolder>& aMutexHolder ) + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); @@ -712,7 +712,7 @@ uno::Reference< XInputStream > ZipFile::getWrappedRawStream( ZipEntry& rEntry, const ::rtl::Reference< EncryptionData >& rData, const OUString& aMediaType, - const rtl::Reference<SotMutexHolder>& aMutexHolder ) + const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 488e927d80ae..f121a80b1c52 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -136,7 +136,7 @@ class DummyInputStream : public ::cppu::WeakImplHelper< XInputStream > }; ZipPackage::ZipPackage ( const uno::Reference < XComponentContext > &xContext ) -: m_aMutexHolder( new SotMutexHolder ) +: m_aMutexHolder( new comphelper::RefCountedMutex ) , m_nStartKeyGenerationID( xml::crypto::DigestID::SHA1 ) , m_nChecksumDigestID( xml::crypto::DigestID::SHA1_1K ) , m_nCommonEncryptionID( xml::crypto::CipherID::BLOWFISH_CFB_8 ) diff --git a/package/source/zippackage/wrapstreamforshare.cxx b/package/source/zippackage/wrapstreamforshare.cxx index e621455cd224..62734f9240e3 100644 --- a/package/source/zippackage/wrapstreamforshare.cxx +++ b/package/source/zippackage/wrapstreamforshare.cxx @@ -33,12 +33,12 @@ using namespace ::com::sun::star; #endif WrapStreamForShare::WrapStreamForShare( const uno::Reference< io::XInputStream >& xInStream, - const rtl::Reference<SotMutexHolder>& rMutexRef ) -: m_rMutexRef( rMutexRef ) + const rtl::Reference< comphelper::RefCountedMutex >& rMutexRef ) +: m_xMutex( rMutexRef ) , m_xInStream( xInStream ) , m_nCurPos( 0 ) { - if ( !m_rMutexRef.is() || !m_xInStream.is() ) + if ( !m_xMutex.is() || !m_xInStream.is() ) { OSL_FAIL( "Wrong initialization of wrapping stream!" ); throw uno::RuntimeException(THROW_WHERE ); @@ -79,7 +79,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::readSomeBytes( uno::Sequence< sal_Int8 >& void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); @@ -92,7 +92,7 @@ void SAL_CALL WrapStreamForShare::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL WrapStreamForShare::available() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); @@ -102,7 +102,7 @@ sal_Int32 SAL_CALL WrapStreamForShare::available() void SAL_CALL WrapStreamForShare::closeInput() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); @@ -116,7 +116,7 @@ void SAL_CALL WrapStreamForShare::closeInput() // XSeekable void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); @@ -129,7 +129,7 @@ void SAL_CALL WrapStreamForShare::seek( sal_Int64 location ) sal_Int64 SAL_CALL WrapStreamForShare::getPosition() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); @@ -139,7 +139,7 @@ sal_Int64 SAL_CALL WrapStreamForShare::getPosition() sal_Int64 SAL_CALL WrapStreamForShare::getLength() { - ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ); + ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ); if ( !m_xInStream.is() ) throw io::IOException(THROW_WHERE ); diff --git a/package/source/zippackage/wrapstreamforshare.hxx b/package/source/zippackage/wrapstreamforshare.hxx index d96c6ffeb696..649284a69bc7 100644 --- a/package/source/zippackage/wrapstreamforshare.hxx +++ b/package/source/zippackage/wrapstreamforshare.hxx @@ -22,15 +22,15 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> +#include <comphelper/refcountedmutex.hxx> #include <cppuhelper/implbase.hxx> - -#include <mutexholder.hxx> +#include <rtl/ref.hxx> class WrapStreamForShare : public cppu::WeakImplHelper < css::io::XInputStream , css::io::XSeekable > { protected: - rtl::Reference<SotMutexHolder> m_rMutexRef; + rtl::Reference< comphelper::RefCountedMutex > m_xMutex; css::uno::Reference < css::io::XInputStream > m_xInStream; css::uno::Reference < css::io::XSeekable > m_xSeekable; @@ -38,7 +38,7 @@ protected: public: WrapStreamForShare( const css::uno::Reference< css::io::XInputStream >& xInStream, - const rtl::Reference<SotMutexHolder>& rMutexRef ); + const rtl::Reference< comphelper::RefCountedMutex >& rMutexRef ); virtual ~WrapStreamForShare() override; // XInputStream diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 5c8938cbefe6..1e5cb165af4b 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -44,7 +44,7 @@ using namespace ::com::sun::star; #endif OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >& rxContext ) -: m_aMutexHolder( new SotMutexHolder ) +: m_aMutexHolder( new comphelper::RefCountedMutex ) , m_xContext( rxContext ) , m_pListenersContainer( nullptr ) , m_bDisposed( false ) |