embedserv/source/embed/intercept.cxx | 23 ++++------------------- embedserv/source/inc/intercept.hxx | 4 +++- 2 files changed, 7 insertions(+), 20 deletions(-)
New commits: commit 68723d543d37e42546aa42af8a855f96a5a70b5c Author: Noel Grandin <n...@peralex.com> AuthorDate: Sat Dec 4 09:15:37 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 4 13:31:23 2021 +0100 use OMultiTypeInterfaceContainerHelperVar3 in embedserv Change-Id: Iafb936ae3ba23c0c16c2da8538f8da29688df692 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126346 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/embedserv/source/embed/intercept.cxx b/embedserv/source/embed/intercept.cxx index ec10c642657b..96ca91575f86 100644 --- a/embedserv/source/embed/intercept.cxx +++ b/embedserv/source/embed/intercept.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <cppuhelper/weak.hxx> -#include <comphelper/multiinterfacecontainer2.hxx> #include <embeddoc.hxx> #include <docholder.hxx> @@ -36,15 +35,6 @@ constexpr OUStringLiteral IU4 = u".uno:CloseFrame"; constexpr OUStringLiteral IU5 = u".uno:SaveAs"; const uno::Sequence< OUString > Interceptor::m_aInterceptedURL{ IU0, IU1, IU2, IU3, IU4, IU5}; -class StatusChangeListenerContainer - : public comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> -{ -public: - explicit StatusChangeListenerContainer(osl::Mutex& aMutex) - : comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString>(aMutex) - { - } -}; void @@ -210,11 +200,11 @@ void Interceptor::generateFeatureStateEvent() if( i == 1 || (m_bLink && i != 5) ) continue; - comphelper::OInterfaceContainerHelper2* pICH = + comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener>* pICH = m_pStatCL->getContainer(m_aInterceptedURL[i]); if(!pICH) continue; - std::vector<uno::Reference<uno::XInterface> > aSeq = pICH->getElements(); + std::vector<uno::Reference<css::frame::XStatusListener> > aSeq = pICH->getElements(); if(aSeq.empty()) continue; @@ -243,13 +233,8 @@ void Interceptor::generateFeatureStateEvent() } - for(uno::Reference<uno::XInterface> const & k : std::as_const(aSeq)) - { - uno::Reference<frame::XStatusListener> Control(k,uno::UNO_QUERY); - if(Control.is()) - Control->statusChanged(aStateEvent); - - } + for(uno::Reference<css::frame::XStatusListener> const & control : std::as_const(aSeq)) + control->statusChanged(aStateEvent); } } } diff --git a/embedserv/source/inc/intercept.hxx b/embedserv/source/inc/intercept.hxx index db47362c9bec..c8435ec481fc 100644 --- a/embedserv/source/inc/intercept.hxx +++ b/embedserv/source/inc/intercept.hxx @@ -22,6 +22,7 @@ #include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> +#include <comphelper/multiinterfacecontainer3.hxx> #include <comphelper/interfacecontainer2.hxx> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/frame/XInterceptorInfo.hpp> @@ -31,10 +32,11 @@ #include "embeddocaccess.hxx" -class StatusChangeListenerContainer; class EmbedDocument_Impl; class DocumentHolder; +using StatusChangeListenerContainer = comphelper::OMultiTypeInterfaceContainerHelperVar3<css::frame::XStatusListener, OUString>; + class Interceptor : public ::cppu::WeakImplHelper< css::frame::XDispatchProviderInterceptor,