diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-18 21:58:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-20 08:33:37 +0100 |
commit | 71f27d514549b7354f2c7b759c661e689e586162 (patch) | |
tree | a07d614b41f0fdbd0fa9eeab8b38f475995bd21a | |
parent | 279487b53ac876bb8ece9e5c2ec2882ca077bf13 (diff) |
use cppu::BaseMutex in SvXMLEmbeddedObjectHelper
because passing a ref of a local member to a parent class
means passing uninitialised data
Change-Id: I8ebfce789da19538379cfa0888a63a9b31d35a0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/svx/xmleohlp.hxx | 4 | ||||
-rw-r--r-- | svx/source/xml/xmleohlp.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/svx/xmleohlp.hxx b/include/svx/xmleohlp.hxx index d252ee8e2d0f..38ea69ffa053 100644 --- a/include/svx/xmleohlp.hxx +++ b/include/svx/xmleohlp.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SVX_XMLEOHLP_HXX #define INCLUDED_SVX_XMLEOHLP_HXX +#include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <osl/mutex.hxx> #include <com/sun/star/document/XEmbeddedObjectResolver.hpp> @@ -45,10 +46,9 @@ class OutputStorageWrapper_Impl; class SVXCORE_DLLPUBLIC SvXMLEmbeddedObjectHelper final : + public cppu::BaseMutex, public cppu::WeakComponentImplHelper< css::document::XEmbeddedObjectResolver, css::container::XNameAccess > { - ::osl::Mutex maMutex; - OUString maCurContainerStorageName; diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index 6db555d8ddb0..0f33e96c03a1 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -120,14 +120,14 @@ void SAL_CALL OutputStorageWrapper_Impl::closeOutput() } SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper() : - WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( maMutex ), + WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( m_aMutex ), mpDocPersist( nullptr ), meCreateMode( SvXMLEmbeddedObjectHelperMode::Read ) { } SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper( ::comphelper::IEmbeddedHelper& rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode ) : - WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( maMutex ), + WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( m_aMutex ), mpDocPersist( nullptr ), meCreateMode( SvXMLEmbeddedObjectHelperMode::Read ) { @@ -546,7 +546,7 @@ rtl::Reference<SvXMLEmbeddedObjectHelper> SvXMLEmbeddedObjectHelper::Create( OUString SAL_CALL SvXMLEmbeddedObjectHelper::resolveEmbeddedObjectURL(const OUString& rURL) { - MutexGuard aGuard( maMutex ); + MutexGuard aGuard( m_aMutex ); OUString sRet; try @@ -571,7 +571,7 @@ OUString SAL_CALL SvXMLEmbeddedObjectHelper::resolveEmbeddedObjectURL(const OUSt Any SAL_CALL SvXMLEmbeddedObjectHelper::getByName( const OUString& rURLStr ) { - MutexGuard aGuard( maMutex ); + MutexGuard aGuard( m_aMutex ); Any aRet; if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode ) { @@ -672,7 +672,7 @@ Sequence< OUString > SAL_CALL SvXMLEmbeddedObjectHelper::getElementNames() sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasByName( const OUString& rURLStr ) { - MutexGuard aGuard( maMutex ); + MutexGuard aGuard( m_aMutex ); if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode ) { return true; @@ -694,7 +694,7 @@ sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasByName( const OUString& rURLStr // XNameAccess Type SAL_CALL SvXMLEmbeddedObjectHelper::getElementType() { - MutexGuard aGuard( maMutex ); + MutexGuard aGuard( m_aMutex ); if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode ) return cppu::UnoType<XOutputStream>::get(); else @@ -703,7 +703,7 @@ Type SAL_CALL SvXMLEmbeddedObjectHelper::getElementType() sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasElements() { - MutexGuard aGuard( maMutex ); + MutexGuard aGuard( m_aMutex ); if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode ) { return true; |