<div dir="ltr">Patch in Gerrit: <span class="">5a142827fb945408c51725b31ebc1ded13a2d9c5</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 10:03 AM, Tobias Madl <span dir="ltr"><<a href="mailto:tobias.madl.dev@gmail.com" target="_blank">tobias.madl.dev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>So yeah SetTimeout should be deletet, but it should be replaced with SetPriority (and of course set with an <span lang="en"><span>appropriate Priority), because otherwise it gets the default priority: HIGH.<br><br></span></span></div><span lang="en"><span>The taks should be stopped if there is absolutely no more work to do. If stop is called it gets completely removed of the tasklist. So if you think that it has no more work todo you can stop it by yourself.<br><br></span></span></div><span lang="en"><span>But i think i get your point, because i see that i missed to ask if the task is active (i only check if it should be delete). I wil change this and then you could set the task as inactive if you think that for now it has no more work to do and if it comes to the position:<br><br></span></span><span class=""><br>  if (... !pIdle->IsActive()) pIdle->Start();<br><br></span></div>it should be reactivatet.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 5, 2015 at 11:46 AM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I assume deleting the SetTimeout calls without replacement is fine, as the idle handler will automatically keep being called again?<br>
<br>
But then, is it OK that it only ever gets Stop()'ed in SwSrcEditWindow::dispose, or should it also stop itself when there's no more work to do?<br>
<br>
And is it necessary to do that<br>
<br>
  if (... !pIdle->IsActive()) pIdle->Start();<br>
<br>
thing from within the handler?<br>
<br>
On 05/05/2015 10:22 AM, Stephan Bergmann wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
commit c0e209bf5f418f1564d16e234251783a0857a9d4<br>
Author: Stephan Bergmann <<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>><br>
Date:   Tue May 5 10:16:43 2015 +0200<br>
<br>
     Adapt SwSrcEditWindow's SyntaxTimerHdl to being used in an Idle now<br>
<br>
     ...not a Timer, since d843f3de731667a298a83fc66637c7f983f3b24d "changed timers<br>
     to idle"<br>
<br>
     Change-Id: If8c6a52d6fb7b1e392e8f31bc8f0db22b2f049e1<br>
<br>
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx<br>
index cd66ace..02e1e66 100644<br>
--- a/sw/source/uibase/docvw/srcedtw.cxx<br>
+++ b/sw/source/uibase/docvw/srcedtw.cxx<br>
@@ -56,7 +56,6 @@ struct SwTextPortion<br>
<br>
  #define MAX_SYNTAX_HIGHLIGHT 20<br>
  #define MAX_HIGHLIGHTTIME 200<br>
-#define SYNTAX_HIGHLIGHT_TIMEOUT 200<br>
<br>
  typedef std::deque<SwTextPortion> SwTextPortions;<br>
<br>
@@ -579,7 +578,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)<br>
      return 0;<br>
  }<br>
<br>
-IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )<br>
+IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Idle *, pIdle )<br>
  {<br>
      tools::Time aSyntaxCheckStart( tools::Time::SYSTEM );<br>
      SAL_WARN_IF(pTextView == 0, "sw", "No View yet, but syntax highlighting?!");<br>
@@ -605,7 +604,6 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )<br>
                      break;<br>
                  if((tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME )<br>
                  {<br>
-                    pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT );<br>
                      break;<br>
                  }<br>
              }<br>
@@ -620,13 +618,12 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )<br>
          nCount ++;<br>
          if(tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME)<br>
          {<br>
-            pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT );<br>
              break;<br>
          }<br>
      }<br>
<br>
-    if(!aSyntaxLineTable.empty() && !pTimer->IsActive())<br>
-        pTimer->Start();<br>
+    if(!aSyntaxLineTable.empty() && !pIdle->IsActive())<br>
+        pIdle->Start();<br>
      // SyntaxTimerHdl is called when text changed<br>
      // => good opportunity to determine text width!<br>
      long nPrevTextWidth = nCurTextWidth;<br>
diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx<br>
index 823e3cd..55e53f4 100644<br>
--- a/sw/source/uibase/inc/srcedtw.hxx<br>
+++ b/sw/source/uibase/inc/srcedtw.hxx<br>
@@ -95,7 +95,7 @@ private:<br>
      using OutputDevice::SetFont;<br>
      void            SetFont();<br>
<br>
-    DECL_LINK( SyntaxTimerHdl, Timer * );<br>
+    DECL_LINK( SyntaxTimerHdl, Idle * );<br>
      DECL_LINK( TimeoutHdl, Timer * );<br>
<br>
      using Window::Notify;<br>
</blockquote>
<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>