Adding clear methods to remove any highlighting.

master
Ima Mechanique 2014-02-06 16:47:27 +00:00
parent 01b7ae8abe
commit 00a99d9097
4 changed files with 21 additions and 2 deletions

View File

@ -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)

View File

@ -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; }

View File

@ -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)

View File

@ -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; }