Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index



Message: 3
Date: Wed, 24 Nov 2010 08:39:11 +0100
From: David Tardon<dtardon@redhat.com>
Subject: Re: [Libreoffice] timers in calc
To: libreoffice@lists.freedesktop.org
Message-ID:<20101124073910.GH30828@verda-stelo.brq.redhat.com>
Content-Type: text/plain; charset=iso-8859-1

On Wed, Nov 24, 2010 at 08:14:08AM +0100, Julien Nabet wrote:
Le 24/11/2010 08:11, Julien Nabet a ?crit :
Date: Tue, 23 Nov 2010 22:20:36 -0500
From: Kohei Yoshida<kyoshida@novell.com>
Subject: Re: [Libreoffice] [PATCH] try to correct some timers in sc +
        question
To:libreoffice@lists.freedesktop.org
Message-ID:<1290568836.2532.14.camel@localhost>
Content-Type: text/plain; charset="UTF-8"

Hi Julien,

On Sat, 2010-11-20 at 01:19 +0100, Julien Nabet wrote:
  Hello,
  >   Here's a try to correct some timers in scmod.cxx.
  Here's what I did and why.
  >   1) In IMPL_LINK( ScModule, SpellTimerHdl, Timer*, EMPTYARG
)
  I just added aSpellTimer.Stop() when there's neither input from keyboard
  nor ContinueOnlineSpelling.
  + I changed the function to have 1 return only.
  >   2) In IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
  I removed all the things with bSpell since it seems that
  ContinueOnlineSpelling is managed by SpellTimerHdl
  I'd like to add a stop but i'd like first to understand what's the use
  of all the SC_IDLE_STEP, SC_IDLE_MAX, nIdleCount...
  >   I repeat, this patch is just a try. If I'm all wrong,
sorry for the
  noise and please, explain my mistakes.
Well, I applaud your attempt to challenge this rather difficult task,
and sorry it took me so long to get back to you.

I took a closer look at this issue, and while I don't yet have a
complete picture of how this can be fixed, I can at least see that the
problem is not with the spell check timer, but the idle timer.  The
spell check timer itself actually turns itself off rather nicely after
it does what it needs.  The idle timer, OTOH, keeps on running pretty
much forever.  I guess my previous comment about the spell check timer
may have given you the wrong impression.  Sorry about that.

So, let's not change the spell check timer since it doesn't look broken,
and let's focus on fixing the idle timer itself.

Hello,

To know how to fix the idle timer I'd like first understand well how
it works since it seems to be simpler than idletimer. Could you tell
me when and how the spelltimer is stopped ? (I haven't seen where it
had a stop).

Julien.

Hi Julien,

a timer is stopped after it expired, unless it's explicitly restarted or
unless it's an auto timer (see Timer::ImplTimerCallbackProc in
vcl/source/app/timer.cxx). If you look at sc/source/ui/app/scmod.cxx,
you see that aSpellTimer is only restared (in SpellTimerHdl) if there is
a fresh keyboard input or if spell checking of the whole sheet hasn't
been finished yet, but aIdleTimer is restarted (in IdleHandler)
unconditionally.

HTH,

D.
Hello David,

In fact I misunderstood the timers especially the "Stop" part because i took example with sd/source/core/drawdoc4.cxx I thought that if "Stop" wasn't directly called, it couldn't stop, big mistake !

So I read in Timer::ImplTimerCallbackProc of the file vcl/source/app/timer.cxx (pity i know just some words of german since all the comments are in german in it).
and i saw a calling of "Stop" in it.

You said that aSpellTimer is only restarted in SpellTimerHdl but i saw line 1915 in the function IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
BOOL bSpell = pDoc->ContinueOnlineSpelling();
if ( bSpell )
aSpellTimer.Start(); // da ist noch was

Is it normal we find a Start calling of aSpellTimer in IMPL_LINK of IdleHandler ?

For the rest, i understand that aIdleTimer is always started because of this following line at the end of this same function, there's an unconditionnal :
aIdleTimer.Start();

It could help if we had the english translation of german comments (i know there's currently an "easy task" for this and that it must be quite tedious to translate all the comments) but could someone just translate this ?
// ueberhaupt noch was?
and above all, this ?
//      SC_IDLE_COUNT mal mit initialem Timeout, dann hochzaehlen


Perhaps just an idea for this timer. If it should be started only if there's something to do, i'd move these lines :
    aIdleTimer.Start();
    return 0;

at the end of the block :
if ( bMore )

Indeed, the rest just seems a recalculation of the timeout of the handler and perhaps this recalculation must be analysed/rethought/optimized.

Of course, it's just a guess and so it has to be checked, tested, etc.

Julien.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.