mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Set svn:eol-style
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36400 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
bc05bc2c59
commit
6105773453
@ -13,60 +13,60 @@ diff -riwbBuN -Xex aspell-0.60.4/common/aspell_win.cpp aspell-0.60.4-modified/co
|
|||||||
--- aspell-0.60.4/common/aspell_win.cpp Thu Jan 1 01:00:00 1970
|
--- aspell-0.60.4/common/aspell_win.cpp Thu Jan 1 01:00:00 1970
|
||||||
+++ aspell-0.60.4-modified/common/aspell_win.cpp Fri Jun 16 01:19:04 2006
|
+++ aspell-0.60.4-modified/common/aspell_win.cpp Fri Jun 16 01:19:04 2006
|
||||||
@@ -0,0 +1,54 @@
|
@@ -0,0 +1,54 @@
|
||||||
+#ifdef _WIN32
|
+#ifdef _WIN32
|
||||||
+
|
+
|
||||||
+#include <windows.h>
|
+#include <windows.h>
|
||||||
+#include "string.hpp"
|
+#include "string.hpp"
|
||||||
+
|
+
|
||||||
+namespace acommon {
|
+namespace acommon {
|
||||||
+
|
+
|
||||||
+ String ReadRegString(HKEY hive, String key, String name)
|
+ String ReadRegString(HKEY hive, String key, String name)
|
||||||
+ {
|
+ {
|
||||||
+
|
+
|
||||||
+ // Reads a string from the Windows registry (used to get paths)
|
+ // Reads a string from the Windows registry (used to get paths)
|
||||||
+
|
+
|
||||||
+ HKEY hKey;
|
+ HKEY hKey;
|
||||||
+ unsigned long lType;
|
+ unsigned long lType;
|
||||||
+ DWORD dwSize;
|
+ DWORD dwSize;
|
||||||
+ unsigned char* szValue = NULL;
|
+ unsigned char* szValue = NULL;
|
||||||
+
|
+
|
||||||
+ if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
+ if (::RegOpenKeyEx(hive, key.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||||
+ {
|
+ {
|
||||||
+ if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
|
+ if(::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS)
|
||||||
+ {
|
+ {
|
||||||
+ szValue = new unsigned char[dwSize + 1];
|
+ szValue = new unsigned char[dwSize + 1];
|
||||||
+ ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
|
+ ::RegQueryValueEx(hKey, name.c_str(), NULL, &lType, szValue, &dwSize);
|
||||||
+ String RegistryReturn((char*)szValue);
|
+ String RegistryReturn((char*)szValue);
|
||||||
+ delete[] szValue;
|
+ delete[] szValue;
|
||||||
+ return RegistryReturn;
|
+ return RegistryReturn;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return "";
|
+ return "";
|
||||||
+ }
|
+ }
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return "";
|
+ return "";
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ HKEY GetRegHive()
|
+ HKEY GetRegHive()
|
||||||
+ {
|
+ {
|
||||||
+
|
+
|
||||||
+ // Check whether Aspell is installed for the current user or for all users
|
+ // Check whether Aspell is installed for the current user or for all users
|
||||||
+
|
+
|
||||||
+ String value;
|
+ String value;
|
||||||
+
|
+
|
||||||
+ if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
|
+ if (ReadRegString(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Dictionary Path") == "")
|
||||||
+ {
|
+ {
|
||||||
+ return HKEY_CURRENT_USER;
|
+ return HKEY_CURRENT_USER;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ return HKEY_LOCAL_MACHINE;
|
+ return HKEY_LOCAL_MACHINE;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#endif
|
+#endif
|
||||||
diff -riwbBuN -Xex aspell-0.60.4/common/aspell_win.hpp aspell-0.60.4-modified/common/aspell_win.hpp
|
diff -riwbBuN -Xex aspell-0.60.4/common/aspell_win.hpp aspell-0.60.4-modified/common/aspell_win.hpp
|
||||||
--- aspell-0.60.4/common/aspell_win.hpp Thu Jan 1 01:00:00 1970
|
--- aspell-0.60.4/common/aspell_win.hpp Thu Jan 1 01:00:00 1970
|
||||||
+++ aspell-0.60.4-modified/common/aspell_win.hpp Thu Jun 15 15:33:58 2006
|
+++ aspell-0.60.4-modified/common/aspell_win.hpp Thu Jun 15 15:33:58 2006
|
||||||
@ -96,7 +96,7 @@ diff -riwbBuN -Xex aspell-0.60.4/common/config.cpp aspell-0.60.4-modified/common
|
|||||||
#include "string_list.hpp"
|
#include "string_list.hpp"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
#include "iostream.hpp"
|
#include "iostream.hpp"
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ diff -riwbBuN -Xex aspell-0.60.4/common/convert.cpp aspell-0.60.4-modified/commo
|
|||||||
#include "iostream.hpp"
|
#include "iostream.hpp"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
namespace acommon {
|
namespace acommon {
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ diff -riwbBuN -Xex aspell-0.60.4/common/file_util.cpp aspell-0.60.4-modified/com
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
+# include "asc_ctype.hpp"
|
+# include "asc_ctype.hpp"
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
# define ACCESS _access
|
# define ACCESS _access
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
@ -126,16 +126,16 @@ diff -riwbBuN -Xex aspell-0.60.4/common/gettext_init.cpp aspell-0.60.4-modified/
|
|||||||
--- aspell-0.60.4/common/gettext_init.cpp Tue Nov 9 09:20:24 2004
|
--- aspell-0.60.4/common/gettext_init.cpp Tue Nov 9 09:20:24 2004
|
||||||
+++ aspell-0.60.4-modified/common/gettext_init.cpp Thu Jun 15 15:31:02 2006
|
+++ aspell-0.60.4-modified/common/gettext_init.cpp Thu Jun 15 15:31:02 2006
|
||||||
@@ -1,5 +1,13 @@
|
@@ -1,5 +1,13 @@
|
||||||
+#include "settings.h"
|
+#include "settings.h"
|
||||||
+#include "string.hpp"
|
+#include "string.hpp"
|
||||||
+
|
+
|
||||||
+#ifdef _WIN32
|
+#ifdef _WIN32
|
||||||
+ #include <windows.h>
|
+ #include <windows.h>
|
||||||
+ #include "aspell_win.hpp"
|
+ #include "aspell_win.hpp"
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
#if ENABLE_NLS
|
#if ENABLE_NLS
|
||||||
|
|
||||||
@ -148,21 +148,21 @@ diff -riwbBuN -Xex aspell-0.60.4/common/gettext_init.cpp aspell-0.60.4-modified/
|
|||||||
if (did_init) return;
|
if (did_init) return;
|
||||||
did_init = true;
|
did_init = true;
|
||||||
- }
|
- }
|
||||||
+
|
+
|
||||||
+#ifdef _WIN32
|
+#ifdef _WIN32
|
||||||
+ // Registry key for Locale Path
|
+ // Registry key for Locale Path
|
||||||
+
|
+
|
||||||
+ acommon::String value;
|
+ acommon::String value;
|
||||||
+ HKEY hive;
|
+ HKEY hive;
|
||||||
+
|
+
|
||||||
+ hive = acommon::GetRegHive();
|
+ hive = acommon::GetRegHive();
|
||||||
+ value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
|
+ value = acommon::ReadRegString(hive, "Software\\Aspell", "Locale Path");
|
||||||
+ if (value == "") value = LOCALEDIR;
|
+ if (value == "") value = LOCALEDIR;
|
||||||
+
|
+
|
||||||
+ bindtextdomain("aspell", value.c_str());
|
+ bindtextdomain("aspell", value.c_str());
|
||||||
+#else
|
+#else
|
||||||
bindtextdomain("aspell", LOCALEDIR);
|
bindtextdomain("aspell", LOCALEDIR);
|
||||||
+#endif
|
+#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -173,11 +173,11 @@ diff -riwbBuN -Xex aspell-0.60.4/common/info.cpp aspell-0.60.4-modified/common/i
|
|||||||
/* BSDi defines u_intXX_t types in machine/types.h */
|
/* BSDi defines u_intXX_t types in machine/types.h */
|
||||||
#include <machine/types.h>
|
#include <machine/types.h>
|
||||||
#endif
|
#endif
|
||||||
+
|
+
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <winbase.h>
|
# include <winbase.h>
|
||||||
+#include "aspell_win.hpp"
|
+#include "aspell_win.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "iostream.hpp"
|
#include "iostream.hpp"
|
||||||
@ -185,7 +185,7 @@ diff -riwbBuN -Xex aspell-0.60.4/common/info.cpp aspell-0.60.4-modified/common/i
|
|||||||
#include "string_map.hpp"
|
#include "string_map.hpp"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
namespace acommon {
|
namespace acommon {
|
||||||
|
|
||||||
@ -193,23 +193,23 @@ diff -riwbBuN -Xex aspell-0.60.4/common/info.cpp aspell-0.60.4-modified/common/i
|
|||||||
void get_data_dirs (Config * config,
|
void get_data_dirs (Config * config,
|
||||||
StringList & lst)
|
StringList & lst)
|
||||||
{
|
{
|
||||||
+ String dictpath;
|
+ String dictpath;
|
||||||
+ HKEY hive;
|
+ HKEY hive;
|
||||||
+
|
+
|
||||||
lst.clear();
|
lst.clear();
|
||||||
- lst.add(config->retrieve("data-dir"));
|
- lst.add(config->retrieve("data-dir"));
|
||||||
+
|
+
|
||||||
+ hive = GetRegHive();
|
+ hive = GetRegHive();
|
||||||
+
|
+
|
||||||
+#ifdef _WIN32
|
+#ifdef _WIN32
|
||||||
+ // Registry key for dictionary path
|
+ // Registry key for dictionary path
|
||||||
+ dictpath = ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
|
+ dictpath = ReadRegString(hive, "Software\\Aspell", "Dictionary Path");;
|
||||||
+ if (dictpath == "") dictpath = config->retrieve("data-dir");
|
+ if (dictpath == "") dictpath = config->retrieve("data-dir");
|
||||||
+#else
|
+#else
|
||||||
+ dictpath = config->retrieve("data-dir");
|
+ dictpath = config->retrieve("data-dir");
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
+ lst.add(dictpath);
|
+ lst.add(dictpath);
|
||||||
lst.add(config->retrieve("dict-dir"));
|
lst.add(config->retrieve("dict-dir"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ diff -riwbBuN -Xex aspell-0.60.4/common/posib_err.cpp aspell-0.60.4-modified/com
|
|||||||
#include "posib_err.hpp"
|
#include "posib_err.hpp"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
|
|
||||||
namespace acommon {
|
namespace acommon {
|
||||||
@ -232,11 +232,11 @@ diff -riwbBuN -Xex aspell-0.60.4/modules/speller/default/language.cpp aspell-0.6
|
|||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
-# include <langinfo.h>
|
-# include <langinfo.h>
|
||||||
+//#include <langinfo.h>
|
+//#include <langinfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
namespace aspeller {
|
namespace aspeller {
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ diff -riwbBuN -Xex aspell-0.60.4/prog/aspell.cpp aspell-0.60.4-modified/prog/asp
|
|||||||
#include "hash_fun.hpp"
|
#include "hash_fun.hpp"
|
||||||
|
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
+#undef printf
|
+#undef printf
|
||||||
|
|
||||||
using namespace acommon;
|
using namespace acommon;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user