Skip to content
Snippets Groups Projects
Commit 84581e77 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Optimize out spellcheck overhead

parent 2bfada29
No related branches found
No related tags found
No related merge requests found
......@@ -593,7 +593,7 @@ void LLLineEditor::addToDictionary()
{
if (canAddToDictionary())
{
LLSpellChecker::instance().addToCustomDictionary(getMisspelledWord(mCursorPos));
LLSpellChecker::instanceFast().addToCustomDictionary(getMisspelledWord(mCursorPos));
}
}
......@@ -606,7 +606,7 @@ void LLLineEditor::addToIgnore()
{
if (canAddToIgnore())
{
LLSpellChecker::instance().addToIgnoreList(getMisspelledWord(mCursorPos));
LLSpellChecker::instanceFast().addToIgnoreList(getMisspelledWord(mCursorPos));
}
}
......@@ -2686,7 +2686,7 @@ void LLLineEditor::showContextMenu(S32 x, S32 y)
std::string misspelled_word = getMisspelledWord(mCursorPos);
if ((is_misspelled = !misspelled_word.empty()) == true)
{
LLSpellChecker::instance().getSuggestions(misspelled_word, mSuggestionList);
LLSpellChecker::instanceFast().getSuggestions(misspelled_word, mSuggestionList);
}
}
......
......@@ -402,7 +402,7 @@ const std::string LLSpellChecker::getDictionaryUserPath()
// static
bool LLSpellChecker::getUseSpellCheck()
{
return (LLSpellChecker::instanceExists()) && (LLSpellChecker::instance().mHunspell);
return LLSpellChecker::instanceFast().mHunspell;
}
bool LLSpellChecker::canRemoveDictionary(const std::string& dict_language)
......@@ -411,7 +411,7 @@ bool LLSpellChecker::canRemoveDictionary(const std::string& dict_language)
const LLSD dict_info = getDictionaryData(dict_language);
return
(dict_info["user_installed"].asBoolean()) &&
( (!getUseSpellCheck()) || (!LLSpellChecker::instance().isActiveDictionary(dict_language)) );
( (!getUseSpellCheck()) || (!isActiveDictionary(dict_language)) );
}
void LLSpellChecker::removeDictionary(const std::string& dict_language)
......@@ -481,8 +481,8 @@ boost::signals2::connection LLSpellChecker::setSettingsChangeCallback(const sett
void LLSpellChecker::setUseSpellCheck(const std::string& dict_language)
{
if ( (((dict_language.empty()) && (getUseSpellCheck())) || (!dict_language.empty())) &&
(LLSpellChecker::instance().mDictLanguage != dict_language) )
(LLSpellChecker::instanceFast().mDictLanguage != dict_language) )
{
LLSpellChecker::instance().initHunspell(dict_language);
LLSpellChecker::instanceFast().initHunspell(dict_language);
}
}
......@@ -1449,7 +1449,7 @@ void LLTextBase::deselect()
bool LLTextBase::getSpellCheck() const
{
return (LLSpellChecker::getUseSpellCheck()) && (!mReadOnly) && (mSpellCheck);
return (!mReadOnly) && (mSpellCheck) && (LLSpellChecker::getUseSpellCheck());
}
const std::string& LLTextBase::getSuggestion(U32 index) const
......@@ -1490,7 +1490,7 @@ void LLTextBase::addToDictionary()
{
if (canAddToDictionary())
{
LLSpellChecker::instance().addToCustomDictionary(getMisspelledWord(mCursorPos));
LLSpellChecker::instanceFast().addToCustomDictionary(getMisspelledWord(mCursorPos));
}
}
......@@ -1503,7 +1503,7 @@ void LLTextBase::addToIgnore()
{
if (canAddToIgnore())
{
LLSpellChecker::instance().addToIgnoreList(getMisspelledWord(mCursorPos));
LLSpellChecker::instanceFast().addToIgnoreList(getMisspelledWord(mCursorPos));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment