summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorIma Mechanique <ima.mechanique@secondlife.com>2014-02-06 16:47:27 +0000
committerIma Mechanique <ima.mechanique@secondlife.com>2014-02-06 16:47:27 +0000
commit00a99d9097131c02c6486112b32e57f534bf61be (patch)
tree3e94b2ce6d97db3727b6d8eaeb06a576039294cb /indra
parent01b7ae8abe7efc101202fea786e97862c44e1d21 (diff)
Adding clear methods to remove any highlighting.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llkeywords.cpp11
-rwxr-xr-xindra/llui/llkeywords.h1
-rwxr-xr-xindra/llui/lltexteditor.cpp8
-rwxr-xr-xindra/llui/lltexteditor.h3
4 files changed, 21 insertions, 2 deletions
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index fd4ef33f59..c5e8f76a73 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -128,6 +128,16 @@ void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type,
}
}
+void LLKeywords::clear()
+{
+ clearLoaded();
+ mSyntax = LLSD();
+
+ std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer());
+ std::for_each(mLineTokenList.begin(), mLineTokenList.end(), DeletePointer());
+ std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer());
+}
+
std::string LLKeywords::getArguments(LLSD& arguments)
{
std::string argString = "";
@@ -326,7 +336,6 @@ void LLKeywords::processTokensGroup(LLSD& Tokens, const std::string Group)
{
Color = ColorGroup;
mAttributes.clear();
- bool deprecated = false;
LLSD arguments = LLSD ();
LLSD::map_iterator innerIt = outerIt->second.beginMap();
for ( ; innerIt != outerIt->second.endMap(); ++innerIt)
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 689fd75bcd..de7645a5d2 100755
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -110,6 +110,7 @@ public:
~LLKeywords();
void addColorGroup(const std::string key_in, const LLColor4 color);
+ void clear();
void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(const std::string key_in);
bool isLoaded() const { return mLoaded; }
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 303bc48933..e11636682e 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2529,6 +2529,14 @@ void LLTextEditor::loadKeywords()
}
}
+void LLTextEditor::clearSegments()
+{
+ if (!mSegments.empty())
+ {
+ mSegments.clear();
+ }
+}
+
void LLTextEditor::updateSegments()
{
if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index d7f6c7f643..698153587f 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -207,7 +207,8 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLTextSegmentPtr getPreviousSegment() const;
- void getSelectedSegments(segment_vec_t& segments) const;
+ void getSelectedSegments(segment_vec_t& segments) const;
+ void clearSegments();
void setShowContextMenu(bool show) { mShowContextMenu = show; }
bool getShowContextMenu() const { return mShowContextMenu; }