From b44cbb26efe1d0b0950b1e1613e131b506dc3876 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 20 Jan 2015 12:38:10 +0200 Subject: new loplugin: change virtual methods to non-virtual Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae --- .../engine/animationnodes/basecontainernode.hxx | 2 +- slideshow/source/engine/pointersymbol.hxx | 2 +- slideshow/source/engine/slide/shapemanagerimpl.hxx | 2 +- slideshow/source/engine/slide/slideimpl.cxx | 30 ---------------------- slideshow/source/engine/slide/userpaintoverlay.cxx | 2 +- slideshow/source/engine/usereventqueue.cxx | 26 ------------------- slideshow/source/inc/shapeattributelayer.hxx | 2 +- 7 files changed, 5 insertions(+), 61 deletions(-) (limited to 'slideshow') diff --git a/slideshow/source/engine/animationnodes/basecontainernode.hxx b/slideshow/source/engine/animationnodes/basecontainernode.hxx index 0d83d1123309..46b762b45ec6 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.hxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.hxx @@ -51,7 +51,7 @@ protected: private: virtual bool init_st() SAL_OVERRIDE; - virtual bool init_children(); + bool init_children(); virtual void deactivate_st( NodeState eDestState ) SAL_OVERRIDE; virtual bool hasPendingAnimation() const SAL_OVERRIDE; // force to be implemented by derived class: diff --git a/slideshow/source/engine/pointersymbol.hxx b/slideshow/source/engine/pointersymbol.hxx index 8a144aa40732..a1d624a3a6ea 100644 --- a/slideshow/source/engine/pointersymbol.hxx +++ b/slideshow/source/engine/pointersymbol.hxx @@ -55,7 +55,7 @@ public: /** Use this method to update the pointer's position */ void setVisible( const bool bVisible ); - virtual void viewsChanged(const ::com::sun::star::geometry::RealPoint2D pos); + void viewsChanged(const ::com::sun::star::geometry::RealPoint2D pos); private: PointerSymbol( const ::com::sun::star::uno::Reference< diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx index 9a8b9925b093..6de066c42ec2 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.hxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx @@ -163,7 +163,7 @@ private: // ShapeCursorEventHandler interface - virtual bool cursorChanged( const ::com::sun::star::uno::Reference< + bool cursorChanged( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& xShape, sal_Int16 nCursor ); diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 1b60e8eab774..5549e5ebd213 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -110,12 +110,6 @@ public: virtual ~SlideImpl(); - // Disposable interface - - - virtual void dispose(); - - // Slide interface @@ -428,30 +422,6 @@ SlideImpl::~SlideImpl() } } -void SlideImpl::dispose() -{ - maSlideBitmaps.clear(); - mpPaintOverlay.reset(); - maAnimations.dispose(); - maContext.dispose(); - - if( mpShapeManager ) - { - maContext.mrScreenUpdater.removeViewUpdate(mpShapeManager); - mpShapeManager->dispose(); - } - - // TODO(Q3): Make sure LayerManager (and thus Shapes) dies first, - // because SlideShowContext has SubsettableShapeManager as - // reference member. - mpLayerManager.reset(); - mpSubsettableShapeManager.reset(); - mpShapeManager.reset(); - mxRootNode.clear(); - mxDrawPage.clear(); - mxDrawPagesSupplier.clear(); -} - bool SlideImpl::prefetch() { if( !mxRootNode.is() ) diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 9843d48b22ce..7fa45a298012 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -86,7 +86,7 @@ namespace slideshow drawPolygons(); } - virtual void dispose() + void dispose() { maViews.clear(); } diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 1d4ce3cf765b..ee73d0451ea0 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -111,11 +111,6 @@ public: maEvents() {} - void clearContainer() - { - maEvents = ImpEventQueue(); - } - void addEvent( const EventSharedPtr& rEvent ) { maEvents.push( rEvent ); @@ -135,11 +130,6 @@ public: maAnimationEventMap() {} - virtual void dispose() - { - maAnimationEventMap.clear(); - } - virtual bool handleAnimationEvent( const AnimationNodeSharedPtr& rNode ) SAL_OVERRIDE { ENSURE_OR_RETURN_FALSE( @@ -206,10 +196,6 @@ public: } private: - virtual void dispose() - { - clearContainer(); - } // triggered by API calls, e.g. space bar virtual bool handleEvent() SAL_OVERRIDE @@ -308,11 +294,6 @@ public: : EventContainer(), mrEventQueue(rEventQueue) {} private: - virtual void dispose() - { - clearContainer(); - } - virtual bool handleMouseReleased( awt::MouseEvent const& evt ) SAL_OVERRIDE { if(evt.Buttons != awt::MouseButton::RIGHT) @@ -339,13 +320,6 @@ public: maShapeEventMap() {} - virtual void dispose() - { - // TODO(Q1): Check whether plain vector with swap idiom is - // okay here - maShapeEventMap = ImpShapeEventMap(); - } - void addEvent( const EventSharedPtr& rEvent, const ShapeSharedPtr& rShape ) { diff --git a/slideshow/source/inc/shapeattributelayer.hxx b/slideshow/source/inc/shapeattributelayer.hxx index 80b73c2d0c3a..f2bed3498fba 100644 --- a/slideshow/source/inc/shapeattributelayer.hxx +++ b/slideshow/source/inc/shapeattributelayer.hxx @@ -64,7 +64,7 @@ namespace slideshow @return an abstract, numerical state ID. */ - virtual StateId getStateId() const = 0; + ; }; typedef ::boost::shared_ptr< State > StateSharedPtr; -- cgit v1.2.3