From 773a7b57fa99bdda9cde59937cd1987384ae533a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 7 Aug 2021 10:47:18 +0200 Subject: no need to use UNO_QUERY here Change-Id: I1bfe8238d7c08f27d2b21f9fe79712aba045c812 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120152 Tested-by: Jenkins Reviewed-by: Noel Grandin --- framework/source/services/autorecovery.cxx | 3 +-- framework/source/services/desktop.cxx | 15 +++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'framework') diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 495d22cee201..0c79cd4c97e9 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -3502,8 +3502,7 @@ void AutoRecovery::implts_informListener( Job eJob , { try { - css::uno::Reference< css::frame::XStatusListener > xListener(static_cast(pIt.next()), css::uno::UNO_QUERY); - xListener->statusChanged(aEvent); + static_cast(pIt.next())->statusChanged(aEvent); } catch(const css::uno::RuntimeException&) { diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index a9cb105ad8e4..0315ab1bae70 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -1621,19 +1621,17 @@ void Desktop::impl_sendTerminateToClipboard() { try { - css::uno::Reference< css::lang::XServiceInfo > xInfo( aIterator.next(), css::uno::UNO_QUERY ); + css::frame::XTerminateListener* pTerminateListener = + static_cast< css::frame::XTerminateListener* >(aIterator.next()); + css::uno::Reference< css::lang::XServiceInfo > xInfo( pTerminateListener, css::uno::UNO_QUERY ); if ( !xInfo.is() ) continue; if ( xInfo->getImplementationName() != "com.sun.star.comp.svt.TransferableHelperTerminateListener" ) continue; - css::uno::Reference< css::frame::XTerminateListener > xListener(xInfo, css::uno::UNO_QUERY); - if ( ! xListener.is() ) - continue; - css::lang::EventObject aEvent( static_cast< ::cppu::OWeakObject* >(this) ); - xListener->notifyTermination( aEvent ); + pTerminateListener->notifyTermination( aEvent ); // don't notify twice aIterator.remove(); @@ -1663,10 +1661,7 @@ void Desktop::impl_sendNotifyTerminationEvent() { try { - css::uno::Reference< css::frame::XTerminateListener > xListener(aIterator.next(), css::uno::UNO_QUERY); - if ( ! xListener.is() ) - continue; - xListener->notifyTermination( aEvent ); + static_cast< css::frame::XTerminateListener* >(aIterator.next())->notifyTermination( aEvent ); } catch( const css::uno::Exception& ) { -- cgit