| 1 |
--- ./extensions/spellcheck/hunspell/src/mozHunspell.cpp.orig 2008-02-15 19:21:21.000000000 +0000 |
| 2 |
+++ ./extensions/spellcheck/hunspell/src/mozHunspell.cpp 2008-02-15 19:23:20.000000000 +0000 |
| 3 |
@@ -63,6 +63,9 @@ |
| 4 |
#include "nsISimpleEnumerator.h" |
| 5 |
#include "nsIDirectoryEnumerator.h" |
| 6 |
#include "nsIFile.h" |
| 7 |
+#ifdef MOZ_NATIVE_HUNSPELL |
| 8 |
+#include "nsILocalFile.h" |
| 9 |
+#endif |
| 10 |
#include "nsDirectoryServiceUtils.h" |
| 11 |
#include "nsDirectoryServiceDefs.h" |
| 12 |
#include "mozISpellI18NManager.h" |
| 13 |
@@ -307,7 +310,16 @@ |
| 14 |
return; |
| 15 |
|
| 16 |
nsCOMPtr<nsIFile> dictDir; |
| 17 |
- rv = dirSvc->Get(DICTIONARY_SEARCH_DIRECTORY, |
| 18 |
+ #ifdef MOZ_NATIVE_HUNSPELL |
| 19 |
+ nsCOMPtr<nsILocalFile> localFile; |
| 20 |
+ rv = NS_NewNativeLocalFile(nsDependentCString("/usr/share/myspell"),PR_TRUE, getter_AddRefs(localFile)); |
| 21 |
+ if (localFile && NS_SUCCEEDED(rv)) { |
| 22 |
+ localFile->QueryInterface(NS_GET_IID(nsIFile), getter_AddRefs(dictDir)); |
| 23 |
+ LoadDictionariesFromDir(dictDir); |
| 24 |
+ } |
| 25 |
+ else { |
| 26 |
+ #endif |
| 27 |
+ rv = dirSvc->Get(DICTIONARY_SEARCH_DIRECTORY, |
| 28 |
NS_GET_IID(nsIFile), getter_AddRefs(dictDir)); |
| 29 |
if (NS_SUCCEEDED(rv)) { |
| 30 |
LoadDictionariesFromDir(dictDir); |
| 31 |
@@ -332,6 +344,9 @@ |
| 32 |
LoadDictionariesFromDir(appDir); |
| 33 |
} |
| 34 |
} |
| 35 |
+#ifdef MOZ_NATIVE_HUNSPELL |
| 36 |
+ } |
| 37 |
+#endif |
| 38 |
|
| 39 |
nsCOMPtr<nsISimpleEnumerator> dictDirs; |
| 40 |
rv = dirSvc->Get(DICTIONARY_SEARCH_DIRECTORY_LIST, |
| 41 |
--- ./extensions/spellcheck/src/Makefile.in.orig 2008-02-15 19:25:58.000000000 +0000 |
| 42 |
+++ ./extensions/spellcheck/src/Makefile.in 2008-02-15 19:28:36.000000000 +0000 |
| 43 |
@@ -63,9 +63,16 @@ |
| 44 |
txtsvc \ |
| 45 |
uconv \ |
| 46 |
unicharutil \ |
| 47 |
+ xulapp \ |
| 48 |
$(NULL) |
| 49 |
|
| 50 |
-CPPSRCS = \ |
| 51 |
+ifdef MOZ_NATIVE_HUNSPELL |
| 52 |
+CPPSRCS += mozHunspell.cpp |
| 53 |
+ifdef MOZ_XUL_APP |
| 54 |
+CPPSRCS += mozHunspellDirProvider.cpp |
| 55 |
+endif |
| 56 |
+endif |
| 57 |
+CPPSRCS += \ |
| 58 |
mozSpellCheckerFactory.cpp \ |
| 59 |
mozSpellChecker.cpp \ |
| 60 |
mozPersonalDictionary.cpp \ |
| 61 |
@@ -80,8 +87,14 @@ |
| 62 |
SHARED_LIBRARY_LIBS += ../osxspell/src/$(LIB_PREFIX)osxspell_s.$(LIB_SUFFIX) |
| 63 |
LOCAL_INCLUDES += -I$(srcdir)/../osxspell/src |
| 64 |
else |
| 65 |
+ifndef MOZ_NATIVE_HUNSPELL |
| 66 |
SHARED_LIBRARY_LIBS += ../hunspell/src/$(LIB_PREFIX)hunspell_s.$(LIB_SUFFIX) |
| 67 |
LOCAL_INCLUDES += -I$(srcdir)/../hunspell/src |
| 68 |
+else |
| 69 |
+LOCAL_INCLUDES += $(MOZ_HUNSPELL_CFLAGS) \ |
| 70 |
+ -DMOZ_NATIVE_HUNSPELL \ |
| 71 |
+ $(NULL) |
| 72 |
+endif |
| 73 |
endif |
| 74 |
|
| 75 |
EXTRA_DSO_LDOPTS = \ |
| 76 |
@@ -96,3 +112,18 @@ |
| 77 |
LOCAL_INCLUDES += \ |
| 78 |
-I$(topsrcdir)/xpcom/io \ |
| 79 |
$(NULL) |
| 80 |
+ |
| 81 |
+ifdef MOZ_NATIVE_HUNSPELL |
| 82 |
+export:: $(srcdir)/../hunspell/src/mozHunspell.cpp |
| 83 |
+ $(INSTALL) $(srcdir)/../hunspell/src/mozHunspell.* . |
| 84 |
+GARBAGE += mozHunspell.$(OBJ_SUFFIX) mozHunspell.cpp |
| 85 |
+clean:: |
| 86 |
+ rm -f mozHunspell.* |
| 87 |
+ifdef MOZ_XUL_APP |
| 88 |
+export:: $(srcdir)/../hunspell/src/mozHunspellDirProvider.cpp |
| 89 |
+ $(INSTALL) $(srcdir)/../hunspell/src/mozHunspellDirProvider.* . |
| 90 |
+GARBAGE += mozHunspellDirProvider.$(OBJ_SUFFIX) mozHunspellDirProvider.cpp |
| 91 |
+clean:: |
| 92 |
+ rm -f mozHunspellDirProvider.* |
| 93 |
+endif |
| 94 |
+endif |
| 95 |
--- ./extensions/spellcheck/Makefile.in.orig 2008-02-15 19:23:39.000000000 +0000 |
| 96 |
+++ ./extensions/spellcheck/Makefile.in 2008-02-15 19:24:34.000000000 +0000 |
| 97 |
@@ -42,13 +42,19 @@ |
| 98 |
include $(DEPTH)/config/autoconf.mk |
| 99 |
|
| 100 |
MODULE = spellchecker |
| 101 |
-DIRS = idl locales |
| 102 |
+ifndef MOZ_NATIVE_HUNSPELL |
| 103 |
+DIRS = idl locales |
| 104 |
+else |
| 105 |
+DIRS = idl |
| 106 |
+endif |
| 107 |
|
| 108 |
ifeq (camino,$(MOZ_BUILD_APP)) |
| 109 |
DIRS += osxspell |
| 110 |
else |
| 111 |
+ifndef MOZ_NATIVE_HUNSPELL |
| 112 |
DIRS += hunspell |
| 113 |
endif |
| 114 |
+endif |
| 115 |
|
| 116 |
DIRS += src |