summaryrefslogtreecommitdiff
path: root/sw/inc/ndtxt.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-09 10:30:04 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-09 14:13:48 +0200
commit4c91e94e892943ef5e031d65f6f42864233cb4cd (patch)
treec9f6e59cf2d776e028692ff19e58af57fea5deeb /sw/inc/ndtxt.hxx
parentf9f3e97ca867db59f2fc2e4fdb5583ed49cab49c (diff)
tdf#92036: sw: fix idle spelling loop
There is a sort of intentional infinite loop in the idle spell checking handler: while the user is typing a word, it should not be marked as invalid yet, in order not to annoy them with red underlines. So the word where the cursor is positioned always remained dirty, unless you happen to have a grammar checker enabled, which clears the paragraph's dirty flag from a separate thread. To avoid the infinite loop, add another spell checking state "PENDING" which is the same as dirty except that it should cancel the idle spell checking. The idle spell checking will run again when the user does the next editing operation. Notably this means if the user just moves the cursor out of the wrongly spelled word, it won't be underlined yet, but that appears a minor issue, and checking when the cursor leaves the word appears too hard to implement. Change-Id: Ifb3d6d17f94f9f1cfad82e70dfa79f1594c38647
Diffstat (limited to 'sw/inc/ndtxt.hxx')
-rw-r--r--sw/inc/ndtxt.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 261fbdf62136..ba56bb5d6359 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -184,13 +184,16 @@ class SW_DLLPUBLIC SwTextNode: public SwContentNode, public ::sfx2::Metadatable
void DelFrms_TextNodePart();
public:
+ enum class WrongState { TODO, PENDING, DONE };
+
bool IsWordCountDirty() const;
+ WrongState GetWrongDirty() const;
bool IsWrongDirty() const;
bool IsGrammarCheckDirty() const;
bool IsSmartTagDirty() const;
bool IsAutoCompleteWordDirty() const;
void SetWordCountDirty( bool bNew ) const;
- void SetWrongDirty( bool bNew ) const;
+ void SetWrongDirty(WrongState eNew) const;
void SetGrammarCheckDirty( bool bNew ) const;
void SetSmartTagDirty( bool bNew ) const;
void SetAutoCompleteWordDirty( bool bNew ) const;