diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/fsstor/oinputstreamcontainer.cxx | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/svl/source/fsstor/oinputstreamcontainer.cxx b/svl/source/fsstor/oinputstreamcontainer.cxx index 9b9899992119..b62aca14c9b2 100644 --- a/svl/source/fsstor/oinputstreamcontainer.cxx +++ b/svl/source/fsstor/oinputstreamcontainer.cxx @@ -39,36 +39,21 @@ OFSInputStreamContainer::~OFSInputStreamContainer() uno::Sequence< uno::Type > SAL_CALL OFSInputStreamContainer::getTypes() { - static ::cppu::OTypeCollection* pTypeCollection = nullptr ; - - if ( pTypeCollection == nullptr ) + if (m_bSeekable) { - ::osl::MutexGuard aGuard( m_aMutex ) ; - - if ( pTypeCollection == nullptr ) - { - if ( m_bSeekable ) - { - static ::cppu::OTypeCollection aTypeCollection( - cppu::UnoType<io::XStream>::get(), - cppu::UnoType<io::XInputStream>::get(), - cppu::UnoType<io::XSeekable>::get()); - - pTypeCollection = &aTypeCollection ; - } - else - { - static ::cppu::OTypeCollection aTypeCollection( - cppu::UnoType<io::XStream>::get(), - cppu::UnoType<io::XInputStream>::get()); - - pTypeCollection = &aTypeCollection ; - } - } - } + static cppu::OTypeCollection aTypeCollection(cppu::UnoType<io::XStream>::get(), + cppu::UnoType<io::XInputStream>::get(), + cppu::UnoType<io::XSeekable>::get()); - return pTypeCollection->getTypes() ; + return aTypeCollection.getTypes(); + } + else + { + static cppu::OTypeCollection aTypeCollection(cppu::UnoType<io::XStream>::get(), + cppu::UnoType<io::XInputStream>::get()); + return aTypeCollection.getTypes(); + } } uno::Any SAL_CALL OFSInputStreamContainer::queryInterface( const uno::Type& rType ) |