diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-18 15:10:41 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-09-20 06:37:36 +0000 |
commit | 99bfc363a6f6779d0be2284f85a9131254bce1f9 (patch) | |
tree | 3da30adea892bae0f5e76031d8561e114c2da8d9 /svx | |
parent | e3c3b7fde3c017bd7d25f04fabf9b4528e37fb49 (diff) |
convert Link<> to typed
Change-Id: I10b050dc4aae45e646761a82520caa96969bc511
Reviewed-on: https://gerrit.libreoffice.org/18700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleFrameSelector.cxx | 17 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 8 | ||||
-rw-r--r-- | svx/source/form/databaselocationinput.cxx | 14 | ||||
-rw-r--r-- | svx/source/inc/AccessibleFrameSelector.hxx | 2 | ||||
-rw-r--r-- | svx/source/inc/gridcell.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/sdrpaintwindow.cxx | 16 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 9 |
7 files changed, 25 insertions, 43 deletions
diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 2667be3860cb..9cc6b776bbef 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -488,21 +488,14 @@ void AccFrameSelector::NotifyFocusListeners(bool bGetFocus) -IMPL_LINK( AccFrameSelector, WindowEventListener, VclSimpleEvent*, pEvent ) +IMPL_LINK_TYPED( AccFrameSelector, WindowEventListener, VclWindowEvent&, rEvent, void ) { - VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >( pEvent ); - DBG_ASSERT( pWinEvent, "AccFrameSelector::WindowEventListener - unknown window event" ); - if ( pWinEvent ) + vcl::Window* pWindow = rEvent.GetWindow(); + DBG_ASSERT( pWindow, "AccFrameSelector::WindowEventListener: no window!" ); + if ( !pWindow->IsAccessibilityEventsSuppressed() || ( rEvent.GetId() == VCLEVENT_OBJECT_DYING ) ) { - vcl::Window* pWindow = pWinEvent->GetWindow(); - DBG_ASSERT( pWindow, "AccFrameSelector::WindowEventListener: no window!" ); - if ( !pWindow->IsAccessibilityEventsSuppressed() || ( pWinEvent->GetId() == VCLEVENT_OBJECT_DYING ) ) - { - ProcessWindowEvent( *pWinEvent ); - } + ProcessWindowEvent( rEvent ); } - - return 0; } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 04b8c2b93ea4..b73b821cb733 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -3406,12 +3406,10 @@ void SAL_CALL FmXGridCell::removePaintListener( const Reference< awt::XPaintList } -IMPL_LINK( FmXGridCell, OnWindowEvent, VclWindowEvent*, _pEvent ) +IMPL_LINK_TYPED( FmXGridCell, OnWindowEvent, VclWindowEvent&, _rEvent, void ) { - ENSURE_OR_THROW( _pEvent, "illegal event pointer" ); - ENSURE_OR_THROW( _pEvent->GetWindow(), "illegal window" ); - onWindowEvent( _pEvent->GetId(), *_pEvent->GetWindow(), _pEvent->GetData() ); - return 1L; + ENSURE_OR_THROW( _rEvent.GetWindow(), "illegal window" ); + onWindowEvent( _rEvent.GetId(), *_rEvent.GetWindow(), _rEvent.GetData() ); } diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx index 54ab8fca8a55..ede20e829949 100644 --- a/svx/source/form/databaselocationinput.cxx +++ b/svx/source/form/databaselocationinput.cxx @@ -70,7 +70,7 @@ namespace svx void impl_onLocationModified(); OUString impl_getCurrentURL() const; - DECL_LINK( OnControlAction, VclWindowEvent* ); + DECL_LINK_TYPED( OnControlAction, VclWindowEvent&, void ); private: const Reference<XComponentContext> m_xContext; @@ -196,23 +196,21 @@ namespace svx } - IMPL_LINK( DatabaseLocationInputController_Impl, OnControlAction, VclWindowEvent*, _pEvent ) + IMPL_LINK_TYPED( DatabaseLocationInputController_Impl, OnControlAction, VclWindowEvent&, _rEvent, void ) { - if ( ( _pEvent->GetWindow() == &m_rBrowseButton ) - && ( _pEvent->GetId() == VCLEVENT_BUTTON_CLICK ) + if ( ( _rEvent.GetWindow() == &m_rBrowseButton ) + && ( _rEvent.GetId() == VCLEVENT_BUTTON_CLICK ) ) { impl_onBrowseButtonClicked(); } - if ( ( _pEvent->GetWindow() == &m_rLocationInput ) - && ( _pEvent->GetId() == VCLEVENT_EDIT_MODIFY ) + if ( ( _rEvent.GetWindow() == &m_rLocationInput ) + && ( _rEvent.GetId() == VCLEVENT_EDIT_MODIFY ) ) { impl_onLocationModified(); } - - return 0L; } diff --git a/svx/source/inc/AccessibleFrameSelector.hxx b/svx/source/inc/AccessibleFrameSelector.hxx index 3c20eec95e5d..a058576e41c6 100644 --- a/svx/source/inc/AccessibleFrameSelector.hxx +++ b/svx/source/inc/AccessibleFrameSelector.hxx @@ -102,7 +102,7 @@ public: void NotifyAccessibleEvent( const sal_Int16 _nEventId, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Any& _rNewValue ); protected: - DECL_LINK( WindowEventListener, VclSimpleEvent* ); + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 812c5d4867ca..b341397a2cfe 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -817,7 +817,7 @@ protected: virtual void onFocusLost( const ::com::sun::star::awt::FocusEvent& _rEvent ); private: - DECL_LINK( OnWindowEvent, VclWindowEvent* ); + DECL_LINK_TYPED( OnWindowEvent, VclWindowEvent&, void ); }; diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx index b0f3f7f7fd20..dea8e6c9fbb1 100644 --- a/svx/source/svdraw/sdrpaintwindow.cxx +++ b/svx/source/svdraw/sdrpaintwindow.cxx @@ -35,25 +35,19 @@ class CandidateMgr { std::vector<VclPtr<vcl::Window> > m_aCandidates; std::set<VclPtr<vcl::Window> > m_aDeletedCandidates; - DECL_LINK(WindowEventListener, VclSimpleEvent*); + DECL_LINK_TYPED(WindowEventListener, VclWindowEvent&, void); public: void PaintTransparentChildren(vcl::Window & rWindow, Rectangle const& rPixelRect); ~CandidateMgr(); }; -IMPL_LINK(CandidateMgr, WindowEventListener, VclSimpleEvent*, pEvent) +IMPL_LINK_TYPED(CandidateMgr, WindowEventListener, VclWindowEvent&, rEvent, void) { - VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >( pEvent ); - if (pWinEvent) + vcl::Window* pWindow = rEvent.GetWindow(); + if (rEvent.GetId() == VCLEVENT_OBJECT_DYING) { - vcl::Window* pWindow = pWinEvent->GetWindow(); - if (pWinEvent->GetId() == VCLEVENT_OBJECT_DYING) - { - m_aDeletedCandidates.insert(pWindow); - } + m_aDeletedCandidates.insert(pWindow); } - - return 0; } CandidateMgr::~CandidateMgr() diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index fda39c5684c1..6a94bce85b15 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -193,7 +193,7 @@ private: OUString( ".uno:CharEndPreviewFontName" ), aArgs ); } - DECL_DLLPRIVATE_LINK( CheckAndMarkUnknownFont, VclWindowEvent* ); + DECL_DLLPRIVATE_LINK_TYPED( CheckAndMarkUnknownFont, VclWindowEvent&, void ); void SetOptimalSize(); @@ -960,10 +960,10 @@ void SvxFontNameBox_Impl::FillList() SetSelection( aOldSel ); } -IMPL_LINK( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent*, event ) +IMPL_LINK_TYPED( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent&, event, void ) { - if( event->GetId() != VCLEVENT_EDIT_MODIFY ) - return 0; + if( event.GetId() != VCLEVENT_EDIT_MODIFY ) + return; OUString fontname = GetSubEdit()->GetText(); lcl_GetDocFontList( &pFontList, this ); // If the font is unknown, show it in italic. @@ -986,7 +986,6 @@ IMPL_LINK( SvxFontNameBox_Impl, CheckAndMarkUnknownFont, VclWindowEvent*, event SetQuickHelpText( SVX_RESSTR( RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE )); } } - return 0; } void SvxFontNameBox_Impl::Update( const SvxFontItem* pFontItem ) |