Fixed spellchecker recheck bug.

mozilla/editor/base/nsEditorShell.cpp
mozilla/editor/idl/nsIEditorSpellCheck.idl

    - Modified StartSpellChecking() so that it no longer calls
      NextMisspelledWord().
    - Renamed Start/CloseSpellChecking() to Init/UninitSpellChecker().
    - Changed prototype of GetCurrentDictionary() in the idl file.
    - Replaced all references of NS_SPELLCHECKER_CID with NS_SPELLCHECKER_PROGID.

mozilla/editor/txtsvc/public/nsISpellChecker.h

    - Added NS_SPELLCHECKER_PROGID.

mozilla/editor/txtsvc/public/nsTextServicesCID.h

    - Removed NS_SPELLCHECKER_CID.

mozilla/editor/ui/composer/content/ComposerCommands.js

    - Replaced all calls to  Start/CloseSpellChecking() with
      Init/UninitSpellChecker().
    - We now call GetNextMisspelledWord() after initing the spellchecker.

mozilla/editor/ui/dialogs/content/EdSpellCheck.js

    - Dialog now assumes the spellchecker language has been set before the
      dialog is invoked.
    - Fixed Recheck() so that it now sets the language.


git-svn-id: svn://10.0.0.236/trunk@68398 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kin%netscape.com
2000-05-05 14:58:43 +00:00
parent 329bfae69c
commit 5d6c2dec76
9 changed files with 57 additions and 49 deletions

View File

@@ -130,7 +130,6 @@
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
static NS_DEFINE_CID(kHTMLEditorCID, NS_HTMLEDITOR_CID);
static NS_DEFINE_CID(kCTextServicesDocumentCID, NS_TEXTSERVICESDOCUMENT_CID);
static NS_DEFINE_CID(kCSpellCheckerCID, NS_SPELLCHECKER_CID);
static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID);
static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_CID(kCommonDialogsCID, NS_CommonDialog_CID );
@@ -1050,8 +1049,6 @@ nsEditorShell::ApplyStyleSheet(const PRUnichar *url)
NS_IMETHODIMP
nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
{
nsresult res = NS_OK;
// Reqesting SourceMode and we are already doing that
if (aDisplayMode == eDisplayModeSource && mDisplayMode == eDisplayModeSource)
return NS_OK;
@@ -4028,10 +4025,10 @@ nsEditorShell::GetEmbeddedObjects(nsISupportsArray **aObjectArray)
}
NS_IMETHODIMP
nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
nsEditorShell::InitSpellChecker()
{
nsresult result = NS_NOINTERFACE;
nsAutoString firstMisspelledWord;
// We can spell check with any editor type
if (mEditor)
{
@@ -4059,7 +4056,7 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
if (NS_FAILED(result))
return result;
result = nsComponentManager::CreateInstance(kCSpellCheckerCID,
result = nsComponentManager::CreateInstance(NS_SPELLCHECKER_PROGID,
nsnull,
NS_GET_IID(nsISpellChecker),
(void **)getter_AddRefs(mSpellChecker));
@@ -4076,10 +4073,8 @@ nsEditorShell::StartSpellChecking(PRUnichar **aFirstMisspelledWord)
return result;
DeleteSuggestedWordList();
// Return the first misspelled word and initialize the suggested list
result = mSpellChecker->NextMisspelledWord(&firstMisspelledWord, &mSuggestedWordList);
}
*aFirstMisspelledWord = firstMisspelledWord.ToNewUnicode();
return result;
}
@@ -4322,7 +4317,7 @@ nsEditorShell::SetCurrentDictionary(const PRUnichar *aDictionary)
}
NS_IMETHODIMP
nsEditorShell::CloseSpellChecking()
nsEditorShell::UninitSpellChecker()
{
nsresult result = NS_NOINTERFACE;
// We can spell check with any editor type