diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:29:03 +0000 |
commit | 5a7157d319477830426797532e02ac39d3b859f4 (patch) | |
tree | 3773f5ce209bee14a5643e98672e0f3828c71434 /include/comphelper | |
parent | Releasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff) | |
download | libreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | include/comphelper/configuration.hxx | 22 | ||||
-rw-r--r-- | include/comphelper/interfacecontainer3.hxx | 8 | ||||
-rw-r--r-- | include/comphelper/interfacecontainer4.hxx | 6 |
3 files changed, 13 insertions, 23 deletions
diff --git a/include/comphelper/configuration.hxx b/include/comphelper/configuration.hxx index 652e9afaa6..51106a0a12 100644 --- a/include/comphelper/configuration.hxx +++ b/include/comphelper/configuration.hxx @@ -12,16 +12,15 @@ #include <sal/config.h> +#include <optional> +#include <string_view> + #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Reference.h> #include <comphelper/comphelperdllapi.h> #include <comphelper/processfactory.hxx> #include <sal/types.h> #include <memory> -#include <mutex> -#include <optional> -#include <string_view> -#include <unordered_map> namespace com::sun::star { namespace configuration { class XReadWriteAccess; } @@ -32,10 +31,6 @@ namespace com::sun::star { class XNameContainer; } namespace uno { class XComponentContext; } - namespace util { - class XChangesListener; - class XChangesNotifier; - } } namespace comphelper { @@ -85,17 +80,14 @@ private: namespace detail { -class ConfigurationChangesListener; - /// @internal class COMPHELPER_DLLPUBLIC ConfigurationWrapper { -friend class ConfigurationChangesListener; public: static ConfigurationWrapper const & get(); bool isReadOnly(OUString const & path) const; - css::uno::Any getPropertyValue(OUString const & path) const; + css::uno::Any getPropertyValue(std::u16string_view path) const; static void setPropertyValue( std::shared_ptr< ConfigurationChanges > const & batch, @@ -143,12 +135,6 @@ private: // css.beans.XHierarchicalPropertySetInfo), but then // configmgr::Access::asProperty() would report all properties as // READONLY, so isReadOnly() would not work - - mutable std::mutex maMutex; - bool mbDisposed; - mutable std::unordered_map<OUString, css::uno::Any> maPropertyCache; - css::uno::Reference< css::util::XChangesNotifier > maNotifier; - css::uno::Reference< css::util::XChangesListener > maListener; }; /// @internal diff --git a/include/comphelper/interfacecontainer3.hxx b/include/comphelper/interfacecontainer3.hxx index 02f96658dc..be140d3228 100644 --- a/include/comphelper/interfacecontainer3.hxx +++ b/include/comphelper/interfacecontainer3.hxx @@ -266,7 +266,11 @@ template <class T> template <typename FuncT> inline void OInterfaceContainerHelper3<T>::forEach(FuncT const& func) { + osl::ClearableMutexGuard aGuard(mrMutex); + if (std::as_const(maData)->empty()) + return; OInterfaceIteratorHelper3<T> iter(*this); + aGuard.clear(); while (iter.hasMoreElements()) { auto xListener = iter.next(); @@ -314,7 +318,7 @@ OInterfaceContainerHelper3<ListenerT>::addInterface(const css::uno::Reference<Li osl::MutexGuard aGuard(mrMutex); maData->push_back(rListener); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> @@ -337,7 +341,7 @@ sal_Int32 OInterfaceContainerHelper3<ListenerT>::removeInterface( if (it != maData->end()) maData->erase(it); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> diff --git a/include/comphelper/interfacecontainer4.hxx b/include/comphelper/interfacecontainer4.hxx index 1362ee1df7..e4a41e3067 100644 --- a/include/comphelper/interfacecontainer4.hxx +++ b/include/comphelper/interfacecontainer4.hxx @@ -288,7 +288,7 @@ inline void OInterfaceContainerHelper4<T>::forEach(std::unique_lock<std::mutex>& FuncT const& func) const { assert(rGuard.owns_lock()); - if (std::as_const(maData)->size() == 0) + if (std::as_const(maData)->empty()) { return; } @@ -353,7 +353,7 @@ OInterfaceContainerHelper4<ListenerT>::addInterface(std::unique_lock<std::mutex> (void)rGuard; assert(rListener.is()); maData->push_back(rListener); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> @@ -377,7 +377,7 @@ sal_Int32 OInterfaceContainerHelper4<ListenerT>::removeInterface( if (it != maData->end()) maData->erase(it); - return maData->size(); + return std::as_const(maData)->size(); } template <class ListenerT> |