Bug 44227 - Background Spellcheck Page update and general spellcheck problem
Summary: Background Spellcheck Page update and general spellcheck problem
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-22 08:48 UTC by Felix Seeger
Modified: 2004-01-06 15:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Seeger 2002-06-22 08:43:41 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kword
Version:           1.2 Beta2 (using KDE 3.0.5 (CVS HEAD >= 20020427))
Severity:          normal
Installed from:    compiled sources
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:                Linux (i686) release 2.4.18
OS/Compiler notes: 

Hi

Enable background spellchecking and type this:

ff 
fffff 
ffff 
fffff 

Now add numbers before the words like 34fffff.
- Numbers are not underlined.
Go to the end of a line and remove it with backspaces.
- There will be one "red space underline" left

Now type ssdd
The spellcheck will only work if there are more than two letters ok but because of the slow update:
- If you are faster than the spellchecker and press return kword will forget it and leave the word unchecked.


have fun
Felix

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Laurent Montel 2002-06-22 09:03:26 UTC
Le Saturday 22 June 2002 10:43 felix.seeger@gmx.de a écrit :
> Package: kword
> Version: 1.2 Beta2 (using KDE 3.0.5 (CVS HEAD >= 20020427))
> Severity: normal
> Installed from:    compiled sources
> Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
> OS:                Linux (i686) release 2.4.18
> OS/Compiler notes:
>
> Hi
>
> Enable background spellchecking and type this:
>
> ff
> fffff
> ffff
> fffff
>
> Now add numbers before the words like 34fffff.
> - Numbers are not underlined.

Normal kspell doen't spell number perhaps it"s a bug....

> Go to the end of a line and remove it with backspaces.
> - There will be one "red space underline" left
Problem with last charactere. I will try to fix it.

>
> Now type ssdd
> The spellcheck will only work if there are more than two letters ok but
> because of the slow update: - If you are faster than the spellchecker and
> press return kword will forget it and leave the word unchecked.

Why leave the word unchecked it's very strange...

>
>
> have fun
> Felix
>
> (Submitted via bugs.kde.org)
> (Called from KBugReport dialog)
>
>
> (Complete bug history is available at http://bugs.kde.org/db/44/44227.html)
Regards.
Comment 2 David Faure 2003-03-31 23:54:30 UTC
Subject: koffice/lib/kotext

CVS commit by faure: 

Fixed race condition that led to some words not being spellchecked.
CCMAIL: 44227@bugs.kde.org


  M +14 -5     koBgSpellCheck.cc   1.35


--- koffice/lib/kotext/koBgSpellCheck.cc  #1.34:1.35
@@ -230,4 +230,7 @@ void KoBgSpellCheck::nextParagraphNeedin
     if ( parag && parag->string() && parag->string()->needsSpellCheck() )
     {
+#ifdef DEBUG_BGSPELLCHECKING
+        kdDebug(32500) << "current parag " << parag << " needs checking again." <<endl;
+#endif
         return;
     }
@@ -261,6 +264,4 @@ void KoBgSpellCheck::nextParagraphNeedin
         else
         {
-            if ( m_bgSpell.currentParag )
-                m_bgSpell.currentParag->string()->setNeedsSpellCheck( false );
             if ( m_bgSpell.currentTextObj )
                 m_bgSpell.currentTextObj->setNeedSpellCheck( false );
@@ -301,7 +302,16 @@ void KoBgSpellCheck::spellCheckNextParag
     kdDebug(32500) << "KoBgSpellCheck::spellCheckNextParagraph spell checking parag " << m_bgSpell.currentParag->paragId() << endl;
 #endif
-    // Now spell-check that paragraph
+
+    // Get the text to spell-check
     QString text = m_bgSpell.currentParag->string()->toString();
     text.remove( text.length() - 1, 1 ); // trailing space
+
+    // Mark it as "we've read the text to be spell-checked", *before* doing it.
+    // This prevents race conditions: if the user modifies the text during
+    // the spellchecking, the new text _will_ be checked, since the bool will
+    // be set to true.
+    m_bgSpell.currentParag->string()->setNeedsSpellCheck( false );
+
+    // Now spell-check that paragraph
     m_bgSpell.kspell->check(text);
 }
@@ -335,7 +345,6 @@ void KoBgSpellCheck::spellCheckerDone()
     kdDebug(32500) << "KoBgSpellCheck::spellCheckerDone" << endl;
 #endif
-    if(m_bgSpell.currentParag)
-        m_bgSpell.currentParag->string()->setNeedsSpellCheck( false );
     if( m_bgSpell.currentTextObj && m_bgSpell.currentParag==m_bgSpell.currentTextObj->textDocument()->lastParag())
+        // ### and there is no paragraph in the textobject that got the "needsSpellCheck" flag since!
         m_bgSpell.currentTextObj->setNeedSpellCheck(false);
     // Done checking the current paragraph, schedule the next one


Comment 3 Jo Øiongen 2003-12-19 11:22:59 UTC
The only thing left from the original bugreport is that numbers are not underlined. In my opinion this is how things should work. People with more insight and knowlegde in spelling than me might disagree. But from what I feel is right this bugreport should be closed.

Cheers Jo
Comment 4 Jo Øiongen 2004-01-06 14:53:35 UTC
I think this bug report should be marked as "fixed". See my previous posting why. Objections are welcomed :-)

Cheers Jo
Comment 5 David Faure 2004-01-06 15:37:22 UTC
34ff not being checked seems to be an ispell feature, so we can't do much about it.
All we can hope is that libaspell works better in this respect - if not, but the aspell developers.