From a2baea7faff31d26459dab3668a39eae85e4991b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:27:30 +0200 Subject: Adding upstream version 4:24.2.1. Signed-off-by: Daniel Baumann --- include/comphelper/configuration.hxx | 22 ++++------------------ include/comphelper/interfacecontainer3.hxx | 8 ++++++-- include/comphelper/interfacecontainer4.hxx | 6 +++--- 3 files changed, 13 insertions(+), 23 deletions(-) (limited to 'include/comphelper') 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 +#include +#include + #include #include #include #include #include #include -#include -#include -#include -#include 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 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 template inline void OInterfaceContainerHelper3::forEach(FuncT const& func) { + osl::ClearableMutexGuard aGuard(mrMutex); + if (std::as_const(maData)->empty()) + return; OInterfaceIteratorHelper3 iter(*this); + aGuard.clear(); while (iter.hasMoreElements()) { auto xListener = iter.next(); @@ -314,7 +318,7 @@ OInterfaceContainerHelper3::addInterface(const css::uno::Reference
  • push_back(rListener); - return maData->size(); + return std::as_const(maData)->size(); } template @@ -337,7 +341,7 @@ sal_Int32 OInterfaceContainerHelper3::removeInterface( if (it != maData->end()) maData->erase(it); - return maData->size(); + return std::as_const(maData)->size(); } template 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::forEach(std::unique_lock& 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::addInterface(std::unique_lock (void)rGuard; assert(rListener.is()); maData->push_back(rListener); - return maData->size(); + return std::as_const(maData)->size(); } template @@ -377,7 +377,7 @@ sal_Int32 OInterfaceContainerHelper4::removeInterface( if (it != maData->end()) maData->erase(it); - return maData->size(); + return std::as_const(maData)->size(); } template -- cgit v1.2.3