From c66e8c7f94e0937a51a81c0c1626f349d30dd424 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Oct 2019 14:39:06 +0200 Subject: [PATCH] loplugin:virtualdead unused params in ShapeListenerEventHandler Change-Id: Ied95fd01912737ba1ae73fb1fea6ddd57eb8a14d Reviewed-on: https://gerrit.libreoffice.org/81070 Tested-by: Jenkins Reviewed-by: Noel Grandin --- compilerplugins/clang/virtualdead.unusedparams.results | 6 ------ slideshow/source/engine/eventmultiplexer.cxx | 10 ++++------ slideshow/source/engine/slide/shapemanagerimpl.cxx | 9 +++------ slideshow/source/engine/slide/shapemanagerimpl.hxx | 6 ++---- slideshow/source/engine/slideshowimpl.cxx | 6 ++---- slideshow/source/inc/eventmultiplexer.hxx | 6 ++---- slideshow/source/inc/shapelistenereventhandler.hxx | 6 ++---- 7 files changed, 15 insertions(+), 34 deletions(-) diff --git a/compilerplugins/clang/virtualdead.unusedparams.results b/compilerplugins/clang/virtualdead.unusedparams.results index a112391a9538..9c96c1eccf30 100644 --- a/compilerplugins/clang/virtualdead.unusedparams.results +++ b/compilerplugins/clang/virtualdead.unusedparams.results @@ -295,12 +295,6 @@ slideshow/source/engine/opengl/TransitionImpl.hxx:180 slideshow/source/inc/animation.hxx:61 void slideshow::internal::Animation::prefetch(const class std::shared_ptr &,const class std::shared_ptr &,) 00 -slideshow/source/inc/shapelistenereventhandler.hxx:51 - _Bool slideshow::internal::ShapeListenerEventHandler::listenerAdded(const class com::sun::star::uno::Reference &,const class com::sun::star::uno::Reference &,) - 01 -slideshow/source/inc/shapelistenereventhandler.hxx:54 - _Bool slideshow::internal::ShapeListenerEventHandler::listenerRemoved(const class com::sun::star::uno::Reference &,const class com::sun::star::uno::Reference &,) - 01 starmath/source/wordexportbase.hxx:37 void SmWordExportBase::HandleText(const class SmNode *,int,) 10 diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index ae915bf3a2ca..b583bd42c151 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -1027,21 +1027,19 @@ void EventMultiplexer::removeHyperlinkHandler( const HyperlinkHandlerSharedPtr& } void EventMultiplexer::notifyShapeListenerAdded( - const uno::Reference& xListener, const uno::Reference& xShape ) { mpImpl->maShapeListenerHandlers.applyAll( - [&xListener, &xShape]( const ShapeListenerEventHandlerSharedPtr& pHandler ) - { return pHandler->listenerAdded( xListener, xShape ); } ); + [&xShape]( const ShapeListenerEventHandlerSharedPtr& pHandler ) + { return pHandler->listenerAdded( xShape ); } ); } void EventMultiplexer::notifyShapeListenerRemoved( - const uno::Reference& xListener, const uno::Reference& xShape ) { mpImpl->maShapeListenerHandlers.applyAll( - [&xListener, &xShape]( const ShapeListenerEventHandlerSharedPtr& pHandler ) - { return pHandler->listenerRemoved( xListener, xShape ); } ); + [&xShape]( const ShapeListenerEventHandlerSharedPtr& pHandler ) + { return pHandler->listenerRemoved( xShape ); } ); } void EventMultiplexer::notifyUserPaintColor( RGBColor const& rUserColor ) diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 54be9f9daf60..dbc3e0299e1d 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -76,7 +76,7 @@ void ShapeManagerImpl::activate() // clone listener map uno::Reference xDummyListener; for( const auto& rListener : mrGlobalListenersMap ) - listenerAdded( xDummyListener, rListener.first ); + listenerAdded( rListener.first ); // clone cursor map for( const auto& rListener : mrGlobalCursorMap ) @@ -291,8 +291,7 @@ void ShapeManagerImpl::revokeSubset( const AttributableShapeSharedPtr& rOrigShap } bool ShapeManagerImpl::listenerAdded( - const uno::Reference& /*xListener*/, - const uno::Reference& xShape ) + const uno::Reference& xShape ) { ShapeEventListenerMap::const_iterator aIter; if( (aIter = mrGlobalListenersMap.find( xShape )) == @@ -313,9 +312,7 @@ bool ShapeManagerImpl::listenerAdded( return true; } -bool ShapeManagerImpl::listenerRemoved( - const uno::Reference& /*xListener*/, - const uno::Reference& xShape ) +bool ShapeManagerImpl::listenerRemoved( const uno::Reference& xShape ) { // shape really erased from map? maybe there are other listeners // for the same shape pending... diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 9da754102429..16042c2e9b5e 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -146,11 +146,9 @@ private: // ShapeListenerEventHandler - virtual bool listenerAdded( const css::uno::Reference< css::presentation::XShapeEventListener>& xListener, - const css::uno::Reference< css::drawing::XShape>& xShape ) override; + virtual bool listenerAdded( const css::uno::Reference< css::drawing::XShape>& xShape ) override; - virtual bool listenerRemoved( const css::uno::Reference< css::presentation::XShapeEventListener>& xListener, - const css::uno::Reference< css::drawing::XShape>& xShape ) override; + virtual bool listenerRemoved( const css::uno::Reference< css::drawing::XShape>& xShape ) override; void cursorChanged( const css::uno::Reference< css::drawing::XShape>& xShape, sal_Int16 nCursor ); diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 13d03bf484e4..a3a5dbe112ca 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1830,8 +1830,7 @@ void SlideShowImpl::addShapeEventListener( if( aIter->second.get() ) aIter->second->addInterface( xListener ); - maEventMultiplexer.notifyShapeListenerAdded(xListener, - xShape); + maEventMultiplexer.notifyShapeListenerAdded(xShape); } void SlideShowImpl::removeShapeEventListener( @@ -1857,8 +1856,7 @@ void SlideShowImpl::removeShapeEventListener( aIter->second->removeInterface( xListener ); } - maEventMultiplexer.notifyShapeListenerRemoved(xListener, - xShape); + maEventMultiplexer.notifyShapeListenerRemoved(xShape); } void SlideShowImpl::setShapeCursor( diff --git a/slideshow/source/inc/eventmultiplexer.hxx b/slideshow/source/inc/eventmultiplexer.hxx index 4cd3eec8bc8b..7756fe965d3b 100644 --- a/slideshow/source/inc/eventmultiplexer.hxx +++ b/slideshow/source/inc/eventmultiplexer.hxx @@ -496,16 +496,14 @@ public: This method announces that the given listener was added for the specified shape. */ - void notifyShapeListenerAdded( const css::uno::Reference& xListener, - const css::uno::Reference& xShape ); + void notifyShapeListenerAdded( const css::uno::Reference& xShape ); /** A shape event listener was removed This method announces that the given listener was removed for the specified shape. */ - void notifyShapeListenerRemoved( const css::uno::Reference& xListener, - const css::uno::Reference& xShape ); + void notifyShapeListenerRemoved( const css::uno::Reference& xShape ); /** Notify a new user paint color diff --git a/slideshow/source/inc/shapelistenereventhandler.hxx b/slideshow/source/inc/shapelistenereventhandler.hxx index fbbd6ef38ae3..81bd0c1f1b87 100644 --- a/slideshow/source/inc/shapelistenereventhandler.hxx +++ b/slideshow/source/inc/shapelistenereventhandler.hxx @@ -48,11 +48,9 @@ namespace slideshow public: virtual ~ShapeListenerEventHandler() {} - virtual bool listenerAdded( const css::uno::Reference& xListener, - const css::uno::Reference& xShape ) = 0; + virtual bool listenerAdded( const css::uno::Reference& xShape ) = 0; - virtual bool listenerRemoved( const css::uno::Reference& xListener, - const css::uno::Reference& xShape ) = 0; + virtual bool listenerRemoved( const css::uno::Reference& xShape ) = 0; }; typedef ::std::shared_ptr< ShapeListenerEventHandler > ShapeListenerEventHandlerSharedPtr;