Пример #1
0
// static
void LLSpellChecker::initClass()
{
	if (sDictMap.isUndefined())
	{
		refreshDictionaryMap();
	}
}
Пример #2
0
// static
void LLSpellChecker::removeDictionary(const std::string& dict_language)
{
	if (!canRemoveDictionary(dict_language))
	{
		return;
	}

	LLSD dict_map = loadUserDictionaryMap();
	for (LLSD::array_const_iterator it = dict_map.beginArray(); it != dict_map.endArray(); ++it)
	{
		const LLSD& dict_info = *it;
		if (dict_info["language"].asString() == dict_language)
		{
			const std::string dict_dic = getDictionaryUserPath() + dict_info["name"].asString() + ".dic";
			if (gDirUtilp->fileExists(dict_dic))
			{
				LLFile::remove(dict_dic);
			}
			const std::string dict_aff = getDictionaryUserPath() + dict_info["name"].asString() + ".aff";
			if (gDirUtilp->fileExists(dict_aff))
			{
				LLFile::remove(dict_aff);
			}
			dict_map.erase(it - dict_map.beginArray());
			break;
		}
	}
	saveUserDictionaryMap(dict_map);

	refreshDictionaryMap();
}
Пример #3
0
LLSpellChecker::LLSpellChecker()
	: mHunspell(NULL)
{
	// Load initial dictionary information
	refreshDictionaryMap();
}