diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-17 14:33:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-09-17 14:41:59 +0200 |
commit | 008de7099b29cde9a2669ef71b3e76b0c6ca90cd (patch) | |
tree | cfa107025f9ab2300dd8fc477a635a8b462a15e4 /sd | |
parent | cdadaa55569dbd1ea0fce3fa89f8b5f16f817438 (diff) |
convert Link<> to typed
Change-Id: I66e81dafa08b2e2a43b4b696741676e093439024
Diffstat (limited to 'sd')
23 files changed, 125 insertions, 149 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index a4a6bbb6efee..7b626e2e23a3 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -287,7 +287,7 @@ void CustomAnimationPane::KeyInput( const KeyEvent& rKEvt ) void CustomAnimationPane::addListener() { - Link<> aLink( LINK(this,CustomAnimationPane,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,CustomAnimationPane,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener ( aLink, tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION @@ -300,14 +300,14 @@ void CustomAnimationPane::addListener() void CustomAnimationPane::removeListener() { - Link<> aLink( LINK(this,CustomAnimationPane,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,CustomAnimationPane,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); } -IMPL_LINK(CustomAnimationPane,EventMultiplexerListener, - tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(CustomAnimationPane,EventMultiplexerListener, + tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION: onSelectionChanged(); @@ -344,11 +344,10 @@ IMPL_LINK(CustomAnimationPane,EventMultiplexerListener, onChangeCurrentPage(); break; case tools::EventMultiplexerEvent::EID_END_TEXT_EDIT: - if( mpMainSequence.get() && pEvent->mpUserData ) + if( mpMainSequence.get() && rEvent.mpUserData ) mpCustomAnimationList->update( mpMainSequence ); break; } - return 0; } static sal_Int32 getPropertyType( const OUString& rProperty ) diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx index 5760860f7f33..33c363e76e3c 100644 --- a/sd/source/ui/animations/CustomAnimationPane.hxx +++ b/sd/source/ui/animations/CustomAnimationPane.hxx @@ -119,7 +119,7 @@ private: DECL_LINK( implControlHdl, Control* ); DECL_LINK_TYPED( implClickHdl, Button*, void ); DECL_LINK(implPropertyHdl, void *); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(lateInitCallback, Timer *, void); private: diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 0948e8017439..4bc66133af1d 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -905,7 +905,7 @@ void SlideTransitionPane::stopEffects() void SlideTransitionPane::addListener() { - Link<> aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener ( aLink, tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION @@ -918,14 +918,14 @@ void SlideTransitionPane::addListener() void SlideTransitionPane::removeListener() { - Link<> aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,SlideTransitionPane,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); } -IMPL_LINK(SlideTransitionPane,EventMultiplexerListener, - tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(SlideTransitionPane,EventMultiplexerListener, + tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION: onSelectionChanged(); @@ -966,7 +966,6 @@ IMPL_LINK(SlideTransitionPane,EventMultiplexerListener, default: break; } - return 0; } IMPL_LINK_NOARG_TYPED(SlideTransitionPane, ApplyToAllButtonClicked, Button*, void) diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx index 24196b7cb4ea..023ac54a2add 100644 --- a/sd/source/ui/animations/SlideTransitionPane.hxx +++ b/sd/source/ui/animations/SlideTransitionPane.hxx @@ -95,7 +95,7 @@ private: DECL_LINK( SpeedListBoxSelected, void * ); DECL_LINK( SoundListBoxSelected, void * ); DECL_LINK_TYPED( LoopSoundBoxChecked, Button*, void ); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(LateInitCallback, Timer *, void); ViewShellBase & mrBase; diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 0a97c52264cc..a93d010c13d8 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -862,7 +862,7 @@ void AnnotationManagerImpl::DisposeTags() void AnnotationManagerImpl::addListener() { - Link<> aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener ( aLink, tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION @@ -873,14 +873,14 @@ void AnnotationManagerImpl::addListener() void AnnotationManagerImpl::removeListener() { - Link<> aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); } -IMPL_LINK(AnnotationManagerImpl,EventMultiplexerListener, - tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(AnnotationManagerImpl,EventMultiplexerListener, + tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_CURRENT_PAGE: case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION: @@ -897,7 +897,6 @@ IMPL_LINK(AnnotationManagerImpl,EventMultiplexerListener, onSelectionChanged(); break; } - return 0; } void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation > xAnnotation, vcl::Window* pParent, const Rectangle& rContextRect, bool bButtonMenu /* = false */ ) diff --git a/sd/source/ui/annotations/annotationmanagerimpl.hxx b/sd/source/ui/annotations/annotationmanagerimpl.hxx index 294731501f3a..0563db46726f 100644 --- a/sd/source/ui/annotations/annotationmanagerimpl.hxx +++ b/sd/source/ui/annotations/annotationmanagerimpl.hxx @@ -95,7 +95,7 @@ public: void invalidateSlots(); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(UpdateTagsHdl, void *, void); void UpdateTags(bool bSynchron = false); diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx index fc1a5c9ab46d..f5dd36018465 100644 --- a/sd/source/ui/inc/EventMultiplexer.hxx +++ b/sd/source/ui/inc/EventMultiplexer.hxx @@ -177,7 +177,7 @@ public: be informed about. */ void AddEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypeSet); /** Remove an event listener for the specified event types. @@ -188,7 +188,7 @@ public: for. */ void RemoveEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypeSet = EID_FULL_SET); /** This method is used for out-of-line events. An event of the diff --git a/sd/source/ui/inc/FormShellManager.hxx b/sd/source/ui/inc/FormShellManager.hxx index f206d11fce38..f8870c7d046e 100644 --- a/sd/source/ui/inc/FormShellManager.hxx +++ b/sd/source/ui/inc/FormShellManager.hxx @@ -114,7 +114,7 @@ private: When this happens then we unregister at the window of the old and register at the window of the new shell. */ - DECL_LINK(ConfigurationUpdateHandler, ::sd::tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(ConfigurationUpdateHandler, ::sd::tools::EventMultiplexerEvent&, void); /** This call back is called by the form shell when it gets the focus. In this case the form shell is moved to the top of the shell stack. diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index 5279349a4492..60b54ac9f1b7 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -202,7 +202,7 @@ private: */ DECL_LINK( AppEventListenerHdl, void * ); - DECL_LINK(EventMultiplexerListener, sd::tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, sd::tools::EventMultiplexerEvent&, void); /** holds a model guard during drag and drop between BeginMovingHdl and EndMovingHdl */ std::unique_ptr< OutlineViewModelChangeGuard > maDragAndDropModelGuard; diff --git a/sd/source/ui/inc/view/viewoverlaymanager.hxx b/sd/source/ui/inc/view/viewoverlaymanager.hxx index 1d65446dec18..72dc932cd935 100644 --- a/sd/source/ui/inc/view/viewoverlaymanager.hxx +++ b/sd/source/ui/inc/view/viewoverlaymanager.hxx @@ -40,7 +40,7 @@ public: void onZoomChanged(); void UpdateTags(); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(UpdateTagsHdl, void *, void); bool CreateTags(); diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 7b91a73a7a2c..7dd6a3dfb53f 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -77,7 +77,7 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector ( // left clicks. mnDefaultClickAction = SID_TP_APPLY_TO_SELECTED_SLIDES; - Link<> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); + Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); rBase.GetEventMultiplexer()->AddEventListener(aLink, sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL @@ -104,7 +104,7 @@ void CurrentMasterPagesSelector::dispose() OSL_ASSERT(mrDocument.GetDocSh() != NULL); } - Link<> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); + Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); MasterPagesSelector::dispose(); @@ -254,41 +254,36 @@ void CurrentMasterPagesSelector::ProcessPopupMenu (Menu& rMenu) MasterPagesSelector::ProcessPopupMenu(rMenu); } -IMPL_LINK(CurrentMasterPagesSelector,EventMultiplexerListener, - sd::tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(CurrentMasterPagesSelector,EventMultiplexerListener, + sd::tools::EventMultiplexerEvent&, rEvent, void) { - if (pEvent != NULL) + switch (rEvent.meEventId) { - switch (pEvent->meEventId) - { - case sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE: - case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL: - case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER: - case sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION: - UpdateSelection(); - break; - - case sd::tools::EventMultiplexerEvent::EID_PAGE_ORDER: - // This is tricky. If a master page is removed, moved, or - // added we have to wait until both the notes master page - // and the standard master page have been removed, moved, - // or added. We do this by looking at the number of master - // pages which has to be odd in the consistent state (the - // handout master page is always present). If the number is - // even we ignore the hint. - if (mrBase.GetDocument()->GetMasterPageCount()%2 == 1) - MasterPagesSelector::Fill(); - break; - - case sd::tools::EventMultiplexerEvent::EID_SHAPE_CHANGED: - case sd::tools::EventMultiplexerEvent::EID_SHAPE_INSERTED: - case sd::tools::EventMultiplexerEvent::EID_SHAPE_REMOVED: - InvalidatePreview(static_cast<const SdPage*>(pEvent->mpUserData)); - break; - } + case sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE: + case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL: + case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER: + case sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION: + UpdateSelection(); + break; + + case sd::tools::EventMultiplexerEvent::EID_PAGE_ORDER: + // This is tricky. If a master page is removed, moved, or + // added we have to wait until both the notes master page + // and the standard master page have been removed, moved, + // or added. We do this by looking at the number of master + // pages which has to be odd in the consistent state (the + // handout master page is always present). If the number is + // even we ignore the hint. + if (mrBase.GetDocument()->GetMasterPageCount()%2 == 1) + MasterPagesSelector::Fill(); + break; + + case sd::tools::EventMultiplexerEvent::EID_SHAPE_CHANGED: + case sd::tools::EventMultiplexerEvent::EID_SHAPE_INSERTED: + case sd::tools::EventMultiplexerEvent::EID_SHAPE_REMOVED: + InvalidatePreview(static_cast<const SdPage*>(rEvent.mpUserData)); + break; } - - return 0; } } } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx index b587a3f52aec..2a51ac104f3f 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx @@ -73,7 +73,7 @@ private: virtual void LateInit() SAL_OVERRIDE; - DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener,sd::tools::EventMultiplexerEvent&, void); }; } } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index d5010b2738a2..38e9fea125e7 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -168,7 +168,7 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell ) SetSelectHdl (LINK(this, LayoutMenu, ClickHandler)); InvalidateContent(); - Link<> aEventListenerLink (LINK(this,LayoutMenu,EventMultiplexerListener)); + Link<::sd::tools::EventMultiplexerEvent&,void> aEventListenerLink (LINK(this,LayoutMenu,EventMultiplexerListener)); mrBase.GetEventMultiplexer()->AddEventListener(aEventListenerLink, ::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE | ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION @@ -218,7 +218,7 @@ void LayoutMenu::Dispose() xComponent->dispose(); Clear(); - Link<> aLink (LINK(this,LayoutMenu,EventMultiplexerListener)); + Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this,LayoutMenu,EventMultiplexerListener)); mrBase.GetEventMultiplexer()->RemoveEventListener (aLink); Link<> aWindowEventHandlerLink (LINK(this,LayoutMenu,WindowEventHandler)); @@ -704,9 +704,9 @@ void LayoutMenu::UpdateSelection() SetNoSelection(); } -IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent*, pEvent) +IMPL_LINK_TYPED(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case ::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE: case ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION: @@ -734,8 +734,6 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve /* Ignored */ break; } - - return 0; } IMPL_LINK(LayoutMenu, WindowEventHandler, VclWindowEvent*, pEvent) diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx index aa1c1d3916b3..adef23a61229 100644 --- a/sd/source/ui/sidebar/LayoutMenu.hxx +++ b/sd/source/ui/sidebar/LayoutMenu.hxx @@ -191,7 +191,7 @@ private: DECL_LINK_TYPED(ClickHandler, ValueSet*, void); DECL_LINK_TYPED(RightClickHandler, const MouseEvent&, void); DECL_LINK_TYPED(StateChangeHandler, const OUString&, void); - DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, void); DECL_LINK(WindowEventHandler, VclWindowEvent*); DECL_LINK_TYPED(OnMenuItemSelected, Menu*, bool); }; diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx index 4e64787c997d..d4f65d7375f0 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.cxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx @@ -125,7 +125,7 @@ Listener::Listener ( StartListening(*pMainViewShell); } - Link<> aLink (LINK(this, Listener, EventMultiplexerCallback)); + Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this, Listener, EventMultiplexerCallback)); mpBase->GetEventMultiplexer()->AddEventListener( aLink, tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED @@ -185,7 +185,7 @@ void Listener::ReleaseListeners() if (mpBase != NULL) { - Link<> aLink (LINK(this, Listener, EventMultiplexerCallback)); + Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, Listener, EventMultiplexerCallback)); mpBase->GetEventMultiplexer()->RemoveEventListener( aLink, tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED @@ -349,9 +349,9 @@ void Listener::Notify ( } } -IMPL_LINK(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent*, pEvent) +IMPL_LINK_TYPED(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED: { @@ -396,13 +396,13 @@ IMPL_LINK(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent case tools::EventMultiplexerEvent::EID_SHAPE_CHANGED: case tools::EventMultiplexerEvent::EID_SHAPE_INSERTED: case tools::EventMultiplexerEvent::EID_SHAPE_REMOVED: - HandleShapeModification(static_cast<const SdrPage*>(pEvent->mpUserData)); + HandleShapeModification(static_cast<const SdrPage*>(rEvent.mpUserData)); break; case tools::EventMultiplexerEvent::EID_END_TEXT_EDIT: - if (pEvent->mpUserData != NULL) + if (rEvent.mpUserData != NULL) { - const SdrObject* pObject = static_cast<const SdrObject*>(pEvent->mpUserData); + const SdrObject* pObject = static_cast<const SdrObject*>(rEvent.mpUserData); HandleShapeModification(pObject->GetPage()); } break; @@ -410,8 +410,6 @@ IMPL_LINK(Listener, EventMultiplexerCallback, ::sd::tools::EventMultiplexerEvent default: break; } - - return 0; } //===== lang::XEventListener ================================================ diff --git a/sd/source/ui/slidesorter/controller/SlsListener.hxx b/sd/source/ui/slidesorter/controller/SlsListener.hxx index 1e634a99af40..0753edd986e4 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.hxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.hxx @@ -176,7 +176,7 @@ private: void ThrowIfDisposed() throw (::com::sun::star::lang::DisposedException); - DECL_LINK(EventMultiplexerCallback, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerCallback, tools::EventMultiplexerEvent&, void); }; } } } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 85eb63f46224..8c5c05c7f6fa 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -427,7 +427,7 @@ void TableDesignWidget::updateControls() void TableDesignWidget::addListener() { - Link<> aLink( LINK(this,TableDesignWidget,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,TableDesignWidget,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener ( aLink, tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION @@ -439,14 +439,14 @@ void TableDesignWidget::addListener() void TableDesignWidget::removeListener() { - Link<> aLink( LINK(this,TableDesignWidget,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,TableDesignWidget,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); } -IMPL_LINK(TableDesignWidget,EventMultiplexerListener, - tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(TableDesignWidget,EventMultiplexerListener, + tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_CURRENT_PAGE: case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION: @@ -463,7 +463,6 @@ IMPL_LINK(TableDesignWidget,EventMultiplexerListener, onSelectionChanged(); break; } - return 0; } struct CellInfo diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx index 065e124f514b..419ab7cb7cc4 100644 --- a/sd/source/ui/table/TableDesignPane.hxx +++ b/sd/source/ui/table/TableDesignPane.hxx @@ -85,7 +85,7 @@ private: void FillDesignPreviewControl(); - DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerListener, tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(implValueSetHdl, ValueSet*, void); DECL_LINK_TYPED(implCheckBoxHdl, Button*, void); diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 4705bea8feb2..b776c71c191a 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -68,11 +68,11 @@ public: virtual ~Implementation(); void AddEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes); void RemoveEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes); void CallListeners (EventMultiplexerEvent& rEvent); @@ -120,7 +120,7 @@ protected: private: ViewShellBase& mrBase; - typedef ::std::pair<Link<>,EventMultiplexerEvent::EventId> ListenerDescriptor; + typedef ::std::pair<Link<EventMultiplexerEvent&,void>,EventMultiplexerEvent::EventId> ListenerDescriptor; typedef ::std::vector<ListenerDescriptor> ListenerList; ListenerList maListeners; @@ -184,14 +184,14 @@ EventMultiplexer::~EventMultiplexer() } void EventMultiplexer::AddEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes) { mpImpl->AddEventListener (rCallback, aEventTypes); } void EventMultiplexer::RemoveEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes) { mpImpl->RemoveEventListener (rCallback, aEventTypes); @@ -315,7 +315,7 @@ void EventMultiplexer::Implementation::ReleaseListeners() } void EventMultiplexer::Implementation::AddEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes) { ListenerList::iterator iListener (maListeners.begin()); @@ -335,7 +335,7 @@ void EventMultiplexer::Implementation::AddEventListener ( } void EventMultiplexer::Implementation::RemoveEventListener ( - Link<>& rCallback, + const Link<EventMultiplexerEvent&,void>& rCallback, EventMultiplexerEvent::EventId aEventTypes) { ListenerList::iterator iListener (maListeners.begin()); @@ -700,7 +700,7 @@ void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEv for (; iListener!=iListenerEnd; ++iListener) { if ((iListener->second && rEvent.meEventId)) - iListener->first.Call(&rEvent); + iListener->first.Call(rEvent); } } diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 2712dd4bbbef..02ffc9f91ece 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -57,7 +57,7 @@ FormShellManager::FormShellManager (ViewShellBase& rBase) { // Register at the EventMultiplexer to be informed about changes in the // center pane. - Link<> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); + Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->AddEventListener( aLink, sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED @@ -73,7 +73,7 @@ FormShellManager::~FormShellManager() UnregisterAtCenterPane(); // Unregister from the EventMultiplexer. - Link<> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); + Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); if (mpSubShellFactory.get() != NULL) @@ -198,9 +198,9 @@ IMPL_LINK_NOARG_TYPED(FormShellManager, FormControlActivated, LinkParamNone*, vo } } -IMPL_LINK(FormShellManager, ConfigurationUpdateHandler, sd::tools::EventMultiplexerEvent*, pEvent) +IMPL_LINK_TYPED(FormShellManager, ConfigurationUpdateHandler, sd::tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED: UnregisterAtCenterPane(); @@ -221,8 +221,6 @@ IMPL_LINK(FormShellManager, ConfigurationUpdateHandler, sd::tools::EventMultiple default: break; } - - return 0; } IMPL_LINK(FormShellManager, WindowEventHandler, VclWindowEvent*, pEvent) diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 330a7cec4be4..053989d79800 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -324,7 +324,7 @@ private: bool CheckPlugInMode (const OUString& rsName) const; DECL_LINK_TYPED(UpdateCallback, void *, void); - DECL_LINK(EventMultiplexerCallback, sd::tools::EventMultiplexerEvent*); + DECL_LINK_TYPED(EventMultiplexerCallback, sd::tools::EventMultiplexerEvent&, void); DECL_LINK_TYPED(SetValidCallback, void*, void); }; @@ -535,7 +535,7 @@ ToolBarManager::Implementation::Implementation ( mnPendingSetValidCall(0), maToolBarRules(rpToolBarManager,rpViewShellManager) { - Link<> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); + Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); mpEventMultiplexer->AddEventListener( aLink, tools::EventMultiplexerEvent::EID_CONTROLLER_ATTACHED @@ -550,7 +550,7 @@ ToolBarManager::Implementation::Implementation ( ToolBarManager::Implementation::~Implementation() { // Unregister at broadcasters. - Link<> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); + Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); mpEventMultiplexer->RemoveEventListener(aLink); // Abort pending user calls. @@ -861,29 +861,25 @@ IMPL_LINK_NOARG_TYPED(ToolBarManager::Implementation, UpdateCallback, void*, voi } } -IMPL_LINK(ToolBarManager::Implementation,EventMultiplexerCallback, - sd::tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(ToolBarManager::Implementation,EventMultiplexerCallback, + sd::tools::EventMultiplexerEvent&, rEvent, void) { - if (pEvent != NULL) + switch (rEvent.meEventId) { - switch (pEvent->meEventId) - { - case tools::EventMultiplexerEvent::EID_CONTROLLER_ATTACHED: - if (mnPendingSetValidCall == 0) - mnPendingSetValidCall - = Application::PostUserEvent(LINK(this,Implementation,SetValidCallback)); - break; + case tools::EventMultiplexerEvent::EID_CONTROLLER_ATTACHED: + if (mnPendingSetValidCall == 0) + mnPendingSetValidCall + = Application::PostUserEvent(LINK(this,Implementation,SetValidCallback)); + break; - case tools::EventMultiplexerEvent::EID_CONTROLLER_DETACHED: - SetValid(false); - break; + case tools::EventMultiplexerEvent::EID_CONTROLLER_DETACHED: + SetValid(false); + break; - case tools::EventMultiplexerEvent::EID_PANE_MANAGER_DYING: - SetValid(false); - break; - } + case tools::EventMultiplexerEvent::EID_PANE_MANAGER_DYING: + SetValid(false); + break; } - return 0; } IMPL_LINK_NOARG_TYPED(ToolBarManager::Implementation, SetValidCallback, void*, void) diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index feef14d4b1f6..6bb82ad75571 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -131,7 +131,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie FillOutliner(); } - Link<> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->AddEventListener( aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE @@ -171,7 +171,7 @@ OutlineView::~OutlineView() { DBG_ASSERT(maDragAndDropModelGuard.get() == 0, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" ); - Link<> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink ); DisconnectFromApplication(); @@ -1430,32 +1430,28 @@ IMPL_LINK_NOARG(OutlineView, AppEventListenerHdl) return 0; } -IMPL_LINK(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent*, pEvent) +IMPL_LINK_TYPED(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, rEvent, void) { - if (pEvent != NULL) + switch (rEvent.meEventId) { - switch (pEvent->meEventId) - { - case tools::EventMultiplexerEvent::EID_CURRENT_PAGE: - SetActualPage(mrOutlineViewShell.GetActualPage()); - break; + case tools::EventMultiplexerEvent::EID_CURRENT_PAGE: + SetActualPage(mrOutlineViewShell.GetActualPage()); + break; - case tools::EventMultiplexerEvent::EID_PAGE_ORDER: - if (dynamic_cast<Outliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0) + case tools::EventMultiplexerEvent::EID_PAGE_ORDER: + if (dynamic_cast<Outliner&>(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0) + { + if (((mrDoc.GetPageCount()-1)%2) == 0) { - if (((mrDoc.GetPageCount()-1)%2) == 0) - { - mrOutliner.Clear(); - FillOutliner(); - ::sd::Window* pWindow = mrOutlineViewShell.GetActiveWindow(); - if (pWindow != NULL) - pWindow->Invalidate(); - } + mrOutliner.Clear(); + FillOutliner(); + ::sd::Window* pWindow = mrOutlineViewShell.GetActiveWindow(); + if (pWindow != NULL) + pWindow->Invalidate(); } - break; - } + } + break; } - return 0; } void OutlineView::IgnoreCurrentPageChanges (bool bIgnoreChanges) diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 4cdbd335d6b0..815801549b5b 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -422,7 +422,7 @@ ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase ) : mrBase( rViewShellBase ) , mnUpdateTagsEvent( 0 ) { - Link<> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener(aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE | tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED | tools::EventMultiplexerEvent::EID_VIEW_ADDED @@ -434,7 +434,7 @@ ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase ) ViewOverlayManager::~ViewOverlayManager() { - Link<> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); + Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->RemoveEventListener( aLink ); if( mnUpdateTagsEvent ) @@ -529,10 +529,10 @@ bool ViewOverlayManager::DisposeTags() return false; } -IMPL_LINK(ViewOverlayManager,EventMultiplexerListener, - tools::EventMultiplexerEvent*,pEvent) +IMPL_LINK_TYPED(ViewOverlayManager,EventMultiplexerListener, + tools::EventMultiplexerEvent&, rEvent, void) { - switch (pEvent->meEventId) + switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED: case tools::EventMultiplexerEvent::EID_VIEW_ADDED: @@ -542,7 +542,6 @@ IMPL_LINK(ViewOverlayManager,EventMultiplexerListener, UpdateTags(); break; } - return 0; } } |