summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTobias Madl <tobias.madl.dev@gmail.com>2014-11-13 14:50:26 +0000
committerTobias Madl <tobias.madl.dev@gmail.com>2014-12-09 12:34:57 +0000
commitea6399b837f1cd4fb28be91b8e311e9378988fc5 (patch)
treeded5273991f72512d5283962311fb1ba02f5d4be /starmath
parente5f67b2e943366042bed9995327840c5a71eae2a (diff)
changed timers to idles
Change-Id: Ic0d7730f7880dfe2e83c84e773b8cc420249b269
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/edit.hxx4
-rw-r--r--starmath/source/edit.cxx36
2 files changed, 20 insertions, 20 deletions
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index 7c66fa6fafb2..4aef879139f3 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -56,8 +56,8 @@ class SmEditWindow : public vcl::Window, public DropTargetHelper
ScrollBar *pHScrollBar,
*pVScrollBar;
ScrollBarBox *pScrollBox;
- Timer aModifyTimer,
- aCursorMoveTimer;
+ Idle aModifyIdle,
+ aCursorMoveIdle;
ESelection aOldSelection;
virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index ebdc37e08488..97b6826bc363 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -106,13 +106,13 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) :
// compare DataChanged
SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
- aModifyTimer.SetTimeoutHdl(LINK(this, SmEditWindow, ModifyTimerHdl));
- aModifyTimer.SetTimeout(500);
+ aModifyIdle.SetIdleHdl(LINK(this, SmEditWindow, ModifyTimerHdl));
+ aModifyIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST);
if (!IsInlineEditEnabled())
{
- aCursorMoveTimer.SetTimeoutHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl));
- aCursorMoveTimer.SetTimeout(500);
+ aCursorMoveIdle.SetIdleHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl));
+ aCursorMoveIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST);
}
// if not called explicitly the this edit window within the
@@ -123,7 +123,7 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) :
SmEditWindow::~SmEditWindow()
{
- aModifyTimer.Stop();
+ aModifyIdle.Stop();
StartCursorMove();
@@ -153,7 +153,7 @@ SmEditWindow::~SmEditWindow()
void SmEditWindow::StartCursorMove()
{
if (!IsInlineEditEnabled())
- aCursorMoveTimer.Stop();
+ aCursorMoveIdle.Stop();
}
void SmEditWindow::InvalidateSlots()
@@ -247,7 +247,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
IMPL_LINK( SmEditWindow, ModifyTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
{
UpdateStatus();
- aModifyTimer.Stop();
+ aModifyIdle.Stop();
return 0;
}
@@ -276,7 +276,7 @@ IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Timer *, EMPTYARG /*pTimer*/)
aOldSelection = aNewSelection;
}
}
- aCursorMoveTimer.Stop();
+ aCursorMoveIdle.Stop();
return 0;
}
@@ -315,7 +315,7 @@ void SmEditWindow::MouseButtonUp(const MouseEvent &rEvt)
Window::MouseButtonUp (rEvt);
if (!IsInlineEditEnabled())
- CursorMoveTimerHdl(&aCursorMoveTimer);
+ CursorMoveTimerHdl(&aCursorMoveIdle);
InvalidateSlots();
}
@@ -467,8 +467,8 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
{
// F1 (help) leads to the destruction of this
Flush();
- if ( aModifyTimer.IsActive() )
- aModifyTimer.Stop();
+ if ( aModifyIdle.IsActive() )
+ aModifyIdle.Stop();
Window::KeyInput(rKEvt);
}
else
@@ -491,7 +491,7 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
EditEngine *pEditEngine = GetEditEngine();
if (pDocShell && pEditEngine)
pDocShell->SetModified(pEditEngine->IsModified());
- aModifyTimer.Start();
+ aModifyIdle.Start();
}
// get the current char of the key event
@@ -679,7 +679,7 @@ void SmEditWindow::SetText(const OUString& rText)
// Restarting the timer here, prevents calling the handlers for other (currently inactive)
// math tasks
- aModifyTimer.Start();
+ aModifyIdle.Start();
pEditView->SetSelection(eSelection);
}
@@ -813,7 +813,7 @@ void SmEditWindow::InsertCommand(sal_uInt16 nCommand)
pEditView->SetSelection(aSelection);
}
- aModifyTimer.Start();
+ aModifyIdle.Start();
StartCursorMove();
GrabFocus();
}
@@ -1061,7 +1061,7 @@ void SmEditWindow::InsertText(const OUString& rText)
pEditView->SetSelection(aSelection);
}
- aModifyTimer.Start();
+ aModifyIdle.Start();
StartCursorMove();
GrabFocus();
}
@@ -1081,10 +1081,10 @@ void SmEditWindow::Flush()
new SfxStringItem(SID_TEXT, GetText()), 0L);
}
}
- if (aCursorMoveTimer.IsActive())
+ if (aCursorMoveIdle.IsActive())
{
- aCursorMoveTimer.Stop();
- CursorMoveTimerHdl(&aCursorMoveTimer);
+ aCursorMoveIdle.Stop();
+ CursorMoveTimerHdl(&aCursorMoveIdle);
}
}