• Michael Stahl's avatar
    tdf#92036: sw: fix idle spelling loop · 28561ee1
    Michael Stahl yazdı
    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.
    
    (cherry picked from commit 4c91e94e)
    
    Change-Id: Ifb3d6d17f94f9f1cfad82e70dfa79f1594c38647
    Reviewed-on: https://gerrit.libreoffice.org/18511Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
    Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
    28561ee1
ndtxt.hxx 32.4 KB