From cdae2f16ef9da75c1b3f9cc3f8abc3a180f324d1 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 19 Nov 2020 14:00:57 +0100 Subject: fix tdf#138335 guard sidebar uno methods with SolarMutex Wasn't threadsafe before; using vcl/gui code, so we need the SolarMutex. Change-Id: I3d4407f095837d03ad492fcdf9a08746cf911d25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106169 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- sfx2/source/sidebar/Theme.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sfx2/source/sidebar/Theme.cxx') diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx index 361a77414a8e..66294a5cd9a3 100644 --- a/sfx2/source/sidebar/Theme.cxx +++ b/sfx2/source/sidebar/Theme.cxx @@ -256,6 +256,8 @@ void Theme::UpdateTheme() void SAL_CALL Theme::disposing() { + SolarMutexGuard aGuard; + ChangeListeners aListeners; aListeners.swap(maChangeListeners); @@ -290,6 +292,8 @@ void SAL_CALL Theme::setPropertyValue ( const OUString& rsPropertyName, const css::uno::Any& rValue) { + SolarMutexGuard aGuard; + PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); if (iId == maPropertyNameToIdMap.end()) throw beans::UnknownPropertyException(rsPropertyName); @@ -332,6 +336,8 @@ void SAL_CALL Theme::setPropertyValue ( Any SAL_CALL Theme::getPropertyValue ( const OUString& rsPropertyName) { + SolarMutexGuard aGuard; + PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); if (iId == maPropertyNameToIdMap.end()) throw beans::UnknownPropertyException(rsPropertyName); @@ -349,6 +355,8 @@ void SAL_CALL Theme::addPropertyChangeListener( const OUString& rsPropertyName, const css::uno::Reference& rxListener) { + SolarMutexGuard aGuard; + ThemeItem eItem (AnyItem_); if (rsPropertyName.getLength() > 0) { @@ -371,6 +379,8 @@ void SAL_CALL Theme::removePropertyChangeListener( const OUString& rsPropertyName, const css::uno::Reference& rxListener) { + SolarMutexGuard aGuard; + ThemeItem eItem (AnyItem_); if (rsPropertyName.getLength() > 0) { @@ -403,6 +413,8 @@ void SAL_CALL Theme::addVetoableChangeListener( const OUString& rsPropertyName, const css::uno::Reference& rxListener) { + SolarMutexGuard aGuard; + ThemeItem eItem (AnyItem_); if (rsPropertyName.getLength() > 0) { @@ -425,6 +437,8 @@ void SAL_CALL Theme::removeVetoableChangeListener( const OUString& rsPropertyName, const css::uno::Reference& rxListener) { + SolarMutexGuard aGuard; + ThemeItem eItem (AnyItem_); if (rsPropertyName.getLength() > 0) { @@ -454,6 +468,8 @@ void SAL_CALL Theme::removeVetoableChangeListener( css::uno::Sequence SAL_CALL Theme::getProperties() { + SolarMutexGuard aGuard; + ::std::vector aProperties; sal_Int32 const nEnd(End_); @@ -479,6 +495,8 @@ css::uno::Sequence SAL_CALL Theme::getProperties() beans::Property SAL_CALL Theme::getPropertyByName (const OUString& rsPropertyName) { + SolarMutexGuard aGuard; + PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); if (iId == maPropertyNameToIdMap.end()) throw beans::UnknownPropertyException(rsPropertyName); @@ -498,6 +516,8 @@ beans::Property SAL_CALL Theme::getPropertyByName (const OUString& rsPropertyNam sal_Bool SAL_CALL Theme::hasPropertyByName (const OUString& rsPropertyName) { + SolarMutexGuard aGuard; + PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); if (iId == maPropertyNameToIdMap.end()) return false; -- cgit