1 Index: common/config.cpp
2 ===================================================================
3 RCS file: /sources/aspell/aspell/common/config.cpp,v
4 retrieving revision 1.78
5 diff -u -b -B -p -r1.78 config.cpp
6 --- common/config.cpp 21 Oct 2005 12:16:03 -0000 1.78
7 +++ common/config.cpp 30 Aug 2006 22:05:30 -0000
8 @@ -1581,3 +1581,61 @@ namespace aspell {
16 +#include "string.hpp"
18 +using namespace aspell;
21 + String ReadRegString(HKEY hive, String key, String name)
24 + // Reads a string from the Windows registry (used to get paths)
27 + unsigned long lType;
29 + unsigned char* szValue = NULL;
31 + if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
33 + if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
35 + szValue = new unsigned char[dwSize + 1];
36 + ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
37 + String RegistryReturn((char*)szValue);
39 + return RegistryReturn;
52 + // Check whether Aspell is installed for the current user or for all users
56 + if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
58 + return HKEY_CURRENT_USER;
60 + return HKEY_LOCAL_MACHINE;
70 Index: common/config.hpp
71 ===================================================================
72 RCS file: /sources/aspell/aspell/common/config.hpp,v
73 retrieving revision 1.27
74 diff -u -b -B -p -r1.27 config.hpp
75 --- common/config.hpp 3 May 2005 05:08:19 -0000 1.27
76 +++ common/config.hpp 30 Aug 2006 22:05:30 -0000
77 @@ -277,5 +277,21 @@ namespace aspell {
91 + extern HKEY GetRegHive();
92 + extern aspell::String ReadRegString(HKEY type, aspell::String key, aspell::String name);
99 Index: common/gettext_init.cpp
100 ===================================================================
101 RCS file: /sources/aspell/aspell/common/gettext_init.cpp,v
102 retrieving revision 1.5
103 diff -u -b -B -p -r1.5 gettext_init.cpp
104 --- common/gettext_init.cpp 3 May 2005 05:08:19 -0000 1.5
105 +++ common/gettext_init.cpp 30 Aug 2006 22:05:30 -0000
106 @@ -16,7 +15,21 @@ extern "C" void aspell_gettext_init()
107 if (did_init) return;
111 + // Registry key for Locale Path
113 + aspell::String value;
116 + hive = acommon::GetRegHive();
117 + value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
118 + if (value == "") value = LOCALEDIR;
120 + bindtextdomain("aspell", value.c_str());
122 bindtextdomain("aspell", LOCALEDIR);
128 Index: common/info.cpp
129 ===================================================================
130 RCS file: /sources/aspell/aspell/common/info.cpp,v
131 retrieving revision 1.39
132 diff -u -b -B -p -r1.39 info.cpp
133 --- common/info.cpp 3 May 2005 05:08:19 -0000 1.39
134 +++ common/info.cpp 30 Aug 2006 22:05:30 -0000
136 /* BSDi defines u_intXX_t types in machine/types.h */
137 #include <machine/types.h>
139 -#if defined(WIN32) || defined(_WIN32)
140 -#include "minwin.h" //minimum windows declarations.
143 #include "iostream.hpp"
145 @@ -574,7 +571,17 @@ namespace aspell {
149 - lst.add(config->retrieve("data-dir"));
153 + HKEY hive = acommon::GetRegHive();
154 + // Registry key for dictionary path
155 + dictpath =acommon::ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
156 + if (dictpath == "") dictpath = config->retrieve("data-dir");
158 + dictpath = config->retrieve("data-dir");
161 lst.add(config->retrieve("dict-dir"));
164 Index: common/vector.hpp
165 ===================================================================
166 RCS file: /sources/aspell/aspell/common/vector.hpp,v
167 retrieving revision 1.15
168 diff -u -b -B -p -r1.15 vector.hpp
169 --- common/vector.hpp 3 May 2005 05:08:19 -0000 1.15
170 +++ common/vector.hpp 30 Aug 2006 22:05:30 -0000
171 @@ -47,13 +47,13 @@ namespace aspell
173 T * data() {return &*this->begin();}
174 T * data(int pos) {return &*this->begin() + pos;}
175 - T * data_end() {return &*this->end();}
176 + T * data_end() {return &this->back()+1;}
178 T * pbegin() {return &*this->begin();}
179 - T * pend() {return &*this->end();}
180 + T * pend() {return &this->back()+1;}
182 const T * pbegin() const {return &*this->begin();}
183 - const T * pend() const {return &*this->end();}
184 + const T * pend() const {return &this->back()+1;}
186 template <typename U>
188 Index: win32/settings.h
189 ===================================================================
190 RCS file: /sources/aspell/aspell/win32/settings.h,v
191 retrieving revision 1.5
192 diff -u -b -B -p -r1.5 settings.h
193 --- win32/settings.h 15 Feb 2005 08:52:58 -0000 1.5
194 +++ win32/settings.h 30 Aug 2006 22:05:30 -0000
196 // declaring a template param. The other supporte compilers (Borlands
197 // BCB5.5 and GNU C++) require or allow it anywhere in the template
198 // decl. The macro TYPENAME is defines to whatever works.
200 +#if defined(_MSC_VER) && (_MSC_VER<1300)
203 #define TYPENAME typename