diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-12 02:12:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-13 09:13:37 +0200 |
commit | a3bedb7ae8f23476843e00380aba05002aa1e827 (patch) | |
tree | 0eb626a63ebb5d45c7e837def5cca433b96eba56 | |
parent | e272761e8fca9eccbf6fd5737df2b1aee1730947 (diff) |
use local statics for getUnoTunnelImplementationId
replace uses of double checked locking pattern and
rtl::Static
Change-Id: I479d9d94f652b4fb4c67388405823a5f4e2b6ed4
Reviewed-on: https://gerrit.libreoffice.org/38690
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
29 files changed, 87 insertions, 307 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 113391b8bf39..680ee72e4de6 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -145,17 +145,9 @@ namespace Sequence< sal_Int8 > OToolBoxWindowItem::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } sal_Int64 SAL_CALL OToolBoxWindowItem::getSomething( const Sequence< sal_Int8 >& _rId ) diff --git a/comphelper/source/misc/accimplaccess.cxx b/comphelper/source/misc/accimplaccess.cxx index 9371384c1efc..96fdbd96f381 100644 --- a/comphelper/source/misc/accimplaccess.cxx +++ b/comphelper/source/misc/accimplaccess.cxx @@ -63,13 +63,11 @@ namespace comphelper return m_pImpl->m_nForeignControlledStates; } - namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; } - - const Sequence< sal_Int8 > OAccessibleImplementationAccess::getUnoTunnelImplementationId() { - ::cppu::OImplementationId &rID = lcl_ImplId::get(); - return rID.getImplementationId(); + static cppu::OImplementationId implID; + + return implID.getImplementationId(); } diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx index 9cf55cb1a351..18f0b8cff56a 100644 --- a/connectivity/source/commontools/ConnectionWrapper.cxx +++ b/connectivity/source/commontools/ConnectionWrapper.cxx @@ -166,17 +166,9 @@ sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >& Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } namespace diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx index 6853a69fac63..febc53170355 100644 --- a/connectivity/source/commontools/TConnection.cxx +++ b/connectivity/source/commontools/TConnection.cxx @@ -65,17 +65,9 @@ sal_Int64 SAL_CALL OMetaConnection::getSomething( const css::uno::Sequence< sal_ Sequence< sal_Int8 > OMetaConnection::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } ::dbtools::OPropertyMap& OMetaConnection::getPropMap() diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 144a6f16b0b5..34c8b6129180 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -77,17 +77,9 @@ OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection) Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index bb98b69b7690..cd42068305c4 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -506,17 +506,9 @@ sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8 Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } const OExtendedTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx index f8c61dee557a..b9687d7823bc 100644 --- a/connectivity/source/drivers/ado/AGroup.cxx +++ b/connectivity/source/drivers/ado/AGroup.cxx @@ -84,17 +84,9 @@ void OAdoGroup::refreshUsers() Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx index b33f57ab3f6a..c4ad0bb22273 100644 --- a/connectivity/source/drivers/ado/AIndex.cxx +++ b/connectivity/source/drivers/ado/AIndex.cxx @@ -74,17 +74,9 @@ void OAdoIndex::refreshColumns() Sequence< sal_Int8 > OAdoIndex::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx index 2df0c8775a80..f8797f779a85 100644 --- a/connectivity/source/drivers/ado/AKey.cxx +++ b/connectivity/source/drivers/ado/AKey.cxx @@ -69,17 +69,9 @@ void OAdoKey::refreshColumns() Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx index 6ef5fb391462..567f660bd72e 100644 --- a/connectivity/source/drivers/ado/ATable.cxx +++ b/connectivity/source/drivers/ado/ATable.cxx @@ -126,17 +126,9 @@ void OAdoTable::refreshIndexes() Sequence< sal_Int8 > OAdoTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx index 447789f6a8fb..30e5d5164607 100644 --- a/connectivity/source/drivers/ado/AUser.cxx +++ b/connectivity/source/drivers/ado/AUser.cxx @@ -68,17 +68,9 @@ void OAdoUser::refreshGroups() Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx index f39e93577597..05c835b86e10 100644 --- a/connectivity/source/drivers/ado/AView.cxx +++ b/connectivity/source/drivers/ado/AView.cxx @@ -43,17 +43,9 @@ OAdoView::OAdoView(bool _bCase,ADOView* _pView) : OView_ADO(_bCase,nullptr) Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index 0d31b4b34cd9..0f030b5fbbc0 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -681,17 +681,9 @@ Any SAL_CALL OCalcTable::queryInterface( const Type & rType ) Sequence< sal_Int8 > OCalcTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index f3ec08b0ee44..575b195ca834 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -108,17 +108,9 @@ void ODbaseIndex::refreshColumns() Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // XUnoTunnel diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index d19a7bfba257..ec77d68ac17c 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -769,17 +769,9 @@ Any SAL_CALL ODbaseTable::queryInterface( const Type & rType ) Sequence< sal_Int8 > ODbaseTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index 27d2b2d9ee03..2d654cb49842 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -414,17 +414,9 @@ sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId ) Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } void OConnection::throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage) diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index eabbb78a0cfe..3388c905cd3e 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1405,17 +1405,9 @@ bool OResultSet::OpenImpl() Sequence< sal_Int8 > OResultSet::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 06ae56b2fea7..1f0c565c9119 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -553,17 +553,9 @@ Any SAL_CALL OFlatTable::queryInterface( const Type & rType ) Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx index 6ce97cd11b5e..6f0b4188943c 100644 --- a/connectivity/source/drivers/hsqldb/HTable.cxx +++ b/connectivity/source/drivers/hsqldb/HTable.cxx @@ -128,17 +128,9 @@ sdbcx::OCollection* OHSQLTable::createIndexes(const TStringVector& _rNames) Sequence< sal_Int8 > OHSQLTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx index a83c82639559..db9b591ad23e 100644 --- a/connectivity/source/drivers/mysql/YTable.cxx +++ b/connectivity/source/drivers/mysql/YTable.cxx @@ -147,17 +147,9 @@ sdbcx::OCollection* OMySQLTable::createIndexes(const TStringVector& _rNames) Sequence< sal_Int8 > OMySQLTable::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::lang::XUnoTunnel diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx index 511bd2e4f21f..fa0bb3fe2459 100644 --- a/connectivity/source/sdbcx/VDescriptor.cxx +++ b/connectivity/source/sdbcx/VDescriptor.cxx @@ -104,17 +104,9 @@ namespace connectivity Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index c78d8c961481..573f9cf14157 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2948,17 +2948,9 @@ void ORowSetClone::close() Sequence< sal_Int8 > ORowSetClone::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } // css::XUnoTunnel diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 02e83ef1b336..fb747850163b 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -476,17 +476,9 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } void ODBTableDecorator::fillPrivileges() const diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index a29f9971e73a..7f6ac225a0b1 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -726,17 +726,9 @@ sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& r Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForDocument, BasicManager& _rBasicManager ) diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx index 2214a4e8b8b0..1d027c04afda 100644 --- a/dbaccess/source/ui/querydesign/JoinExchange.cxx +++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx @@ -83,17 +83,9 @@ namespace dbaui Sequence< sal_Int8 > OJoinExchObj::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index f0837489bcc3..488e927d80ae 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -63,7 +63,6 @@ #include <cppuhelper/typeprovider.hxx> #include <rtl/uri.hxx> #include <rtl/random.h> -#include <rtl/instance.hxx> #include <osl/time.h> #include <osl/diagnose.h> #include "com/sun/star/io/XAsyncOutputMonitor.hpp" @@ -1631,12 +1630,11 @@ uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno:: static_getSupportedServiceNames() ); } -namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; } - Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId() { - ::cppu::OImplementationId &rId = lcl_ImplId::get(); - return rId.getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } sal_Int64 SAL_CALL ZipPackage::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 4dcd58d1039e..eeb651da8a0f 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2006,17 +2006,9 @@ uno::Sequence< sal_Int8 > SAL_CALL OReportDefinition::getImplementationId( ) uno::Sequence< sal_Int8 > OReportDefinition::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } uno::Reference< uno::XComponentContext > OReportDefinition::getContext() diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index e875191a7f5a..c8b29a7798b4 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -592,17 +592,9 @@ OSection* OSection::getImplementation( const uno::Reference< uno::XInterface >& uno::Sequence< sal_Int8 > OSection::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId * pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } void OSection::notifyElementAdded(const uno::Reference< drawing::XShape >& xShape ) diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx index 36e5b5e8931b..8db182de43fc 100644 --- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx @@ -39,17 +39,9 @@ XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNod /* XUnoTunnel */ cssu::Sequence< sal_Int8 > XMLElementWrapper_XmlSecImpl::getUnoTunnelImplementationId() { - static ::cppu::OImplementationId* pId = nullptr; - if (! pId) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pId) - { - static ::cppu::OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + static ::cppu::OImplementationId implId; + + return implId.getImplementationId(); } sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const cssu::Sequence< sal_Int8 >& aIdentifier ) |