Bug #319778 --> use hunspell instead of myspell as the default spell check engine. patch by Ryan VanderMeulen <ryanvm@gmail.com> and Németh László <nemeth@openoffice.org> sr=mscott a=mconnor/schrep for 1.9

This commit is contained in:
scott@scott-macgregor.org 2007-08-05 20:32:58 -07:00
parent d0ed3cca65
commit 90f33cba89
13 changed files with 33 additions and 121 deletions

View File

@ -723,9 +723,9 @@ xpfe/global/resources/locale/en-US/unix/Makefile
xpfe/global/resources/locale/en-US/win/Makefile
xpfe/communicator/Makefile
extensions/spellcheck/Makefile
extensions/spellcheck/hunspell/Makefile
extensions/spellcheck/idl/Makefile
extensions/spellcheck/locales/Makefile
extensions/spellcheck/myspell/Makefile
extensions/spellcheck/src/Makefile
"

View File

@ -586,7 +586,7 @@ function ExitSpellChecker()
var curLang = gSpellChecker.GetCurrentDictionary();
gSpellChecker.UninitSpellChecker();
if ("@mozilla.org/spellchecker;1" in Components.classes) {
var spellChecker = Components.classes["@mozilla.org/spellchecker/myspell;1"]
var spellChecker = Components.classes["@mozilla.org/spellchecker/hunspell;1"]
.getService(Components.interfaces.mozISpellCheckingEngine);
spellChecker.dictionary = curLang;
}

View File

@ -47,7 +47,7 @@ DIRS = idl locales
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS += osxspell
else
DIRS += myspell
DIRS += hunspell
endif
DIRS += src

View File

@ -47,7 +47,7 @@ DEFINES += -DAB_CD=$(AB_CD)
include $(topsrcdir)/config/rules.mk
DICTIONARY_FILES = $(strip $(wildcard $(LOCALE_SRCDIR)/myspell/*.dic) $(wildcard $(LOCALE_SRCDIR)/myspell/*.aff))
DICTIONARY_FILES = $(strip $(wildcard $(LOCALE_SRCDIR)/hunspell/*.dic) $(wildcard $(LOCALE_SRCDIR)/hunspell/*.aff))
ifneq (,$(DICTIONARY_FILES))
libs::

View File

@ -40,7 +40,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = myspell
MODULE = hunspell
DIRS = src
include $(topsrcdir)/config/rules.mk

View File

@ -40,7 +40,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = myspell
MODULE = hunspell
LIBRARY_NAME = osxspell_s
FORCE_STATIC_LIB = 1
LIBXUL_LIBRARY = 1

View File

@ -33,7 +33,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* This spellchecker is based on the built-in spellchecker on Mac OS X. It
* does not use any MySpell technology or rely on their dictionaries. It's just
* does not use any Hunspell technology or rely on their dictionaries. It's just
* a thin wrapper around the Cocoa NSSpellChecker API.
*
* ***** END LICENSE BLOCK ***** */
@ -48,7 +48,7 @@
// use the same contract id as the MySpell spelchecker so we get picked up
// instead on Mac OS X but we have our own CID.
#define MOZ_OSXSPELL_CONTRACTID "@mozilla.org/spellchecker/myspell;1"
#define MOZ_OSXSPELL_CONTRACTID "@mozilla.org/spellchecker/hunspell;1"
#define MOZ_OSXSPELL_CID \
{ /* BAABBAF4-71C3-47F4-A576-E75469E485E2 */ \
0xBAABBAF4, 0x71C3, 0x47F4, \

View File

@ -33,7 +33,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* This spellchecker is based on the built-in spellchecker on Mac OS X. It
* does not use any MySpell technology or rely on their dictionaries. It's just
* does not use any Hunspell technology or rely on their dictionaries. It's just
* a thin wrapper around the Cocoa NSSpellChecker API.
*
* ***** END LICENSE BLOCK ***** */
@ -136,7 +136,7 @@ NS_IMETHODIMP mozOSXSpell::GetProvidesWordUtils(PRBool *aProvidesWordUtils)
//
// GetName
//
// Name not supported (nor is it in MySpell impl)
// Name not supported (nor is it in Hunspell impl)
//
NS_IMETHODIMP mozOSXSpell::GetName(PRUnichar * *aName)
{
@ -146,7 +146,7 @@ NS_IMETHODIMP mozOSXSpell::GetName(PRUnichar * *aName)
//
// GetCopyright
//
// Copyright not supported (nor is it in MySpell impl)
// Copyright not supported (nor is it in Hunspell impl)
//
NS_IMETHODIMP mozOSXSpell::GetCopyright(PRUnichar * *aCopyright)
{

View File

@ -45,10 +45,10 @@ include $(DEPTH)/config/autoconf.mk
MODULE = spellchecker
LIBRARY_NAME = spellchecker
MODULE_NAME = mozSpellCheckerModule
SHORT_LIBNAME = spellchk
SHORT_LIBNAME = spellchk
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
LIBXUL_LIBRARY = 1
LIBXUL_LIBRARY = 1
REQUIRES = xpcom \
string \
@ -79,8 +79,8 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
SHARED_LIBRARY_LIBS += ../osxspell/src/$(LIB_PREFIX)osxspell_s.$(LIB_SUFFIX)
LOCAL_INCLUDES += -I$(srcdir)/../osxspell/src
else
SHARED_LIBRARY_LIBS += ../myspell/src/$(LIB_PREFIX)myspell_s.$(LIB_SUFFIX)
LOCAL_INCLUDES += -I$(srcdir)/../myspell/src
SHARED_LIBRARY_LIBS += ../hunspell/src/$(LIB_PREFIX)hunspell_s.$(LIB_SUFFIX)
LOCAL_INCLUDES += -I$(srcdir)/../hunspell/src
endif
EXTRA_DSO_LDOPTS = \

View File

@ -65,7 +65,7 @@ mozSpellChecker::Init()
mPersonalDictionary = do_GetService("@mozilla.org/spellchecker/personaldictionary;1");
nsresult rv;
mSpellCheckingEngine = do_GetService("@mozilla.org/spellchecker/myspell;1",&rv);
mSpellCheckingEngine = do_GetService("@mozilla.org/spellchecker/hunspell;1",&rv);
if (NS_FAILED(rv)) {
return rv;
}
@ -131,8 +131,7 @@ mozSpellChecker::CheckWord(const nsAString &aWord, PRBool *aIsMisspelled, nsStri
if(!mSpellCheckingEngine)
return NS_ERROR_NULL_POINTER;
// don't bother to check crazy words, also, myspell gets unhappy if you
// give it too much data and crashes sometimes
// don't bother to check crazy words
if (aWord.Length() > UNREASONABLE_WORD_LENGTH) {
*aIsMisspelled = PR_TRUE;
return NS_OK;

View File

@ -14,8 +14,7 @@
*
* The Original Code is Mozilla Spellchecker Component.
*
* The Initial Developer of the Original Code is
* David Einstein.
* The Initial Developer of the Original Code is David Einstein.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
@ -41,9 +40,9 @@
#ifdef MOZ_WIDGET_COCOA
#include "mozOSXSpell.h"
#else
#include "mozMySpell.h"
#include "mozHunspell.h"
#ifdef MOZ_XUL_APP
#include "mozMySpellDirProvider.h"
#include "mozHunspellDirProvider.h"
#endif
#endif
@ -64,7 +63,7 @@
{ 0xa0, 0x1a, 0x66, 0x40, 0x2e, 0xa2, 0x86, 0x57} }
////////////////////////////////////////////////////////////////////////
// Define the contructor function for the objects
// Define the constructor function for the objects
//
// NOTE: This creates an instance of objects by using the default constructor
//
@ -72,9 +71,9 @@
#ifdef MOZ_WIDGET_COCOA
NS_GENERIC_FACTORY_CONSTRUCTOR(mozOSXSpell)
#else
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozMySpell, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozHunspell, Init)
#ifdef MOZ_XUL_APP
NS_GENERIC_FACTORY_CONSTRUCTOR(mozMySpellDirProvider)
NS_GENERIC_FACTORY_CONSTRUCTOR(mozHunspellDirProvider)
#endif
#endif
@ -132,19 +131,19 @@ static nsModuleComponentInfo components[] = {
},
#else
{
"mozMySpell",
MOZ_MYSPELL_CID,
MOZ_MYSPELL_CONTRACTID,
mozMySpellConstructor
"mozHunspell",
MOZ_HUNSPELL_CID,
MOZ_HUNSPELL_CONTRACTID,
mozHunspellConstructor
},
#ifdef MOZ_XUL_APP
{
"mozMySpellDirProvider",
MYSPELLDIRPROVIDER_CID,
mozMySpellDirProvider::kContractID,
mozMySpellDirProviderConstructor,
mozMySpellDirProvider::Register,
mozMySpellDirProvider::Unregister
"mozHunspellDirProvider",
HUNSPELLDIRPROVIDER_CID,
mozHunspellDirProvider::kContractID,
mozHunspellDirProviderConstructor,
mozHunspellDirProvider::Register,
mozHunspellDirProvider::Unregister
},
#endif // MOZ_XUL_APP
#endif // MOZ_WIDGET_COCOA

View File

@ -173,7 +173,6 @@
<li><a href="about:license#growl">Growl License</a></li>
<li><a href="about:license#jpnic">Japan Network Information Centre License</a></li>
<li><a href="about:license#jep">Java Embedding Plugin License</a></li>
<li><a href="about:license#myspell">Myspell License</a></li>
<li><a href="about:license#openvision">OpenVision License</a></li>
<li><a href="about:license#ucal">University of California License</a></li>
</ul>
@ -2147,48 +2146,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>
<hr>
<h1><a name="myspell"></a>Myspell License</h1>
<p class="correctme">This license applies to certain files in the directory
<span class="path">extensions/spellcheck/myspell/src/</span>.</p>
<pre>
Copyright 2002 Kevin B. Hendricks, Stratford, Ontario, Canada
And Contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All modifications to the source code must be clearly marked as
such. Binary redistributions based on modified source code
must be clearly marked as modified versions in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY KEVIN B. HENDRICKS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
KEVIN B. HENDRICKS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
</pre>
<hr>
<h1><a name="openvision"></a>OpenVision License</h1>

View File

@ -173,7 +173,6 @@
<li><a href="about:license#growl">Growl License</a></li>
<li><a href="about:license#jpnic">Japan Network Information Centre License</a></li>
<li><a href="about:license#jep">Java Embedding Plugin License</a></li>
<li><a href="about:license#myspell">Myspell License</a></li>
<li><a href="about:license#openvision">OpenVision License</a></li>
<li><a href="about:license#ucal">University of California License</a></li>
</ul>
@ -2147,48 +2146,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>
<hr>
<h1><a name="myspell"></a>Myspell License</h1>
<p class="correctme">This license applies to certain files in the directory
<span class="path">extensions/spellcheck/myspell/src/</span>.</p>
<pre>
Copyright 2002 Kevin B. Hendricks, Stratford, Ontario, Canada
And Contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All modifications to the source code must be clearly marked as
such. Binary redistributions based on modified source code
must be clearly marked as modified versions in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY KEVIN B. HENDRICKS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
KEVIN B. HENDRICKS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
</pre>
<hr>
<h1><a name="openvision"></a>OpenVision License</h1>