From 146e998508d0b6922e4afedc1acde3aa99a44fbb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 26 Sep 2019 11:41:26 +0200 Subject: loplugin:virtualdead in sd Change-Id: Idca2a3a53c4b79ba21a3113da63a8a96d8b2cd81 Reviewed-on: https://gerrit.libreoffice.org/79641 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/animations/motionpathtag.cxx | 6 ----- sd/source/ui/annotations/annotationtag.cxx | 13 ----------- sd/source/ui/annotations/annotationtag.hxx | 3 --- sd/source/ui/func/smarttag.cxx | 37 ------------------------------ sd/source/ui/inc/View.hxx | 1 - sd/source/ui/inc/smarttag.hxx | 9 -------- sd/source/ui/view/sdview.cxx | 8 ------- sd/source/ui/view/viewoverlaymanager.cxx | 6 ----- sd/source/ui/view/viewshe2.cxx | 5 +--- 9 files changed, 1 insertion(+), 87 deletions(-) (limited to 'sd/source/ui') diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index c6f6a2eade54..53f141e80c76 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -248,7 +248,6 @@ public: virtual void CreateB2dIAObject() override; virtual bool IsFocusHdl() const override; - virtual bool isMarkable() const override; private: SdrPathObj* const mpPathObj; @@ -306,11 +305,6 @@ bool SdPathHdl::IsFocusHdl() const return false; } -bool SdPathHdl::isMarkable() const -{ - return false; -} - MotionPathTag::MotionPathTag( CustomAnimationPane& rPane, ::sd::View& rView, const CustomAnimationEffectPtr& pEffect ) : SmartTag( rView ) , mrPane( rPane ) diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index ac07ef84594a..bbec5d9223c6 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -154,7 +154,6 @@ public: virtual void CreateB2dIAObject() override; virtual bool IsFocusHdl() const override; - virtual bool isMarkable() const override; private: Reference< XAnnotation > mxAnnotation; @@ -238,11 +237,6 @@ bool AnnotationHdl::IsFocusHdl() const return true; } -bool AnnotationHdl::isMarkable() const -{ - return false; -} - AnnotationTag::AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const Reference< XAnnotation >& xAnnotation, Color const & rColor, int nIndex, const vcl::Font& rFont ) : SmartTag( rView ) , mrManager( rManager ) @@ -335,13 +329,6 @@ bool AnnotationTag::KeyInput( const KeyEvent& rKEvt ) } } -/** returns true if the SmartTag consumes this event. */ -bool AnnotationTag::RequestHelp( const HelpEvent& /*rHEvt*/ ) -{ - - return false; -} - /** returns true if the SmartTag consumes this event. */ bool AnnotationTag::Command( const CommandEvent& rCEvt ) { diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx index 7a62b5b13a06..65dabdc50bbc 100644 --- a/sd/source/ui/annotations/annotationtag.hxx +++ b/sd/source/ui/annotations/annotationtag.hxx @@ -42,9 +42,6 @@ public: /// @return true if the SmartTag consumes this event. virtual bool KeyInput( const KeyEvent& rKEvt ) override; - /// @return true if the SmartTag consumes this event. - virtual bool RequestHelp( const HelpEvent& rHEvt ) override; - /// @return true if the SmartTag consumes this event. virtual bool Command( const CommandEvent& rCEvt ) override; diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx index 397c2f17f383..ff53821168c9 100644 --- a/sd/source/ui/func/smarttag.cxx +++ b/sd/source/ui/func/smarttag.cxx @@ -50,12 +50,6 @@ bool SmartTag::KeyInput( const KeyEvent& /*rKEvt*/ ) return false; } -/** returns true if the SmartTag consumes this event. */ -bool SmartTag::RequestHelp( const HelpEvent& /*rHEvt*/ ) -{ - return false; -} - /** returns true if the SmartTag consumes this event. */ bool SmartTag::Command( const CommandEvent& /*rCEvt*/ ) { @@ -228,25 +222,6 @@ bool SmartTagSet::KeyInput( const KeyEvent& rKEvt ) return false; } -bool SmartTagSet::RequestHelp( const HelpEvent& rHEvt ) -{ - Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rHEvt.GetMousePosPixel() ) ); - SdrHdl* pHdl = mrView.PickHandle(aMDPos); - - if( pHdl ) - { - // if a smart tag handle is hit, forward event to its smart tag - SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( pHdl ); - if(pSmartHdl && pSmartHdl->getTag().is() ) - { - const SmartTagReference& xTag( pSmartHdl->getTag() ); - return xTag->RequestHelp( rHEvt ); - } - } - - return false; -} - /** returns true if the SmartTag consumes this event. */ bool SmartTagSet::Command( const CommandEvent& rCEvt ) { @@ -319,13 +294,6 @@ sal_uLong SmartTagSet::GetMarkedPointCount() const return 0; } -bool SmartTagSet::IsPointMarkable(const SdrHdl& rHdl) -{ - const SmartHdl* pSmartHdl = dynamic_cast< const SmartHdl* >( &rHdl ); - - return pSmartHdl && pSmartHdl->isMarkable(); -} - bool SmartTagSet::MarkPoint(SdrHdl& rHdl, bool bUnmark ) { if( mxSelectedTag.is() ) @@ -360,11 +328,6 @@ SmartHdl::SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind { } -bool SmartHdl::isMarkable() const -{ - return false; -} - } // end of namespace sd /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 2c4bf3bb1357..029a23f07d2c 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -180,7 +180,6 @@ public: virtual bool HasMarkablePoints() const override; virtual sal_Int32 GetMarkablePointCount() const override; virtual bool HasMarkedPoints() const override; - virtual bool IsPointMarkable(const SdrHdl& rHdl) const override; virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) override; virtual void CheckPossibilities() override; virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override; diff --git a/sd/source/ui/inc/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx index 2130246128a8..bbce06878ac4 100644 --- a/sd/source/ui/inc/smarttag.hxx +++ b/sd/source/ui/inc/smarttag.hxx @@ -55,9 +55,6 @@ public: /** returns true if the SmartTag consumes this event. */ virtual bool KeyInput( const KeyEvent& rKEvt ); - /** returns true if the SmartTag consumes this event. */ - virtual bool RequestHelp( const HelpEvent& rHEvt ); - /** returns true if the SmartTag consumes this event. */ virtual bool Command( const CommandEvent& rCEvt ); @@ -113,9 +110,6 @@ public: /** returns true if a SmartTag consumes this event. */ bool KeyInput( const KeyEvent& rKEvt ); - /** returns true if a SmartTag consumes this event. */ - bool RequestHelp( const HelpEvent& rHEvt ); - /** returns true if a SmartTag consumes this event. */ bool Command( const CommandEvent& rCEvt ); @@ -134,7 +128,6 @@ public: sal_uLong GetMarkablePointCount() const; bool HasMarkedPoints() const; sal_uLong GetMarkedPointCount() const; - static bool IsPointMarkable(const SdrHdl& rHdl); bool MarkPoint(SdrHdl& rHdl, bool bUnmark); bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark); @@ -167,8 +160,6 @@ public: SmartHdl( const SmartTagReference& xTag, const Point& rPnt, SdrHdlKind eNewKind ); const SmartTagReference& getTag() const { return mxSmartTag; } - - virtual bool isMarkable() const; private: SmartTagReference const mxSmartTag; }; diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index e1f822411bc4..0abaff31fc9f 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1116,14 +1116,6 @@ bool View::HasMarkedPoints() const return FmFormView::HasMarkedPoints(); } -bool View::IsPointMarkable(const SdrHdl& rHdl) const -{ - if( SmartTagSet::IsPointMarkable( rHdl ) ) - return true; - else - return FmFormView::IsPointMarkable( rHdl ); -} - bool View::MarkPoint(SdrHdl& rHdl, bool bUnmark ) { if( maSmartTags.MarkPoint( rHdl, bUnmark ) ) diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 02e5956b6867..dd5dc860c33f 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -137,7 +137,6 @@ public: virtual void CreateB2dIAObject() override; virtual bool IsFocusHdl() const override; virtual PointerStyle GetPointer() const override; - virtual bool isMarkable() const override; virtual void onMouseEnter(const MouseEvent& rMEvt) override; virtual void onHelpRequest(const HelpEvent& rHEvt) override; @@ -288,11 +287,6 @@ bool ImageButtonHdl::IsFocusHdl() const return false; } -bool ImageButtonHdl::isMarkable() const -{ - return false; -} - PointerStyle ImageButtonHdl::GetPointer() const { return PointerStyle::Arrow; diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index f06f7bcea7f9..0341c104db7c 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -592,10 +592,7 @@ bool ViewShell::RequestHelp(const HelpEvent& rHEvt) if (bool(rHEvt.GetMode())) { - if( GetView() ) - bReturn = GetView()->getSmartTags().RequestHelp(rHEvt); - - if(!bReturn && HasCurrentFunction()) + if(HasCurrentFunction()) { bReturn = GetCurrentFunction()->RequestHelp(rHEvt); } -- cgit