diff options
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/content.cxx | 16 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/provider.cxx | 14 |
2 files changed, 6 insertions, 24 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index beb3213eed41..1b7deb82f305 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -83,15 +83,8 @@ XTYPEPROVIDER_COMMON_IMPL( Content ); // virtual uno::Sequence< uno::Type > SAL_CALL Content::getTypes() { - static cppu::OTypeCollection* pCollection = nullptr; - - if ( !pCollection ) - { - osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ); - if ( !pCollection ) - { - static cppu::OTypeCollection aCollection( - CPPU_TYPE_REF( lang::XTypeProvider ), + static cppu::OTypeCollection ourTypeCollection( + CPPU_TYPE_REF( lang::XTypeProvider ), CPPU_TYPE_REF( lang::XServiceInfo ), CPPU_TYPE_REF( lang::XComponent ), CPPU_TYPE_REF( ucb::XContent ), @@ -101,11 +94,8 @@ uno::Sequence< uno::Type > SAL_CALL Content::getTypes() CPPU_TYPE_REF( beans::XPropertyContainer ), CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), CPPU_TYPE_REF( container::XChild ) ); - pCollection = &aCollection; - } - } - return (*pCollection).getTypes(); + return ourTypeCollection.getTypes(); } // XServiceInfo methods. diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx index b1bbf6ae467c..59c20e35ab74 100644 --- a/xmlhelp/source/cxxhelp/provider/provider.cxx +++ b/xmlhelp/source/cxxhelp/provider/provider.cxx @@ -90,23 +90,15 @@ css::uno::Sequence< sal_Int8 > SAL_CALL ContentProvider::getImplementationId() css::uno::Sequence< css::uno::Type > SAL_CALL ContentProvider::getTypes() { - static cppu::OTypeCollection* pCollection = nullptr; - if ( !pCollection ) - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - if ( !pCollection ) - { - static cppu::OTypeCollection collection( + static cppu::OTypeCollection ourTypeCollection( cppu::UnoType<lang::XTypeProvider>::get(), cppu::UnoType<lang::XServiceInfo>::get(), cppu::UnoType<ucb::XContentProvider>::get(), cppu::UnoType<lang::XComponent>::get(), cppu::UnoType<container::XContainerListener>::get() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); + + return ourTypeCollection.getTypes(); } |