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.
Julien.
(just in case what I did is ok, license is as usual LGPLv3+ / MPL)
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 1bc98b5..1f164e9 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1912,11 +1912,8 @@ IMPL_LINK( ScModule, IdleHandler, Timer*, EMPTYARG )
BOOL bLinks = pDoc->IdleCheckLinks();
BOOL bWidth = pDoc->IdleCalcTextWidth();
- BOOL bSpell = pDoc->ContinueOnlineSpelling();
- if ( bSpell )
- aSpellTimer.Start(); // da
ist noch was
- bMore = bLinks || bWidth || bSpell; // ueberhaupt
noch was?
+ bMore = bLinks || bWidth; // ueberhaupt noch was?
// While calculating a Basic formula, a paint event may have
occured,
// so check the bNeedsRepaint flags for this document's views
@@ -1956,15 +1953,27 @@ IMPL_LINK( ScModule, SpellTimerHdl, Timer*, EMPTYARG )
if ( Application::AnyInput( INPUT_KEYBOARD ) )
{
aSpellTimer.Start();
- return 0; // dann spaeter
wieder...
}
-
- ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
- if ( pDocSh )
+ else
{
- ScDocument* pDoc = pDocSh->GetDocument();
- if ( pDoc->ContinueOnlineSpelling() )
- aSpellTimer.Start();
+
+ ScDocShell* pDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
+ if ( pDocSh )
+ {
+ ScDocument* pDoc = pDocSh->GetDocument();
+ if ( pDoc->ContinueOnlineSpelling() )
+ {
+ aSpellTimer.Start();
+ }
+ else
+ {
+ aSpellTimer.Stop();
+ }
+ }
+ else
+ {
+ aSpellTimer.Stop();
+ }
}
return 0;
}
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice