summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2014-12-19 23:20:47 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2014-12-19 23:20:47 +0200
commit027899963cb8443e7880b4d4aa6c429d16db488b (patch)
treec57a93342fbe6f8e032198e85478705976f3f986 /indra/newview/llpreviewscript.cpp
parente21f8284fdd9cd86e2822b233775e9a3d77917d5 (diff)
parent4ec9bce3c2a715f53938e4568c95b7a2bdfc9e16 (diff)
merge with 3.7.23-release
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rwxr-xr-xindra/newview/llpreviewscript.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 17f250c3ad..5c2f13a903 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -735,12 +735,13 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
LLTextSegmentPtr segment = NULL;
std::vector<LLTextSegmentPtr> selected_segments;
mEditor->getSelectedSegments(selected_segments);
-
+ LLKeywordToken* token;
// try segments in selection range first
std::vector<LLTextSegmentPtr>::iterator segment_iter;
for (segment_iter = selected_segments.begin(); segment_iter != selected_segments.end(); ++segment_iter)
{
- if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::TT_WORD)
+ token = (*segment_iter)->getToken();
+ if(token && isKeyword(token))
{
segment = *segment_iter;
break;
@@ -751,7 +752,8 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
if (!segment)
{
const LLTextSegmentPtr test_segment = mEditor->getPreviousSegment();
- if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::TT_WORD)
+ token = test_segment->getToken();
+ if(token && isKeyword(token))
{
segment = test_segment;
}
@@ -780,6 +782,24 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
}
}
+bool LLScriptEdCore::isKeyword(LLKeywordToken* token)
+{
+ switch(token->getType())
+ {
+ case LLKeywordToken::TT_CONSTANT:
+ case LLKeywordToken::TT_CONTROL:
+ case LLKeywordToken::TT_EVENT:
+ case LLKeywordToken::TT_FUNCTION:
+ case LLKeywordToken::TT_SECTION:
+ case LLKeywordToken::TT_TYPE:
+ case LLKeywordToken::TT_WORD:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
void LLScriptEdCore::setHelpPage(const std::string& help_string)
{
LLFloater* help_floater = mLiveHelpHandle.get();