зеркало из https://github.com/mozilla/gecko-dev.git
Bug 316543 - crash [@ mozSpellChecker::mozSpellChecker] when opening message compose window. Patch by Adam Guthrie <ispiked@gmail.com>, r=timeless, sr=mscott
This commit is contained in:
Родитель
4012bcc194
Коммит
7d9ac3faef
|
@ -45,17 +45,6 @@ NS_IMPL_ISUPPORTS1(mozSpellChecker, nsISpellChecker)
|
|||
|
||||
mozSpellChecker::mozSpellChecker()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
mPersonalDictionary = do_GetService("@mozilla.org/spellchecker/personaldictionary;1",&rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ERROR("Could not get personal Dictionary");
|
||||
}
|
||||
mSpellCheckingEngine = do_GetService("@mozilla.org/spellchecker/myspell;1",&rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ERROR("Could not get spell checker");
|
||||
}
|
||||
mSpellCheckingEngine->SetPersonalDictionary(mPersonalDictionary);
|
||||
}
|
||||
|
||||
mozSpellChecker::~mozSpellChecker()
|
||||
|
@ -68,6 +57,20 @@ mozSpellChecker::~mozSpellChecker()
|
|||
mPersonalDictionary = nsnull;
|
||||
}
|
||||
|
||||
nsresult
|
||||
mozSpellChecker::Init()
|
||||
{
|
||||
mPersonalDictionary = do_GetService("@mozilla.org/spellchecker/personaldictionary;1");
|
||||
|
||||
nsresult rv;
|
||||
mSpellCheckingEngine = do_GetService("@mozilla.org/spellchecker/myspell;1",&rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
mSpellCheckingEngine->SetPersonalDictionary(mPersonalDictionary);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
mozSpellChecker::SetDocument(nsITextServicesDocument *aDoc, PRBool aFromStartofDoc)
|
||||
{
|
||||
|
|
|
@ -55,6 +55,8 @@ public:
|
|||
mozSpellChecker();
|
||||
virtual ~mozSpellChecker();
|
||||
|
||||
nsresult Init();
|
||||
|
||||
// nsISpellChecker
|
||||
NS_IMETHOD SetDocument(nsITextServicesDocument *aDoc, PRBool aFromStartofDoc);
|
||||
NS_IMETHOD NextMisspelledWord(nsAString &aWord, nsStringArray *aSuggestions);
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
// NOTE: This creates an instance of objects by using the default constructor
|
||||
//
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(mozSpellChecker)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozSpellChecker, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozPersonalDictionary, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(mozSpellI18NManager)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче