https://bugs.documentfoundation.org/show_bug.cgi?id=96354

            Bug ID: 96354
           Summary: autocorrect code incorrectly categorizes hebrew
                    letters / 100% cpu usage when typing hebrew
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

SYMPTOM:
when auto-correct option "correct TWo INitial CApitals" is enabled, typing a
space after a misspelled Hebrew word (or any word that does not exist in the
Hebrew dictionary) causes a 2 second 100% cpu spike on my Intel i5 machine.
disabling the above mentioned auto-correct option resolves the problem.

EXPLANATION:
after some stepping through a debugger and sifting through source code I think
I have found two bugs related to this. Both bugs are in the file
"\editeng\source\misc\svxacorr.cxx", and should be very easy to correct. (I am
not familiar with the procedure of submitting patches).

1) When a space character is inserted it triggers the auto-correct logic which
looks for two initial capitals. When it detects that, it checks the dictionary
to see if the two initial capitals are intended. This is done in the function
SvxAutoCorrect::FnCptlSttWrd using the following very expensive code:

                    if (!xSpeller->spell(sWord, eLang, aEmptySeq).is())
                    {
                        return false;
                    }

Instead of asking for suggestions and checking for a null list to detect
correct spelling, it should be just be validating the spelling in the same way
as the spell checking code does.

2) The auto-correct code detects the case of a letter using the functions
IsUpperLetter() and IsLowerLetter() which both contain a bug which causes any
non latin character to be recognized as both uppercase and lowercase when in
fact it is neither, i.e. it deduces that a character is lowercase if it is not
uppercase and vice versa. This results in the incorrect conclusion that any
word written in a non latin script has two initial uppercase letters followed
by lowercase letters and thus triggering the first bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to