aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/lltexteditor.cpp')
-rw-r--r--linden/indra/llui/lltexteditor.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index cf35ee7..b101588 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -323,6 +323,7 @@ LLTextEditor::LLTextEditor(
323 mLastSelectionY(-1), 323 mLastSelectionY(-1),
324 mReflowNeeded(FALSE), 324 mReflowNeeded(FALSE),
325 mScrollNeeded(FALSE), 325 mScrollNeeded(FALSE),
326 mSpellCheckable(FALSE),
326 mShowMisspellings(FALSE) 327 mShowMisspellings(FALSE)
327{ 328{
328 mSourceID.generate(); 329 mSourceID.generate();
@@ -375,6 +376,13 @@ LLTextEditor::LLTextEditor(
375 376
376 mParseHTML=FALSE; 377 mParseHTML=FALSE;
377 mHTML.clear(); 378 mHTML.clear();
379
380 // in other words, highlighting requires a restart
381 if (glggHunSpell->getSpellCheckHighlight())
382 {
383 mShowMisspellings = TRUE;
384 }
385
378 // make the popup menu available 386 // make the popup menu available
379 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view); 387 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view);
380 LLMenuGL* menu = new LLMenuGL("wot"); 388 LLMenuGL* menu = new LLMenuGL("wot");
@@ -490,11 +498,11 @@ void LLTextEditor::spell_show(void * data)
490 { 498 {
491 if (tempBind->word == "Show Misspellings") 499 if (tempBind->word == "Show Misspellings")
492 { 500 {
493 line->setShowMisspellings(TRUE); 501 glggHunSpell->setSpellCheckHighlight(TRUE);
494 } 502 }
495 else 503 else
496 { 504 {
497 line->setShowMisspellings(FALSE); 505 glggHunSpell->setSpellCheckHighlight(FALSE);
498 } 506 }
499 } 507 }
500} 508}
@@ -1454,7 +1462,7 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1454 menu->setItemVisible("Transep", !mReadOnly); 1462 menu->setItemVisible("Transep", !mReadOnly);
1455 1463
1456 // spell_check="true" in xui 1464 // spell_check="true" in xui
1457 if (!mReadOnly && mShowMisspellings) 1465 if (!mReadOnly && mSpellCheckable)
1458 { 1466 {
1459 const LLWString &text = mWText; 1467 const LLWString &text = mWText;
1460 1468
@@ -1509,7 +1517,7 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1509 1517
1510 SpellMenuBind * tempStruct = new SpellMenuBind; 1518 SpellMenuBind * tempStruct = new SpellMenuBind;
1511 tempStruct->origin = this; 1519 tempStruct->origin = this;
1512 if (glggHunSpell->getSpellCheckHighlight()) 1520 if (mShowMisspellings)
1513 { 1521 {
1514 tempStruct->word = "Hide Misspellings"; 1522 tempStruct->word = "Hide Misspellings";
1515 } 1523 }
@@ -3131,7 +3139,7 @@ void LLTextEditor::autoCorrectText()
3131 3139
3132void LLTextEditor::drawMisspelled() 3140void LLTextEditor::drawMisspelled()
3133{ 3141{
3134 if (!mReadOnly && mShowMisspellings) 3142 if (!mReadOnly && mSpellCheckable)
3135 { 3143 {
3136 if( 3144 if(
3137 ( ((getLength()<400)||(false)) &&( (S32(mSpellTimer.getElapsedTimeF32() / 1) & 1) )) 3145 ( ((getLength()<400)||(false)) &&( (S32(mSpellTimer.getElapsedTimeF32() / 1) & 1) ))
@@ -3154,7 +3162,7 @@ void LLTextEditor::drawMisspelled()
3154 } 3162 }
3155 } 3163 }
3156 //draw 3164 //draw
3157 if (glggHunSpell->getSpellCheckHighlight()) 3165 if (mShowMisspellings)
3158 { 3166 {
3159 for (int i = 0; i<(int)misspellLocations.size() ;i++) 3167 for (int i = 0; i<(int)misspellLocations.size() ;i++)
3160 { 3168 {
@@ -4891,7 +4899,7 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node)
4891 4899
4892 node->getAttributeBOOL("track_bottom", mTrackBottom); 4900 node->getAttributeBOOL("track_bottom", mTrackBottom);
4893 4901
4894 node->getAttributeBOOL("spell_check", mShowMisspellings); 4902 node->getAttributeBOOL("spell_check", mSpellCheckable);
4895 4903
4896 LLColor4 color; 4904 LLColor4 color;
4897 if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) 4905 if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color))