Closed Bug 252681 Opened 20 years ago Closed 20 years ago

mozISpellCheckingEngine check method faulting on misspelled words

Categories

(Core :: Spelling checker, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: robert.strong.bugs, Assigned: timeless)

Details

(Keywords: crash)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040719 Firefox/0.9.1+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040719 Firefox/0.9.1+ When using the following javascript - the check method always works with a correctly spelled word and always faults when passing a misspelled word. var spellChecker = Components.classes['@mozilla.org/spellchecker/myspell;1'] .createInstance().QueryInterface(Components.interfaces.mozISpellCheckingEngine); spellChecker.dictionary = "en-US"; alert("two is spelled correctly? " + spellChecker.check("two")); alert("twoo is spelled correctly? " + spellChecker.check("twoo")); I have also noticed that the suggest method also faults which is probably related. Reproducible: Always Steps to Reproduce: 1. Add this code to an extension var spellChecker = Components.classes['@mozilla.org/spellchecker/myspell;1'] .createInstance().QueryInterface(Components.interfaces.mozISpellCheckingEngine); spellChecker.dictionary = "en-US"; alert("two is spelled correctly? " + spellChecker.check("two")); alert("twoo is spelled correctly? " + spellChecker.check("twoo")); 2. run the code Actual Results: check returns true with a correctly spelled word check faults and closes the application with an incorrectly spelled word Expected Results: Return the appropriate value in both cases without faulting. Faulting application firefox.exe, version 0.9.0.0, faulting module myspell.dll, version 1.7.20040.62616, fault address 0x00002db9.
Added the following two lines and it resolved my issue. var persDict = Components.classes['@mozilla.org/spellchecker/personaldictionary;1'] .createInstance().QueryInterface(Components.interfaces.mozIPersonalDictionary); spellChecker.personalDictionary = persDict;
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → INVALID
it's a bug. we shouldn't crash.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Attached patch fixSplinter Review
js> var spellChecker = Components.classes['@mozilla.org/spellchecker/myspell;1'].createInstance(Components.interfaces.mozISpellCheckingEngine); js> spellChecker.dictionary = "en-US"; en-US js> alert=print function print() { [native code] } js> alert("two is spelled correctly? " + spellChecker.check("two")); two is spelled correctly? true js> alert("twoo is spelled correctly? " + spellChecker.check("twoo")); twoo is spelled correctly? false js> quit()
Assignee: nobody → timeless
Status: UNCONFIRMED → ASSIGNED
Attachment #154068 - Flags: superreview?(tor)
Attachment #154068 - Flags: review?(mvl)
Severity: normal → critical
Keywords: crash
Comment on attachment 154068 [details] [diff] [review] fix yeah, a personal dictionary should be optional.
Attachment #154068 - Flags: review?(mvl) → review+
Comment on attachment 154068 [details] [diff] [review] fix sr=dmose
Attachment #154068 - Flags: superreview?(tor) → superreview+
mozilla/extensions/spellcheck/myspell/src/myspAffixmgr.cpp 1.11
Status: ASSIGNED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: