diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-27 13:08:02 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-08-28 09:49:56 +0200 |
commit | bd8b93fdff93ff7b2b7e493a7bcef6a59f299dae (patch) | |
tree | f05be9665737f0667faf95702d96fbf3f0a103c5 /vcl/source | |
parent | 1b9c3a17e8496aedfb80528c5275e6658154789d (diff) |
make PostUserEvent Link<> typed
Change-Id: I13f10bda985d55d419a5bff481130a456ae2db8a
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/svapp.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 6 | ||||
-rw-r--r-- | vcl/source/helper/evntpost.cxx | 4 | ||||
-rw-r--r-- | vcl/source/helper/threadex.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/dockwin.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/event.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/mouse.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/winproc.cxx | 21 |
13 files changed, 29 insertions, 51 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 2c8f41d8cdd1..7b87430e1a4a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -411,10 +411,9 @@ void Application::ReAcquireSolarMutex(sal_uLong const nReleased) #endif } -IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplQuitMsg ) +IMPL_STATIC_LINK_NOARG_TYPED( ImplSVAppData, ImplQuitMsg, void*, void ) { ImplGetSVData()->maAppData.mbAppQuit = true; - return 0; } void Application::Quit() @@ -777,12 +776,12 @@ ImplSVEvent * Application::PostMouseEvent( sal_uLong nEvent, vcl::Window *pWin, } -IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData ) +IMPL_STATIC_LINK_TYPED( Application, PostEventHandler, void*, pCallData, void ) { const SolarMutexGuard aGuard; ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData ); const void* pEventData; - sal_uLong nEvent; + sal_uLong nEvent; ImplSVEvent * const nEventId = pData->mnEventId; switch( pData->mnEvent ) @@ -844,8 +843,6 @@ IMPL_STATIC_LINK( Application, PostEventHandler, void*, pCallData ) else ++aIter; } - - return 0; } void Application::RemoveMouseAndKeyEvents( vcl::Window* pWin ) @@ -870,12 +867,12 @@ void Application::RemoveMouseAndKeyEvents( vcl::Window* pWin ) } } -ImplSVEvent * Application::PostUserEvent( const Link<>& rLink, void* pCaller, +ImplSVEvent * Application::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink ) { ImplSVEvent* pSVEvent = new ImplSVEvent; pSVEvent->mpData = pCaller; - pSVEvent->mpLink = new Link<>( rLink ); + pSVEvent->maLink = rLink; pSVEvent->mpWindow = NULL; pSVEvent->mbCall = true; if (bReferenceLink) @@ -891,7 +888,6 @@ ImplSVEvent * Application::PostUserEvent( const Link<>& rLink, void* pCaller, vcl::Window* pDefWindow = ImplGetDefaultWindow(); if ( pDefWindow == 0 || !pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) ) { - delete pSVEvent->mpLink; delete pSVEvent; pSVEvent = 0; } diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 2b8b8ad0355b..2c8eb81d60a3 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -269,17 +269,15 @@ struct PrintJobAsync : mxController( i_xController ), maInitSetup( i_rInitSetup ) {} - DECL_LINK( ExecJob, void* ); + DECL_LINK_TYPED( ExecJob, void*, void ); }; -IMPL_LINK_NOARG(PrintJobAsync, ExecJob) +IMPL_LINK_NOARG_TYPED(PrintJobAsync, ExecJob, void*, void) { Printer::ImplPrintJob(mxController, maInitSetup); // clean up, do not access members after this delete this; - - return 0; } void Printer::PrintJob(const std::shared_ptr<PrinterController>& i_xController, diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx index d278e9aa71b0..ce84ec74cba2 100644 --- a/vcl/source/helper/evntpost.cxx +++ b/vcl/source/helper/evntpost.cxx @@ -46,12 +46,12 @@ void EventPoster::Post( UserEvent* pEvent ) m_nId = Application::PostUserEvent( ( LINK( this, EventPoster, DoEvent_Impl ) ), pEvent ); } -IMPL_LINK( EventPoster, DoEvent_Impl, UserEvent*, pEvent ) +IMPL_LINK_TYPED( EventPoster, DoEvent_Impl, void*, p, void ) { + UserEvent* pEvent = static_cast<UserEvent*>(p); DBG_TESTSOLARMUTEX(); m_nId = 0; m_aLink.Call( pEvent ); - return 0; } } diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx index a62bcfc3ab88..5fe7376c6556 100644 --- a/vcl/source/helper/threadex.cxx +++ b/vcl/source/helper/threadex.cxx @@ -36,7 +36,7 @@ SolarThreadExecutor::~SolarThreadExecutor() osl_destroyCondition( m_aFinish ); } -IMPL_LINK_NOARG(SolarThreadExecutor, worker) +IMPL_LINK_NOARG_TYPED(SolarThreadExecutor, worker, void*, void) { if ( !m_bTimeout ) { @@ -44,7 +44,6 @@ IMPL_LINK_NOARG(SolarThreadExecutor, worker) m_nReturn = doIt(); osl_setCondition( m_aFinish ); } - return m_nReturn; } long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout ) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 62e3fbf978e7..57be7b8cf795 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -579,10 +579,9 @@ void Dialog::dispose() SystemWindow::dispose(); } -IMPL_LINK_NOARG(Dialog, ImplAsyncCloseHdl) +IMPL_LINK_NOARG_TYPED(Dialog, ImplAsyncCloseHdl, void*, void) { Close(); - return 0; } bool Dialog::ImplHandleCmdEvent( const CommandEvent& rCEvent ) @@ -999,7 +998,7 @@ void Dialog::EndAllDialogs( vcl::Window* pParent ) if(!pParent || pParent->IsWindowOrChild(pModDialog,true)) { pModDialog->EndDialog(); - pModDialog->PostUserEvent( Link<>() ); + pModDialog->PostUserEvent( Link<void*,void>() ); } pModDialog = pTempModDialog; } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index be1017590491..11c647ab5ba8 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -50,7 +50,7 @@ private: bool mbInMove; ImplSVEvent * mnLastUserEvent; - DECL_LINK(DockingHdl, void *); + DECL_LINK_TYPED(DockingHdl, void *, void); DECL_LINK_TYPED(DockTimerHdl, Idle *, void); DECL_LINK_TYPED(EndDockTimerHdl, Idle *, void); public: @@ -151,7 +151,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, EndDockTimerHdl, Idle *, void) } } -IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl) +IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, DockingHdl, void*, void) { // called during move of a floating window mnLastUserEvent = 0; @@ -221,7 +221,6 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl) } } mbInMove = false; - return 0; } void ImplDockFloatWin2::Move() diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 4e91deb85609..feb4b405742f 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -67,7 +67,7 @@ private: bool mbInMove; ImplSVEvent * mnLastUserEvent; - DECL_LINK(DockingHdl, void *); + DECL_LINK_TYPED(DockingHdl, void *, void); DECL_LINK_TYPED(DockTimerHdl, Idle *, void); public: ImplDockFloatWin( vcl::Window* pParent, WinBits nWinBits, @@ -153,7 +153,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin, DockTimerHdl, Idle *, void) } } -IMPL_LINK_NOARG(ImplDockFloatWin, DockingHdl) +IMPL_LINK_NOARG_TYPED(ImplDockFloatWin, DockingHdl, void*, void) { PointerState aState = mpDockWin->GetParent()->GetPointerState(); @@ -187,7 +187,6 @@ IMPL_LINK_NOARG(ImplDockFloatWin, DockingHdl) } } mbInMove = false; - return 0; } void ImplDockFloatWin::Move() diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index b73614102cb1..8fcc65bf3735 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -264,11 +264,11 @@ void Window::RemoveChildEventListener( const Link<>& rEventListener ) mpWindowImpl->maChildEventListeners.removeListener( rEventListener ); } -ImplSVEvent * Window::PostUserEvent( const Link<>& rLink, void* pCaller, bool bReferenceLink ) +ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCaller, bool bReferenceLink ) { ImplSVEvent* pSVEvent = new ImplSVEvent; pSVEvent->mpData = pCaller; - pSVEvent->mpLink = new Link<>( rLink ); + pSVEvent->maLink = rLink; pSVEvent->mpWindow = this; pSVEvent->mbCall = true; if (bReferenceLink) @@ -284,7 +284,6 @@ ImplSVEvent * Window::PostUserEvent( const Link<>& rLink, void* pCaller, bool bR if ( !mpWindowImpl->mpFrame->PostEvent( pSVEvent ) ) { ImplRemoveDel( &(pSVEvent->maDelData) ); - delete pSVEvent->mpLink; delete pSVEvent; pSVEvent = 0; } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 944960931869..46353c822b9d 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -539,14 +539,13 @@ bool FloatingWindow::ImplIsFloatPopupModeWindow( const vcl::Window* pWindow ) return false; } -IMPL_LINK_NOARG(FloatingWindow, ImplEndPopupModeHdl) +IMPL_LINK_NOARG_TYPED(FloatingWindow, ImplEndPopupModeHdl, void*, void) { VclPtr<FloatingWindow> pThis(this); mnPostId = 0; mnPopupModeFlags = FloatWinPopupFlags::NONE; mbPopupMode = false; PopupModeEnd(); - return 0; } bool FloatingWindow::Notify( NotifyEvent& rNEvt ) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 5bad674c0f17..c2e415a4ede2 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2204,11 +2204,10 @@ void Menu::ImplCallHighlight(sal_uInt16 nItem) } } -IMPL_LINK_NOARG(Menu, ImplCallSelect) +IMPL_LINK_NOARG_TYPED(Menu, ImplCallSelect, void*, void) { nEventId = 0; Select(); - return 0; } Menu* Menu::ImplFindSelectMenu() diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index b92bb20cc41b..16bb316496eb 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -163,7 +163,7 @@ void Window::ImplGenerateMouseMove() mpWindowImpl->mpFrameData->mnMouseMoveId = Application::PostUserEvent( LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ), NULL, true ); } -IMPL_LINK_NOARG(Window, ImplGenerateMouseMoveHdl) +IMPL_LINK_NOARG_TYPED(Window, ImplGenerateMouseMoveHdl, void*, void) { mpWindowImpl->mpFrameData->mnMouseMoveId = 0; vcl::Window* pCaptureWin = ImplGetSVData()->maWinData.mpCaptureWin; @@ -173,7 +173,6 @@ IMPL_LINK_NOARG(Window, ImplGenerateMouseMoveHdl) { ImplCallMouseMove( mpWindowImpl->mpFrameData->mnMouseCode ); } - return 0; } void Window::ImplInvertFocus( const Rectangle& rRect ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 19ca6dc19778..9c2af02d1c0d 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1862,11 +1862,10 @@ IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent*, pEvent ) return 0; } -IMPL_LINK_NOARG(ToolBox, ImplCallExecuteCustomMenu) +IMPL_LINK_NOARG_TYPED(ToolBox, ImplCallExecuteCustomMenu, void*, void) { mpData->mnEventId = 0; ImplExecuteCustomMenu(); - return 0; } void ToolBox::ImplExecuteCustomMenu() diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index da55c5f37784..c25af35f8722 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -249,7 +249,7 @@ struct ContextMenuEvent Point aChildPos; }; -static sal_IntPtr ContextMenuEventLink( void* pCEvent, void* ) +static void ContextMenuEventLink( void* pCEvent, void* ) { ContextMenuEvent* pEv = static_cast<ContextMenuEvent*>(pCEvent); @@ -259,8 +259,6 @@ static sal_IntPtr ContextMenuEventLink( void* pCEvent, void* ) ImplCallCommand( pEv->pWindow, CommandEventId::ContextMenu, NULL, true, &pEv->aChildPos ); } delete pEv; - - return 0; } bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool bMouseLeave, @@ -818,7 +816,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool pEv->pWindow = pChild; pEv->aChildPos = aChildPos; pChild->ImplAddDel( &pEv->aDelData ); - Application::PostUserEvent( Link<>( pEv, ContextMenuEventLink ) ); + Application::PostUserEvent( Link<void*,void>( pEv, ContextMenuEventLink ) ); } else bRet = ! ImplCallCommand( pChild, CommandEventId::ContextMenu, NULL, true, &aChildPos ); @@ -1772,7 +1770,7 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive ) } } -IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl) +IMPL_LINK_NOARG_TYPED(vcl::Window, ImplAsyncFocusHdl, void*, void) { ImplGetWindowImpl()->mpFrameData->mnFocusId = 0; @@ -1877,8 +1875,6 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl) if ( ImplGetWindowImpl()->mpFrameData->mbStartFocusState != bHasFocus ) ImplActivateFloatingWindows( this, bHasFocus ); } - - return 0; } static void ImplHandleGetFocus( vcl::Window* pWindow ) @@ -1933,7 +1929,7 @@ struct DelayedCloseEvent ImplDelData aDelData; }; -static sal_IntPtr DelayedCloseEventLink( void* pCEvent, void* ) +static void DelayedCloseEventLink( void* pCEvent, void* ) { DelayedCloseEvent* pEv = static_cast<DelayedCloseEvent*>(pCEvent); @@ -1947,8 +1943,6 @@ static sal_IntPtr DelayedCloseEventLink( void* pCEvent, void* ) static_cast<DockingWindow*>(pEv->pWindow.get())->Close(); } delete pEv; - - return 0; } void ImplHandleClose( vcl::Window* pWindow ) @@ -2002,7 +1996,7 @@ void ImplHandleClose( vcl::Window* pWindow ) DelayedCloseEvent* pEv = new DelayedCloseEvent; pEv->pWindow = pWin; pWin->ImplAddDel( &pEv->aDelData ); - Application::PostUserEvent( Link<>( pEv, DelayedCloseEventLink ) ); + Application::PostUserEvent( Link<void*,void>( pEv, DelayedCloseEventLink ) ); } } @@ -2015,15 +2009,14 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent ) if ( pSVEvent->mpWindow ) { pSVEvent->mpWindow->ImplRemoveDel( &(pSVEvent->maDelData) ); - pSVEvent->mpLink->Call( pSVEvent->mpData ); + pSVEvent->maLink.Call( pSVEvent->mpData ); } else { - pSVEvent->mpLink->Call( pSVEvent->mpData ); + pSVEvent->maLink.Call( pSVEvent->mpData ); } } - delete pSVEvent->mpLink; delete pSVEvent; } } |