summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-11-18 13:51:24 -0500
committerOz Linden <oz@lindenlab.com>2013-11-18 13:51:24 -0500
commit7f39d0472e1f0d0e929d4af6b2dadf472173f022 (patch)
tree1dd9f6229d5fc78a011f528ec25aee33f339cb3b /indra/llui/lltexteditor.cpp
parentebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff)
parent6b451ffdd6b1c75bd363864e48fbcf9b045dbd67 (diff)
merge changes for STORM-1831
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rwxr-xr-xindra/llui/lltexteditor.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 62140dd9d6..303bc48933 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2513,29 +2513,19 @@ BOOL LLTextEditor::tryToRevertToPristineState()
static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
-void LLTextEditor::loadKeywords(const std::string& filename,
- const std::vector<std::string>& funcs,
- const std::vector<std::string>& tooltips,
- const LLColor3& color)
+void LLTextEditor::loadKeywords()
{
LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
- if(mKeywords.loadFromFile(filename))
- {
- S32 count = llmin(funcs.size(), tooltips.size());
- for(S32 i = 0; i < count; i++)
- {
- std::string name = utf8str_trim(funcs[i]);
- mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] );
- }
- segment_vec_t segment_list;
- mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+ mKeywords.processTokens();
- mSegments.clear();
- segment_set_t::iterator insert_it = mSegments.begin();
- for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
- {
- insert_it = mSegments.insert(insert_it, *list_it);
- }
+ segment_vec_t segment_list;
+ mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+
+ mSegments.clear();
+ segment_set_t::iterator insert_it = mSegments.begin();
+ for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+ {
+ insert_it = mSegments.insert(insert_it, *list_it);
}
}