mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Core, ide: speller fixes
git-svn-id: svn://ultimatepp.org/upp/trunk@12721 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9f8a72495b
commit
b578f7b847
2 changed files with 15 additions and 16 deletions
|
|
@ -146,15 +146,13 @@ Speller *sGetSpeller(int lang)
|
|||
int q = speller.Find(lang);
|
||||
if(q < 0) {
|
||||
String pp = spell_path;
|
||||
DoSpellerPath(pp, GetExeDirFile("scd"));
|
||||
DoSpellerPath(pp, ConfigFile("scd"));
|
||||
DoSpellerPath(pp, GetExeDirFile("speller"));
|
||||
DoSpellerPath(pp, ConfigFile("speller"));
|
||||
pp << spell_path << ';' << getenv("LIB") << ';' << getenv("PATH") << ';';
|
||||
#ifdef PLATFORM_POSIX
|
||||
pp << "/usr/share/upp;/usr/local/share/upp;/usr/share/upp/scd;/usr/local/share/upp/scd";
|
||||
pp << "/usr/local/share/upp/speller;/usr/local/share/upp;/usr/share/upp/speller;/usr/share/upp";
|
||||
#endif
|
||||
String path = GetFileOnPath(ToLower(LNGAsText(lang)) + ".udc", pp);
|
||||
if(IsNull(path))
|
||||
path = GetFileOnPath(ToLower(LNGAsText(lang)) + ".scd", pp);
|
||||
if(IsNull(path))
|
||||
return NULL;
|
||||
FileIn in(path);
|
||||
|
|
@ -173,7 +171,7 @@ Speller *sGetSpeller(int lang)
|
|||
else {
|
||||
f.path = path;
|
||||
int n = in.Get32();
|
||||
LLOG("Found scd file " << path << " blocks " << n);
|
||||
LLOG("Found dictionary file " << path << " blocks " << n);
|
||||
if(n > 0 && n < 100000) {
|
||||
for(int i = 0; i < n; i++) {
|
||||
SpellBlock& b = f.block.Add();
|
||||
|
|
@ -430,4 +428,4 @@ Vector<String> SpellerFindCloseWords(int lang, const String& w, int n)
|
|||
return r;
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue