diff options
| author | Kitty Barnett <develop@catznip.com> | 2012-06-11 16:04:24 +0200 | 
|---|---|---|
| committer | Kitty Barnett <develop@catznip.com> | 2012-06-11 16:04:24 +0200 | 
| commit | 53bd3ada86faf8c470989c809c2baeb3a3e7770c (patch) | |
| tree | 7bb1fca7791ba812426d0ef8f6c40a9b3b618e2b /indra/llui | |
| parent | 80b1a2c0a8f7b4444dc1588ba5f71bbb69b40acd (diff) | |
STORM-276 Distinguish between default dictionaries and user-installed dictionaries
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llspellcheck.cpp | 13 | ||||
| -rw-r--r-- | indra/llui/llspellcheck.h | 1 | 
2 files changed, 12 insertions, 2 deletions
| diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 7e6d594249..8b3ca50c29 100644 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -106,6 +106,13 @@ const LLSD LLSpellChecker::getDictionaryData(const std::string& dict_language)  }  // static +bool LLSpellChecker::hasDictionary(const std::string& dict_language, bool check_installed) +{ +	const LLSD dict_info = getDictionaryData(dict_language); +	return dict_info.has("language") && ( (!check_installed) || (dict_info["installed"].asBoolean()) ); +} + +// static  void LLSpellChecker::setDictionaryData(const LLSD& dict_info)  {  	const std::string dict_language = dict_info["language"].asString(); @@ -150,9 +157,11 @@ void LLSpellChecker::refreshDictionaryMap()  	{  		LLSD custom_dict_map;  		LLSDSerialize::fromXMLDocument(custom_dict_map, custom_file); -		for (LLSD::array_const_iterator it = custom_dict_map.beginArray(); it != custom_dict_map.endArray(); ++it) +		for (LLSD::array_iterator it = custom_dict_map.beginArray(); it != custom_dict_map.endArray(); ++it)  		{ -			setDictionaryData(*it); +			LLSD& dict_info = *it; +			dict_info["user_installed"] = true; +			setDictionaryData(dict_info);  		}  		custom_file.close();  	} diff --git a/indra/llui/llspellcheck.h b/indra/llui/llspellcheck.h index acb121dd19..776565b20a 100644 --- a/indra/llui/llspellcheck.h +++ b/indra/llui/llspellcheck.h @@ -62,6 +62,7 @@ public:  	static const LLSD		 getDictionaryData(const std::string& dict_language);  	static const LLSD&		 getDictionaryMap() { return sDictMap; }  	static bool				 getUseSpellCheck(); +	static bool				 hasDictionary(const std::string& dict_language, bool check_installed = false);  	static void				 refreshDictionaryMap();  	static void				 setUseSpellCheck(const std::string& dict_name);  protected: | 
