From 465e1f011fa5b44b2873030e09fbf1631b069046 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 15 Sep 2010 11:20:50 -0700 Subject: More spell checking cleanup --- linden/indra/llui/lllineeditor.cpp | 6 +++--- linden/indra/llui/lltexteditor.cpp | 11 ++++++----- linden/indra/newview/lgghunspell_wrapper.cpp | 2 +- linden/indra/newview/lgghunspell_wrapper.h | 7 ++++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index e95af79..9c68fec 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -548,7 +548,7 @@ void LLLineEditor::spell_show(void * data) if( tempBind && line) { - if (tempBind->word=="Show Misspellings") + if (tempBind->word == "Show Misspellings") { line->setShowMisspellings(TRUE); } @@ -813,7 +813,7 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask ) SpellMenuBind * tempStruct = new SpellMenuBind; tempStruct->origin = this; - if (glggHunSpell->mSpellCheckHighlight) + if (glggHunSpell->getSpellCheckHighlight()) { tempStruct->word = "Hide Misspellings"; } @@ -1917,7 +1917,7 @@ void LLLineEditor::drawMisspelled(LLRect background) } } - if (glggHunSpell->mSpellCheckHighlight) + if (glggHunSpell->getSpellCheckHighlight()) { for (int i =0; i<(int)misspellLocations.size(); i++) { diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index d2469c3..cf35ee7 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -486,12 +486,13 @@ void LLTextEditor::spell_show(void * data) SpellMenuBind* tempBind = (SpellMenuBind*)data; LLTextEditor* line = tempBind->origin; - if(tempBind && line) + if (tempBind && line) { - if(tempBind->word=="Show Misspellings") + if (tempBind->word == "Show Misspellings") { line->setShowMisspellings(TRUE); - }else + } + else { line->setShowMisspellings(FALSE); } @@ -1508,7 +1509,7 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask ) SpellMenuBind * tempStruct = new SpellMenuBind; tempStruct->origin = this; - if (glggHunSpell->mSpellCheckHighlight) + if (glggHunSpell->getSpellCheckHighlight()) { tempStruct->word = "Hide Misspellings"; } @@ -3153,7 +3154,7 @@ void LLTextEditor::drawMisspelled() } } //draw - if (glggHunSpell->mSpellCheckHighlight) + if (glggHunSpell->getSpellCheckHighlight()) { for (int i = 0; i<(int)misspellLocations.size() ;i++) { diff --git a/linden/indra/newview/lgghunspell_wrapper.cpp b/linden/indra/newview/lgghunspell_wrapper.cpp index 632c117..f800043 100644 --- a/linden/indra/newview/lgghunspell_wrapper.cpp +++ b/linden/indra/newview/lgghunspell_wrapper.cpp @@ -964,7 +964,7 @@ void lggHunSpell_Wrapper::editCustomButton() gViewerWindow->getWindow()->ShellEx(dicdicpath); } -void lggHunSpell_Wrapper::setNewHighlightSetting(BOOL highlight) +void lggHunSpell_Wrapper::setSpellCheckHighlight(BOOL highlight) { mSpellCheckHighlight = highlight; } diff --git a/linden/indra/newview/lgghunspell_wrapper.h b/linden/indra/newview/lgghunspell_wrapper.h index 4d07ff8..b5f3ddb 100644 --- a/linden/indra/newview/lgghunspell_wrapper.h +++ b/linden/indra/newview/lgghunspell_wrapper.h @@ -30,8 +30,6 @@ class lggHunSpell_Wrapper public: static Hunspell* myHunspell; - BOOL mSpellCheckHighlight; - static void initSettings(); void processSettings(); @@ -49,7 +47,6 @@ public: static std::string dictName2FullName(std::string dictName); static std::string fullName2DictName(std::string fullName); void setNewDictionary(std::string newDict); - void setNewHighlightSetting(BOOL highlight); BOOL isSpelledRight(std::string wordToCheck); std::vector getSuggestionList(std::string badWord); S32 findNextError(std::string haystack, int startAt); @@ -57,6 +54,9 @@ public: std::vector CSV2VEC(std::string csv); std::string VEC2CSV(std::vector vec); + void setSpellCheckHighlight(BOOL highlight); + BOOL getSpellCheckHighlight() { return mSpellCheckHighlight; } + private: void createCustomDic(); std::string getCorrectPath(std::string file); @@ -67,6 +67,7 @@ private: std::string currentBaseDic; //std::vector languageCodes; //std::vector countryCodes; + BOOL mSpellCheckHighlight; }; extern lggHunSpell_Wrapper* glggHunSpell; // the singleton hunspell wrapper -- cgit v1.1