mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 23:12:31 +00:00
389 lines
11 KiB
Diff
389 lines
11 KiB
Diff
|
Index: common/config.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/config.cpp,v
|
||
|
retrieving revision 1.72.2.1
|
||
|
diff -u -B -b -r1.72.2.1 config.cpp
|
||
|
--- common/config.cpp 22 Jun 2005 05:32:29 -0000 1.72.2.1
|
||
|
+++ common/config.cpp 18 Sep 2006 17:42:40 -0000
|
||
|
@@ -1521,3 +1521,61 @@
|
||
|
}
|
||
|
|
||
|
}
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+#ifdef WIN32PORT
|
||
|
+
|
||
|
+#include "string.hpp"
|
||
|
+
|
||
|
+
|
||
|
+namespace acommon {
|
||
|
+
|
||
|
+ String ReadRegString(HKEY hive, String key, String name)
|
||
|
+ {
|
||
|
+
|
||
|
+ // Reads a string from the Windows registry (used to get paths)
|
||
|
+
|
||
|
+ HKEY hKey;
|
||
|
+ unsigned long lType;
|
||
|
+ DWORD dwSize;
|
||
|
+ unsigned char* szValue = NULL;
|
||
|
+
|
||
|
+ if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||
|
+ {
|
||
|
+ if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
|
||
|
+ {
|
||
|
+ szValue = new unsigned char[dwSize + 1];
|
||
|
+ ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
|
||
|
+ String RegistryReturn((char*)szValue);
|
||
|
+ delete[] szValue;
|
||
|
+ return RegistryReturn;
|
||
|
+ } else {
|
||
|
+ return "";
|
||
|
+ }
|
||
|
+ } else {
|
||
|
+ return "";
|
||
|
+ }
|
||
|
+
|
||
|
+ }
|
||
|
+
|
||
|
+ HKEY GetRegHive()
|
||
|
+ {
|
||
|
+
|
||
|
+ // Check whether Aspell is installed for the current user or for all users
|
||
|
+
|
||
|
+ String value;
|
||
|
+
|
||
|
+ if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
|
||
|
+ {
|
||
|
+ return HKEY_CURRENT_USER;
|
||
|
+ } else {
|
||
|
+ return HKEY_LOCAL_MACHINE;
|
||
|
+ }
|
||
|
+
|
||
|
+ }
|
||
|
+
|
||
|
+}
|
||
|
+
|
||
|
+#endif //WIN32PORT
|
||
|
Index: common/config.hpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/config.hpp,v
|
||
|
retrieving revision 1.25
|
||
|
diff -u -B -b -r1.25 config.hpp
|
||
|
--- common/config.hpp 18 Nov 2004 02:01:53 -0000 1.25
|
||
|
+++ common/config.hpp 18 Sep 2006 17:42:41 -0000
|
||
|
@@ -277,5 +277,20 @@
|
||
|
|
||
|
}
|
||
|
|
||
|
+#ifdef WIN32PORT
|
||
|
+
|
||
|
+#include "minwin.h"
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
+namespace acommon {
|
||
|
+
|
||
|
+ extern HKEY GetRegHive();
|
||
|
+ extern String ReadRegString(HKEY type, String key, String name);
|
||
|
+
|
||
|
+}
|
||
|
+
|
||
|
+#endif
|
||
|
+
|
||
|
#endif
|
||
|
|
||
|
Index: common/file_util.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/file_util.cpp,v
|
||
|
retrieving revision 1.10
|
||
|
diff -u -B -b -r1.10 file_util.cpp
|
||
|
--- common/file_util.cpp 15 Nov 2004 12:29:53 -0000 1.10
|
||
|
+++ common/file_util.cpp 18 Sep 2006 17:42:41 -0000
|
||
|
@@ -30,6 +30,8 @@
|
||
|
# define ACCESS _access
|
||
|
# include <windows.h>
|
||
|
# include <winbase.h>
|
||
|
+# include <dirent.h>
|
||
|
+# include <asc_ctype.hpp>
|
||
|
|
||
|
#else
|
||
|
|
||
|
Index: common/gettext_init.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/gettext_init.cpp,v
|
||
|
retrieving revision 1.4
|
||
|
diff -u -B -b -r1.4 gettext_init.cpp
|
||
|
--- common/gettext_init.cpp 9 Nov 2004 08:20:24 -0000 1.4
|
||
|
+++ common/gettext_init.cpp 18 Sep 2006 17:42:41 -0000
|
||
|
@@ -16,7 +16,20 @@
|
||
|
if (did_init) return;
|
||
|
did_init = true;
|
||
|
}
|
||
|
+#ifdef WIN32PORT
|
||
|
+ // Registry key for Locale Path
|
||
|
+
|
||
|
+ aspell::String value;
|
||
|
+ HKEY hive;
|
||
|
+
|
||
|
+ hive = acommon::GetRegHive();
|
||
|
+ value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
|
||
|
+ if (value == "") value = LOCALEDIR;
|
||
|
+
|
||
|
+ bindtextdomain("aspell", value.c_str());
|
||
|
+#else
|
||
|
bindtextdomain("aspell", LOCALEDIR);
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
#else
|
||
|
Index: common/info.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/info.cpp,v
|
||
|
retrieving revision 1.34
|
||
|
diff -u -B -b -r1.34 info.cpp
|
||
|
--- common/info.cpp 10 Nov 2004 06:18:45 -0000 1.34
|
||
|
+++ common/info.cpp 18 Sep 2006 17:42:42 -0000
|
||
|
@@ -493,7 +493,17 @@
|
||
|
StringList & lst)
|
||
|
{
|
||
|
lst.clear();
|
||
|
- lst.add(config->retrieve("data-dir"));
|
||
|
+ String dictpath;
|
||
|
+
|
||
|
+#ifdef WIN32PORT
|
||
|
+ HKEY hive = acommon::GetRegHive();
|
||
|
+ // Registry key for dictionary path
|
||
|
+ dictpath =acommon::ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
|
||
|
+ if (dictpath == "") dictpath = config->retrieve("data-dir");
|
||
|
+#else
|
||
|
+ dictpath = config->retrieve("data-dir");
|
||
|
+#endif
|
||
|
+ lst.add(dictpath);
|
||
|
lst.add(config->retrieve("dict-dir"));
|
||
|
}
|
||
|
|
||
|
Index: common/objstack.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/objstack.cpp,v
|
||
|
retrieving revision 1.5
|
||
|
diff -u -B -b -r1.5 objstack.cpp
|
||
|
--- common/objstack.cpp 29 Jun 2004 00:18:16 -0000 1.5
|
||
|
+++ common/objstack.cpp 18 Sep 2006 17:42:42 -0000
|
||
|
@@ -1,6 +1,7 @@
|
||
|
|
||
|
#include "objstack.hpp"
|
||
|
|
||
|
+namespace std {}
|
||
|
namespace acommon {
|
||
|
|
||
|
using namespace std;
|
||
|
Index: common/posib_err.cpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/posib_err.cpp,v
|
||
|
retrieving revision 1.16
|
||
|
diff -u -B -b -r1.16 posib_err.cpp
|
||
|
--- common/posib_err.cpp 21 Nov 2004 02:52:22 -0000 1.16
|
||
|
+++ common/posib_err.cpp 18 Sep 2006 17:42:42 -0000
|
||
|
@@ -4,6 +4,7 @@
|
||
|
// license along with this library if you did not you can find
|
||
|
// it at http://www.gnu.org/.
|
||
|
|
||
|
+#include <settings.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <assert.h>
|
||
|
Index: common/vector.hpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/common/vector.hpp,v
|
||
|
retrieving revision 1.12
|
||
|
diff -u -B -b -r1.12 vector.hpp
|
||
|
--- common/vector.hpp 21 Jun 2004 02:40:07 -0000 1.12
|
||
|
+++ common/vector.hpp 18 Sep 2006 17:42:42 -0000
|
||
|
@@ -36,13 +36,13 @@
|
||
|
}
|
||
|
T * data() {return &*this->begin();}
|
||
|
T * data(int pos) {return &*this->begin() + pos;}
|
||
|
- T * data_end() {return &*this->end();}
|
||
|
+ T * data_end() {return &this->back()+1;}
|
||
|
|
||
|
T * pbegin() {return &*this->begin();}
|
||
|
- T * pend() {return &*this->end();}
|
||
|
+ T * pend() {return &this->back()+1;}
|
||
|
|
||
|
const T * pbegin() const {return &*this->begin();}
|
||
|
- const T * pend() const {return &*this->end();}
|
||
|
+ const T * pend() const {return &this->back()+1;}
|
||
|
|
||
|
template <typename U>
|
||
|
U * datap() {
|
||
|
Index: modules/speller/default/affix.hpp
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/modules/speller/default/affix.hpp,v
|
||
|
retrieving revision 1.19
|
||
|
diff -u -B -b -r1.19 affix.hpp
|
||
|
--- modules/speller/default/affix.hpp 29 Nov 2004 17:50:06 -0000 1.19
|
||
|
+++ modules/speller/default/affix.hpp 18 Sep 2006 17:42:42 -0000
|
||
|
@@ -109,7 +109,7 @@
|
||
|
}
|
||
|
WordAff * expand_suffix(ParmString word, const unsigned char * new_aff,
|
||
|
ObjStack &, int limit = INT_MAX,
|
||
|
- unsigned char * new_aff = 0, WordAff * * * l = 0,
|
||
|
+ unsigned char * new_aff2 = 0, WordAff * * * l = 0,
|
||
|
ParmString orig_word = 0) const;
|
||
|
|
||
|
private:
|
||
|
Index: win32/settings.h
|
||
|
===================================================================
|
||
|
RCS file: /sources/aspell/aspell/win32/settings.h,v
|
||
|
retrieving revision 1.2
|
||
|
diff -u -B -b -r1.2 settings.h
|
||
|
--- win32/settings.h 3 Jan 2004 12:06:25 -0000 1.2
|
||
|
+++ win32/settings.h 18 Sep 2006 17:42:43 -0000
|
||
|
@@ -1,44 +1,43 @@
|
||
|
-/* common/settings.h. Generated by configure. */
|
||
|
/* common/settings.h.in. Generated from configure.ac by autoheader. */
|
||
|
|
||
|
/* Defined if no special Workarounds are needed for Curses headers */
|
||
|
-/* #undef CURSES_INCLUDE_STANDARD */
|
||
|
+#undef CURSES_INCLUDE_STANDARD
|
||
|
|
||
|
/* Defined if special Wordaround I is need for Curses headers */
|
||
|
-/* #undef CURSES_INCLUDE_WORKAROUND_1 */
|
||
|
+#undef CURSES_INCLUDE_WORKAROUND_1
|
||
|
|
||
|
/* Defined if curses like POSIX Functions should be used */
|
||
|
-/* #undef CURSES_ONLY */
|
||
|
+#undef CURSES_ONLY
|
||
|
|
||
|
/* Defined if win32 relocation should be used */
|
||
|
-/* #undef ENABLE_WIN32_RELOCATABLE */
|
||
|
+#define ENABLE_WIN32_RELOCATABLE 1
|
||
|
|
||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||
|
-/* #undef HAVE_DLFCN_H */
|
||
|
+#undef HAVE_DLFCN_H
|
||
|
|
||
|
/* Defined if msdos getch is supported */
|
||
|
-/* #undef HAVE_GETCH */
|
||
|
+#undef HAVE_GETCH
|
||
|
|
||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||
|
-#define HAVE_INTTYPES_H 1
|
||
|
+#undef HAVE_INTTYPES_H
|
||
|
|
||
|
/* Defined if the curses library is available */
|
||
|
-/* #undef HAVE_LIBCURSES */
|
||
|
+#undef HAVE_LIBCURSES
|
||
|
|
||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||
|
#define HAVE_MEMORY_H 1
|
||
|
|
||
|
/* Defined if mmap and friends is supported */
|
||
|
-/* #undef HAVE_MMAP */
|
||
|
+#undef HAVE_MMAP
|
||
|
|
||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||
|
-#define HAVE_STDINT_H 1
|
||
|
+#undef HAVE_STDINT_H
|
||
|
|
||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||
|
#define HAVE_STDLIB_H 1
|
||
|
|
||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||
|
-#define HAVE_STRINGS_H 1
|
||
|
+#undef HAVE_STRINGS_H
|
||
|
|
||
|
/* Define to 1 if you have the <string.h> header file. */
|
||
|
#define HAVE_STRING_H 1
|
||
|
@@ -50,43 +49,73 @@
|
||
|
#define HAVE_SYS_TYPES_H 1
|
||
|
|
||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||
|
-#define HAVE_UNISTD_H 1
|
||
|
+#undef HAVE_UNISTD_H
|
||
|
|
||
|
/* Name of package */
|
||
|
-#define PACKAGE "aspell"
|
||
|
+#undef PACKAGE
|
||
|
|
||
|
/* Define to the address where bug reports for this package should be sent. */
|
||
|
-#define PACKAGE_BUGREPORT ""
|
||
|
+#undef PACKAGE_BUGREPORT
|
||
|
|
||
|
/* Define to the full name of this package. */
|
||
|
-#define PACKAGE_NAME ""
|
||
|
+#undef PACKAGE_NAME
|
||
|
|
||
|
/* Define to the full name and version of this package. */
|
||
|
-#define PACKAGE_STRING ""
|
||
|
+#undef PACKAGE_STRING
|
||
|
|
||
|
/* Define to the one symbol short name of this package. */
|
||
|
-#define PACKAGE_TARNAME ""
|
||
|
+#undef PACKAGE_TARNAME
|
||
|
|
||
|
/* Define to the version of this package. */
|
||
|
-#define PACKAGE_VERSION ""
|
||
|
+#undef PACKAGE_VERSION
|
||
|
|
||
|
/* Defined if Posix Termios is Supported */
|
||
|
-/* #undef POSIX_TERMIOS */
|
||
|
+#undef POSIX_TERMIOS
|
||
|
|
||
|
/* Defined if STL rel_ops polute the global namespace */
|
||
|
-/* #undef REL_OPS_POLLUTION */
|
||
|
+#undef REL_OPS_POLLUTION
|
||
|
|
||
|
/* Define to 1 if you have the ANSI C header files. */
|
||
|
-#define STDC_HEADERS 1
|
||
|
+#undef STDC_HEADERS
|
||
|
|
||
|
/* Defined if file ino is supported */
|
||
|
-/* #undef USE_FILE_INO */
|
||
|
+#undef USE_FILE_INO
|
||
|
|
||
|
/* Defined if file locking and truncating is supported */
|
||
|
-/* #undef USE_FILE_LOCKS */
|
||
|
+#undef USE_FILE_LOCKS
|
||
|
|
||
|
/* Defined if Posix locales are supported */
|
||
|
-/* #undef USE_LOCALE */
|
||
|
+#undef USE_LOCALE
|
||
|
|
||
|
/* Version number of package */
|
||
|
-#define VERSION "0.50.3"
|
||
|
+#define VERSION "0.50.4.1"
|
||
|
+
|
||
|
+#define PACKAGE_VERSION "aspell-6.0"
|
||
|
+
|
||
|
+#define C_EXPORT extern "C"
|
||
|
+
|
||
|
+#if defined(ASPELL_NO_EXPORTS)
|
||
|
+# define ASPELL_API
|
||
|
+#elif defined(_WINDLL) || defined(_USRDLL) || defined(__DLL__)
|
||
|
+# define ASPELL_API __declspec(dllexport)
|
||
|
+#else
|
||
|
+# define ASPELL_API __declspec(dllimport)
|
||
|
+#endif /*_DLL */
|
||
|
+
|
||
|
+// Microsoft VC6.0 does not allow typename except when directly
|
||
|
+// declaring a template param. The other supporte compilers (Borlands
|
||
|
+// BCB5.5 and GNU C++) require or allow it anywhere in the template
|
||
|
+// decl. The macro TYPENAME is defines to whatever works.
|
||
|
+#if defined(_MSC_VER) && (_MSC_VER<1300)
|
||
|
+#define TYPENAME
|
||
|
+#else
|
||
|
+#define TYPENAME typename
|
||
|
+#endif
|
||
|
+
|
||
|
+// Microsoft Visual C 6.0 stdio.h does not declare snprintf, rather
|
||
|
+// it declares _snprintf. We define snprintf for VC builds here.
|
||
|
+// snprintf is not standard, but it is common.
|
||
|
+#ifdef _MSC_VER
|
||
|
+#define snprintf _snprintf
|
||
|
+#define vsnprintf _vsnprintf
|
||
|
+#endif
|