aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-09-15 11:20:50 -0700
committerMcCabe Maxsted2010-09-15 11:20:50 -0700
commit465e1f011fa5b44b2873030e09fbf1631b069046 (patch)
treedb150b49510beba7b78b1db279473c58c18aa4ab
parentFixed up the spellcheck preferences labels to something more easily understan... (diff)
downloadmeta-impy-465e1f011fa5b44b2873030e09fbf1631b069046.zip
meta-impy-465e1f011fa5b44b2873030e09fbf1631b069046.tar.gz
meta-impy-465e1f011fa5b44b2873030e09fbf1631b069046.tar.bz2
meta-impy-465e1f011fa5b44b2873030e09fbf1631b069046.tar.xz
More spell checking cleanup
-rw-r--r--linden/indra/llui/lllineeditor.cpp6
-rw-r--r--linden/indra/llui/lltexteditor.cpp11
-rw-r--r--linden/indra/newview/lgghunspell_wrapper.cpp2
-rw-r--r--linden/indra/newview/lgghunspell_wrapper.h7
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)
548 548
549 if( tempBind && line) 549 if( tempBind && line)
550 { 550 {
551 if (tempBind->word=="Show Misspellings") 551 if (tempBind->word == "Show Misspellings")
552 { 552 {
553 line->setShowMisspellings(TRUE); 553 line->setShowMisspellings(TRUE);
554 } 554 }
@@ -813,7 +813,7 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
813 813
814 SpellMenuBind * tempStruct = new SpellMenuBind; 814 SpellMenuBind * tempStruct = new SpellMenuBind;
815 tempStruct->origin = this; 815 tempStruct->origin = this;
816 if (glggHunSpell->mSpellCheckHighlight) 816 if (glggHunSpell->getSpellCheckHighlight())
817 { 817 {
818 tempStruct->word = "Hide Misspellings"; 818 tempStruct->word = "Hide Misspellings";
819 } 819 }
@@ -1917,7 +1917,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
1917 } 1917 }
1918 } 1918 }
1919 1919
1920 if (glggHunSpell->mSpellCheckHighlight) 1920 if (glggHunSpell->getSpellCheckHighlight())
1921 { 1921 {
1922 for (int i =0; i<(int)misspellLocations.size(); i++) 1922 for (int i =0; i<(int)misspellLocations.size(); i++)
1923 { 1923 {
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)
486 SpellMenuBind* tempBind = (SpellMenuBind*)data; 486 SpellMenuBind* tempBind = (SpellMenuBind*)data;
487 LLTextEditor* line = tempBind->origin; 487 LLTextEditor* line = tempBind->origin;
488 488
489 if(tempBind && line) 489 if (tempBind && line)
490 { 490 {
491 if(tempBind->word=="Show Misspellings") 491 if (tempBind->word == "Show Misspellings")
492 { 492 {
493 line->setShowMisspellings(TRUE); 493 line->setShowMisspellings(TRUE);
494 }else 494 }
495 else
495 { 496 {
496 line->setShowMisspellings(FALSE); 497 line->setShowMisspellings(FALSE);
497 } 498 }
@@ -1508,7 +1509,7 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1508 1509
1509 SpellMenuBind * tempStruct = new SpellMenuBind; 1510 SpellMenuBind * tempStruct = new SpellMenuBind;
1510 tempStruct->origin = this; 1511 tempStruct->origin = this;
1511 if (glggHunSpell->mSpellCheckHighlight) 1512 if (glggHunSpell->getSpellCheckHighlight())
1512 { 1513 {
1513 tempStruct->word = "Hide Misspellings"; 1514 tempStruct->word = "Hide Misspellings";
1514 } 1515 }
@@ -3153,7 +3154,7 @@ void LLTextEditor::drawMisspelled()
3153 } 3154 }
3154 } 3155 }
3155 //draw 3156 //draw
3156 if (glggHunSpell->mSpellCheckHighlight) 3157 if (glggHunSpell->getSpellCheckHighlight())
3157 { 3158 {
3158 for (int i = 0; i<(int)misspellLocations.size() ;i++) 3159 for (int i = 0; i<(int)misspellLocations.size() ;i++)
3159 { 3160 {
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()
964 gViewerWindow->getWindow()->ShellEx(dicdicpath); 964 gViewerWindow->getWindow()->ShellEx(dicdicpath);
965} 965}
966 966
967void lggHunSpell_Wrapper::setNewHighlightSetting(BOOL highlight) 967void lggHunSpell_Wrapper::setSpellCheckHighlight(BOOL highlight)
968{ 968{
969 mSpellCheckHighlight = highlight; 969 mSpellCheckHighlight = highlight;
970} 970}
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
30public: 30public:
31 static Hunspell* myHunspell; 31 static Hunspell* myHunspell;
32 32
33 BOOL mSpellCheckHighlight;
34
35 static void initSettings(); 33 static void initSettings();
36 void processSettings(); 34 void processSettings();
37 35
@@ -49,7 +47,6 @@ public:
49 static std::string dictName2FullName(std::string dictName); 47 static std::string dictName2FullName(std::string dictName);
50 static std::string fullName2DictName(std::string fullName); 48 static std::string fullName2DictName(std::string fullName);
51 void setNewDictionary(std::string newDict); 49 void setNewDictionary(std::string newDict);
52 void setNewHighlightSetting(BOOL highlight);
53 BOOL isSpelledRight(std::string wordToCheck); 50 BOOL isSpelledRight(std::string wordToCheck);
54 std::vector<std::string> getSuggestionList(std::string badWord); 51 std::vector<std::string> getSuggestionList(std::string badWord);
55 S32 findNextError(std::string haystack, int startAt); 52 S32 findNextError(std::string haystack, int startAt);
@@ -57,6 +54,9 @@ public:
57 std::vector<std::string> CSV2VEC(std::string csv); 54 std::vector<std::string> CSV2VEC(std::string csv);
58 std::string VEC2CSV(std::vector<std::string> vec); 55 std::string VEC2CSV(std::vector<std::string> vec);
59 56
57 void setSpellCheckHighlight(BOOL highlight);
58 BOOL getSpellCheckHighlight() { return mSpellCheckHighlight; }
59
60private: 60private:
61 void createCustomDic(); 61 void createCustomDic();
62 std::string getCorrectPath(std::string file); 62 std::string getCorrectPath(std::string file);
@@ -67,6 +67,7 @@ private:
67 std::string currentBaseDic; 67 std::string currentBaseDic;
68 //std::vector<std::string> languageCodes; 68 //std::vector<std::string> languageCodes;
69 //std::vector<std::string> countryCodes; 69 //std::vector<std::string> countryCodes;
70 BOOL mSpellCheckHighlight;
70}; 71};
71 72
72extern lggHunSpell_Wrapper* glggHunSpell; // the singleton hunspell wrapper 73extern lggHunSpell_Wrapper* glggHunSpell; // the singleton hunspell wrapper