diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-01-23 19:37:51 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-01-23 20:49:05 +0100 |
commit | bf110d40efcc79efb9247fdce5d2f54bafa6550b (patch) | |
tree | 4e9fad96d91adfd5159b009b430a64d4a6863bd6 /starmath | |
parent | 75d8b305bbc1c2377f23361ecd64816a350baa4c (diff) |
Change all Idle* LINKs to be Timer*
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles
Link in the Timer class. Now there are two possible solution:
1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or
2. split the inheritance of Idle from Timer again to maintain
different Link<>s and move all common code into a TimerBase.
While the 1st is more correct, the 2nd has a better indicator for
Idles. This implements the first solution.
And while at it, this also converts all call sites of SetTimeoutHdl
and SetIdleHdl to SetInvokeHandler and gets rid of some local Link
objects, which are just passed to the SetInvokeHandler call.
It also introduces ClearInvokeHandler() and replaces the respective
call sites of SetInvokeHandler( Link<Timer *, void>() ).
Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/edit.hxx | 4 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 8 | ||||
-rw-r--r-- | starmath/source/view.cxx | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx index 450c310ad8b3..dbb27a834688 100644 --- a/starmath/inc/edit.hxx +++ b/starmath/inc/edit.hxx @@ -59,8 +59,8 @@ class SmEditWindow : public vcl::Window, public DropTargetHelper virtual void Command(const CommandEvent& rCEvt) override; DECL_LINK(MenuSelectHdl, Menu *, bool); - DECL_LINK(ModifyTimerHdl, Idle *, void); - DECL_LINK(CursorMoveTimerHdl, Idle *, void); + DECL_LINK(ModifyTimerHdl, Timer *, void); + DECL_LINK(CursorMoveTimerHdl, Timer *, void); virtual void DataChanged( const DataChangedEvent& ) override; virtual void Resize() override; diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index af3e3e90a4af..a60a7661f683 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -100,12 +100,12 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) : // compare DataChanged SetBackground( GetSettings().GetStyleSettings().GetWindowColor() ); - aModifyIdle.SetIdleHdl(LINK(this, SmEditWindow, ModifyTimerHdl)); + aModifyIdle.SetInvokeHandler(LINK(this, SmEditWindow, ModifyTimerHdl)); aModifyIdle.SetPriority(TaskPriority::LOWEST); if (!IsInlineEditEnabled()) { - aCursorMoveIdle.SetIdleHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl)); + aCursorMoveIdle.SetInvokeHandler(LINK(this, SmEditWindow, CursorMoveTimerHdl)); aCursorMoveIdle.SetPriority(TaskPriority::LOWEST); } @@ -251,13 +251,13 @@ void SmEditWindow::DataChanged( const DataChangedEvent& ) Resize(); } -IMPL_LINK_NOARG( SmEditWindow, ModifyTimerHdl, Idle *, void ) +IMPL_LINK_NOARG( SmEditWindow, ModifyTimerHdl, Timer *, void ) { UpdateStatus(false); aModifyIdle.Stop(); } -IMPL_LINK_NOARG(SmEditWindow, CursorMoveTimerHdl, Idle *, void) +IMPL_LINK_NOARG(SmEditWindow, CursorMoveTimerHdl, Timer *, void) // every once in a while check cursor position (selection) of edit // window and if it has changed (try to) set the formula-cursor // according to that. diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 0da5ee3cd901..36c7dfd40b09 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -270,7 +270,7 @@ IMPL_LINK_NOARG(SmGraphicWindow, CaretBlinkTimerHdl, Timer *, void) void SmGraphicWindow::CaretBlinkInit() { - aCaretBlinkTimer.SetTimeoutHdl(LINK(this, SmGraphicWindow, CaretBlinkTimerHdl)); + aCaretBlinkTimer.SetInvokeHandler(LINK(this, SmGraphicWindow, CaretBlinkTimerHdl)); aCaretBlinkTimer.SetTimeout( ScrollableWindow::GetSettings().GetStyleSettings().GetCursorBlinkTime() ); } @@ -678,7 +678,7 @@ SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings_, SfxChildWindow *pChildWi Hide(); - aInitialFocusTimer.SetTimeoutHdl(LINK(this, SmCmdBoxWindow, InitialFocusTimerHdl)); + aInitialFocusTimer.SetInvokeHandler(LINK(this, SmCmdBoxWindow, InitialFocusTimerHdl)); aInitialFocusTimer.SetTimeout(100); } |