diff options
author | Noel Grandin <noel@peralex.com> | 2021-12-04 09:15:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-04 13:31:23 +0100 |
commit | 68723d543d37e42546aa42af8a855f96a5a70b5c (patch) | |
tree | 2951964ac76a29cb332101aa0b99c6a054503b48 /embedserv | |
parent | 4a1e9a911e62f0421b7ed67603091d49d30f7b4b (diff) |
use OMultiTypeInterfaceContainerHelperVar3 in embedserv
Change-Id: Iafb936ae3ba23c0c16c2da8538f8da29688df692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126346
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/embed/intercept.cxx | 23 | ||||
-rw-r--r-- | embedserv/source/inc/intercept.hxx | 4 |
2 files changed, 7 insertions, 20 deletions
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, |