diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-05 10:16:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-05 10:21:54 +0200 |
commit | c0e209bf5f418f1564d16e234251783a0857a9d4 (patch) | |
tree | f756077deb8127876c68e14e31f819d114bd8cd3 | |
parent | 8cafd08278c0b925aac91ea94d8f907d98f07047 (diff) |
Adapt SwSrcEditWindow's SyntaxTimerHdl to being used in an Idle now
...not a Timer, since d843f3de731667a298a83fc66637c7f983f3b24d "changed timers
to idle"
Change-Id: If8c6a52d6fb7b1e392e8f31bc8f0db22b2f049e1
-rw-r--r-- | sw/source/uibase/docvw/srcedtw.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/inc/srcedtw.hxx | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index cd66ace9bb49..02e1e66b1093 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -56,7 +56,6 @@ struct SwTextPortion #define MAX_SYNTAX_HIGHLIGHT 20 #define MAX_HIGHLIGHTTIME 200 -#define SYNTAX_HIGHLIGHT_TIMEOUT 200 typedef std::deque<SwTextPortion> SwTextPortions; @@ -579,7 +578,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) return 0; } -IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) +IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Idle *, pIdle ) { tools::Time aSyntaxCheckStart( tools::Time::SYSTEM ); SAL_WARN_IF(pTextView == 0, "sw", "No View yet, but syntax highlighting?!"); @@ -605,7 +604,6 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) break; if((tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) { - pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; } } @@ -620,13 +618,12 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) nCount ++; if(tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) { - pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); break; } } - if(!aSyntaxLineTable.empty() && !pTimer->IsActive()) - pTimer->Start(); + if(!aSyntaxLineTable.empty() && !pIdle->IsActive()) + pIdle->Start(); // SyntaxTimerHdl is called when text changed // => good opportunity to determine text width! long nPrevTextWidth = nCurTextWidth; diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx index 823e3cd28a68..55e53f4fb9da 100644 --- a/sw/source/uibase/inc/srcedtw.hxx +++ b/sw/source/uibase/inc/srcedtw.hxx @@ -95,7 +95,7 @@ private: using OutputDevice::SetFont; void SetFont(); - DECL_LINK( SyntaxTimerHdl, Timer * ); + DECL_LINK( SyntaxTimerHdl, Idle * ); DECL_LINK( TimeoutHdl, Timer * ); using Window::Notify; |