From c25cb8a641723ab098980bb842caf75c0dc9b059 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 2 Oct 2012 15:03:12 +0200 Subject: fdo#46808, Adapt task::InteractionHandler UNO service to new style Since we don't need to expose XInitialisation, we can make the new-style service implement XInteractionHandler2. Change-Id: Ib27beed1c12df17592c6472d6f58c233d2c41558 --- comphelper/inc/comphelper/ihwrapnofilter.hxx | 15 +++++++++++---- comphelper/source/misc/ihwrapnofilter.cxx | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) (limited to 'comphelper') diff --git a/comphelper/inc/comphelper/ihwrapnofilter.hxx b/comphelper/inc/comphelper/ihwrapnofilter.hxx index 539e41ef5921..2ac1ac93d761 100644 --- a/comphelper/inc/comphelper/ihwrapnofilter.hxx +++ b/comphelper/inc/comphelper/ihwrapnofilter.hxx @@ -20,6 +20,7 @@ #ifndef _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_ #define _COMPHELPER_INTERACTIONHANDLERWRAPPER_HXX_ +#include #ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_ #include #endif @@ -36,14 +37,13 @@ #include #endif -#include +#include #include "comphelper/comphelperdllapi.h" namespace comphelper { - class COMPHELPER_DLLPUBLIC OIHWrapNoFilterDialog : public ::cppu::WeakImplHelper3 - < ::com::sun::star::task::XInteractionHandler - , ::com::sun::star::lang::XInitialization + class COMPHELPER_DLLPUBLIC OIHWrapNoFilterDialog : public ::cppu::WeakImplHelper2 + < ::com::sun::star::task::XInteractionHandler2 , ::com::sun::star::lang::XServiceInfo > { com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > m_xInter; @@ -63,6 +63,13 @@ namespace comphelper { virtual void SAL_CALL handle( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest) throw( com::sun::star::uno::RuntimeException ); + //____________________________________________________________________________________________________ + // XInteractionHandler2 + //____________________________________________________________________________________________________ + + virtual sal_Bool SAL_CALL handleInteractionRequest( const com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest >& xRequest) + throw( com::sun::star::uno::RuntimeException ); + //____________________________________________________________________________________________________ // XInitialization //____________________________________________________________________________________________________ diff --git a/comphelper/source/misc/ihwrapnofilter.cxx b/comphelper/source/misc/ihwrapnofilter.cxx index 238a2d5fb1c5..57c55d8dfde3 100644 --- a/comphelper/source/misc/ihwrapnofilter.cxx +++ b/comphelper/source/misc/ihwrapnofilter.cxx @@ -68,6 +68,26 @@ namespace comphelper m_xInter->handle( xRequest ); } + //---------------------------------------------------------------------------------------------------- + // XInteractionHandler2 + //---------------------------------------------------------------------------------------------------- + sal_Bool SAL_CALL OIHWrapNoFilterDialog::handleInteractionRequest( const uno::Reference< task::XInteractionRequest >& xRequest) + throw( com::sun::star::uno::RuntimeException ) + { + if( !m_xInter.is() ) + return sal_False; + + uno::Any aRequest = xRequest->getRequest(); + document::NoSuchFilterRequest aNoSuchFilterRequest; + if ( aRequest >>= aNoSuchFilterRequest ) + return sal_False; + else + { + m_xInter->handle( xRequest ); + return sal_True; + } + } + //---------------------------------------------------------------------------------------------------- // XInitialization //---------------------------------------------------------------------------------------------------- -- cgit