diff --git a/editor/spellchecker/nsIInlineSpellChecker.idl b/editor/spellchecker/nsIInlineSpellChecker.idl index d6f1b897b226..b95bb954b4ae 100644 --- a/editor/spellchecker/nsIInlineSpellChecker.idl +++ b/editor/spellchecker/nsIInlineSpellChecker.idl @@ -31,7 +31,7 @@ interface nsIInlineSpellChecker : nsISupports void removeWordFromDictionary(in AString aWord); void ignoreWord(in AString aWord); - void ignoreWords([array, size_is(aCount)] in wstring aWordsToIgnore, in unsigned long aCount); + void ignoreWords(in Array aWordsToIgnore); void updateCurrentDictionary(); readonly attribute boolean spellCheckPending; diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.cpp b/extensions/spellcheck/src/mozInlineSpellChecker.cpp index 490e1121ab54..3df99ebeefe7 100644 --- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp +++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp @@ -923,14 +923,13 @@ mozInlineSpellChecker::IgnoreWord(const nsAString& word) { // mozInlineSpellChecker::IgnoreWords NS_IMETHODIMP -mozInlineSpellChecker::IgnoreWords(const char16_t** aWordsToIgnore, - uint32_t aCount) { +mozInlineSpellChecker::IgnoreWords(const nsTArray& aWordsToIgnore) { NS_ENSURE_TRUE(mSpellCheck, NS_ERROR_NOT_INITIALIZED); // add each word to the ignore list and then recheck the document - for (uint32_t index = 0; index < aCount; index++) - mSpellCheck->IgnoreWordAllOccurrences( - nsDependentString(aWordsToIgnore[index])); + for (auto& word : aWordsToIgnore) { + mSpellCheck->IgnoreWordAllOccurrences(word); + } auto status = MakeUnique(this); nsresult rv = status->InitForSelection();