diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-09 11:20:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-12 09:13:33 +0200 |
commit | 0f8873612829f7946ea6c3114b050320520eb75a (patch) | |
tree | 564d2582a85c6796f4552c5d2bef4e091e42a4b8 /chart2 | |
parent | 3e6ff89b5ca9c9b164deae82ab24a7ba1552e89e (diff) |
loplugin:mergeclasses
Change-Id: Icd01de71fe87e0bf17eba39f5b00fc9a46765509
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/inc/ChartController.hxx | 96 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 26 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartWindow.cxx | 20 |
3 files changed, 37 insertions, 105 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 59a374100fb6..80b4f6095089 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -77,57 +77,15 @@ namespace chart { class UndoGuard; - -enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT }; - -class WindowController -{ -public: - virtual ~WindowController() {}; - - virtual void PrePaint(vcl::RenderContext& rRenderContext) = 0; - virtual void execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) = 0; - virtual void execute_MouseButtonDown( const MouseEvent& rMEvt ) = 0; - virtual void execute_MouseMove( const MouseEvent& rMEvt ) = 0; - virtual void execute_Tracking( const TrackingEvent& rTEvt ) = 0; - virtual void execute_MouseButtonUp( const MouseEvent& rMEvt ) = 0; - virtual void execute_Resize() = 0; - virtual void execute_Activate() = 0; - virtual void execute_Deactivate() = 0; - virtual void execute_GetFocus() = 0; - virtual void execute_LoseFocus() = 0; - virtual void execute_Command( const CommandEvent& rCEvt ) = 0; - virtual bool execute_KeyInput( const KeyEvent& rKEvt ) = 0; - - /** get help text to be shown in a quick help - - @param aAtLogicPosition the position in logic coordinates (of the - window) of the mouse cursor to determine for - which object help is requested. - - @param bIsBalloonHelp determines whether to return the long text version - (balloon help) or the shorter one (quick help). - - @param rOutQuickHelpText is filled with the quick help text - - @param rOutEqualRect is filled with a rectangle that denotes the region - in which the quick help does not change. - - @return </sal_True>, if a quick help should be shown. - */ - virtual bool requestQuickHelp( - ::Point aAtLogicPosition, bool bIsBalloonHelp, - OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect ) = 0; - - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() = 0; -}; - class ChartWindow; class DrawModelWrapper; class DrawViewWrapper; class ReferenceSizeProvider; class ViewElementListProvider; +enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT }; + + class ChartController : public ::cppu::WeakImplHelper < ::com::sun::star::frame::XController //comprehends XComponent (required interface) ,::com::sun::star::frame::XDispatchProvider //(required interface) @@ -142,7 +100,6 @@ class ChartController : public ::cppu::WeakImplHelper < ,::com::sun::star::util::XModeChangeListener ,::com::sun::star::frame::XLayoutManagerListener > - , public WindowController { friend class DrawCommandDispatch; friend class ShapeController; @@ -406,26 +363,37 @@ public: const ::com::sun::star::uno::Any& aInfo ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // chart2::WindowController - virtual void PrePaint(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; - virtual void execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; - virtual void execute_MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; - virtual void execute_MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE; - virtual void execute_Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE; - virtual void execute_MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE; - virtual void execute_Resize() SAL_OVERRIDE; - virtual void execute_Activate() SAL_OVERRIDE; - virtual void execute_Deactivate() SAL_OVERRIDE; - virtual void execute_GetFocus() SAL_OVERRIDE; - virtual void execute_LoseFocus() SAL_OVERRIDE; - virtual void execute_Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; - virtual bool execute_KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE; - - virtual bool requestQuickHelp( + // WindowController stuff + void PrePaint(vcl::RenderContext& rRenderContext); + void execute_Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect); + void execute_MouseButtonDown( const MouseEvent& rMEvt ); + void execute_MouseMove( const MouseEvent& rMEvt ); + void execute_MouseButtonUp( const MouseEvent& rMEvt ); + void execute_Resize(); + void execute_Command( const CommandEvent& rCEvt ); + virtual bool execute_KeyInput( const KeyEvent& rKEvt ); + + /** get help text to be shown in a quick help + + @param aAtLogicPosition the position in logic coordinates (of the + window) of the mouse cursor to determine for + which object help is requested. + + @param bIsBalloonHelp determines whether to return the long text version + (balloon help) or the shorter one (quick help). + + @param rOutQuickHelpText is filled with the quick help text + + @param rOutEqualRect is filled with a rectangle that denotes the region + in which the quick help does not change. + + @return </sal_True>, if a quick help should be shown. + */ + bool requestQuickHelp( ::Point aAtLogicPosition, bool bIsBalloonHelp, - OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect ) SAL_OVERRIDE; + OUString & rOutQuickHelpText, ::com::sun::star::awt::Rectangle & rOutEqualRect ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE; + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); static bool isObjectDeleteable( const ::com::sun::star::uno::Any& rSelection ); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 2089aa1ae916..f6b03de8406b 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -719,10 +719,6 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt ) impl_SetMousePointer( rMEvt ); } -void ChartController::execute_Tracking( const TrackingEvent& ) -{ -} - void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) { ControllerLockGuardUNO aCLGuard( getModel() ); @@ -931,28 +927,6 @@ void ChartController::execute_Resize() m_pChartWindow->Invalidate(); } -void ChartController::execute_Activate() -{ - ///// pDrawViewWrapper->SetEditMode(sal_True); -} - -void ChartController::execute_Deactivate() -{ - /* - pDrawViewWrapper->SetEditMode(sal_False); - this->ReleaseMouse(); - */ -} - -void ChartController::execute_GetFocus() -{ -} - -void ChartController::execute_LoseFocus() -{ - //this->ReleaseMouse(); -} - void ChartController::execute_Command( const CommandEvent& rCEvt ) { bool bIsAction = false; diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index 91969a4d689d..1448b70bbba1 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -142,9 +142,7 @@ void ChartWindow::MouseMove( const MouseEvent& rMEvt ) void ChartWindow::Tracking( const TrackingEvent& rTEvt ) { - if( m_pWindowController ) - m_pWindowController->execute_Tracking( rTEvt ); - else + if( !m_pWindowController ) Window::Tracking( rTEvt ); } @@ -169,30 +167,22 @@ void ChartWindow::Resize() void ChartWindow::Activate() { - if( m_pWindowController ) - m_pWindowController->execute_Activate(); - else + if( !m_pWindowController ) Window::Activate(); } void ChartWindow::Deactivate() { - if( m_pWindowController ) - m_pWindowController->execute_Deactivate(); - else + if( !m_pWindowController ) Window::Deactivate(); } void ChartWindow::GetFocus() { - if( m_pWindowController ) - m_pWindowController->execute_GetFocus(); - else + if( !m_pWindowController ) Window::GetFocus(); } void ChartWindow::LoseFocus() { - if( m_pWindowController ) - m_pWindowController->execute_LoseFocus(); - else + if( !m_pWindowController ) Window::LoseFocus(); } |