summaryrefslogtreecommitdiff
path: root/include/comphelper/interfacecontainer3.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-28 16:16:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-28 21:07:13 +0100
commit134cbe4c3b94a5ec46849abd1eef2c3acb5f789e (patch)
tree8cbddc095f8dd6edcf37e428801020ac60804575 /include/comphelper/interfacecontainer3.hxx
parent6762aff78bd346ebf816ead77e73b6fa9d8ea7d8 (diff)
use more OInterfaceContainerHelper3 in SvxShapeCollection
which requires adding a getInterface method to OInterfaceContainerHelper3 Change-Id: I0962aa42c19859d7b78c998b8b4448a7ebfc19e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125981 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper/interfacecontainer3.hxx')
-rw-r--r--include/comphelper/interfacecontainer3.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/comphelper/interfacecontainer3.hxx b/include/comphelper/interfacecontainer3.hxx
index 82fa1f5e6b3d..9d4709918024 100644
--- a/include/comphelper/interfacecontainer3.hxx
+++ b/include/comphelper/interfacecontainer3.hxx
@@ -166,6 +166,9 @@ public:
the new count of elements in the container
*/
sal_Int32 removeInterface(const css::uno::Reference<ListenerT>& rxIFace);
+ /** Return an interface by index
+ */
+ const css::uno::Reference<ListenerT>& getInterface(sal_Int32 nIndex) const;
/**
Call disposing on all object in the container that
support XEventListener. Then clear the container.
@@ -320,6 +323,15 @@ sal_Int32 OInterfaceContainerHelper3<ListenerT>::removeInterface(
}
template <class ListenerT>
+const css::uno::Reference<ListenerT>&
+OInterfaceContainerHelper3<ListenerT>::getInterface(sal_Int32 nIndex) const
+{
+ osl::MutexGuard aGuard(rMutex);
+
+ return (*maData)[nIndex];
+}
+
+template <class ListenerT>
void OInterfaceContainerHelper3<ListenerT>::disposeAndClear(const css::lang::EventObject& rEvt)
{
osl::ClearableMutexGuard aGuard(rMutex);