Skip to content

Commit c27faac

Browse files
committed
Address review feedback for PR #330
1 parent a8483f5 commit c27faac

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

indra/llui/llspellcheck.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,15 @@ void LLSpellChecker::refreshDictionaryMap()
297297

298298
void LLSpellChecker::addToCustomDictionary(const std::string& word)
299299
{
300-
addToDictFile(getDictionaryUserPath() + DICT_FILE_CUSTOM, word);
301300
std::string word_lower(word);
302301
LLStringUtil::toLower(word_lower);
303-
mAcceptedWords.insert(word_lower);
304-
sSettingsChangeSignal();
302+
if (!mAcceptedWords.contains(word_lower))
303+
{
304+
addToDictFile(getDictionaryUserPath() + DICT_FILE_CUSTOM, word);
305+
306+
mAcceptedWords.insert(word_lower);
307+
sSettingsChangeSignal();
308+
}
305309
}
306310

307311
void LLSpellChecker::addToIgnoreList(const std::string& word)

indra/llui/llspellcheckengine_hunspell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace
9797
const std::string user_path = LLSpellChecker::getDictionaryUserPath();
9898
for (const std::string& name : candidate_names)
9999
{
100-
if ( (gDirUtilp->fileExists(user_path + name + ".dic")) || (gDirUtilp->fileExists(app_path + name + ".dic")) )
100+
if ( (gDirUtilp->fileExists(user_path + name + ".dic") && gDirUtilp->fileExists(user_path + name + ".aff")) || (gDirUtilp->fileExists(app_path + name + ".dic") && gDirUtilp->fileExists(app_path + name + ".aff")) )
101101
{
102102
installed.insert(name);
103103
}

indra/llui/llspellcheckengine_win32.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ namespace
7272

7373
LLWinSpellEngine::LLWinSpellEngine()
7474
{
75+
llassert(on_main_thread());
76+
7577
// The Windows Spell Checking API is COM-based and the viewer keeps no standing COM apartment
7678
// on the main thread, so own one for this engine's lifetime. Apartment-threaded (STA) matches
7779
// every existing scoped COM site and is reference-counted, so it nests safely.
@@ -87,6 +89,8 @@ namespace
8789

8890
LLWinSpellEngine::~LLWinSpellEngine()
8991
{
92+
llassert(on_main_thread());
93+
9094
// Release COM interfaces before tearing down the apartment.
9195
if (mChecker)
9296
{

0 commit comments

Comments
 (0)