summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rwxr-xr-xindra/llui/lltexteditor.cpp75
1 files changed, 11 insertions, 64 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 494666df8a..b18c545f30 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -792,7 +792,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask)
setCursorAtLocalPos( clamped_x, clamped_y, true );
mSelectionEnd = mCursorPos;
}
- LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
+ lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
getWindow()->setCursor(UI_CURSOR_IBEAM);
handled = TRUE;
}
@@ -2511,53 +2511,6 @@ BOOL LLTextEditor::tryToRevertToPristineState()
return isPristine(); // TRUE => success
}
-
-static LLTrace::BlockTimerStatHandle 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)
-{
- LL_RECORD_BLOCK_TIME(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);
-
- 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);
- }
- }
-}
-
-void LLTextEditor::updateSegments()
-{
- if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
- {
- LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
- // HACK: No non-ascii keywords for now
- segment_vec_t segment_list;
- mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
-
- clearSegments();
- for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
- {
- insertSegment(*list_it);
- }
- }
-
- LLTextBase::updateSegments();
-}
-
void LLTextEditor::updateLinkSegments()
{
LLWString wtext = getWText();
@@ -2614,20 +2567,20 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Linden text version %d", &version) )
{
- LL_WARNS() << "Invalid Linden text file header " << LL_ENDL;
+ llwarns << "Invalid Linden text file header " << llendl;
return FALSE;
}
if( 1 != version )
{
- LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL;
+ llwarns << "Invalid Linden text file version: " << version << llendl;
return FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( 0 != sscanf(tbuf, "{") )
{
- LL_WARNS() << "Invalid Linden text file format" << LL_ENDL;
+ llwarns << "Invalid Linden text file format" << llendl;
return FALSE;
}
@@ -2635,13 +2588,13 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Text length %d", &text_len) )
{
- LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
+ llwarns << "Invalid Linden text length field" << llendl;
return FALSE;
}
if( text_len > mMaxTextByteLength )
{
- LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL;
+ llwarns << "Invalid Linden text length: " << text_len << llendl;
return FALSE;
}
@@ -2650,21 +2603,21 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
char* text = new char[ text_len + 1];
if (text == NULL)
{
- LL_ERRS() << "Memory allocation failure." << LL_ENDL;
+ llerrs << "Memory allocation failure." << llendl;
return FALSE;
}
instream.get(text, text_len + 1, '\0');
text[text_len] = '\0';
if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */
{
- LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */
+ llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */
success = FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( success && (0 != sscanf(tbuf, "}")) )
{
- LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL;
+ llwarns << "Invalid Linden text file format: missing terminal }" << llendl;
success = FALSE;
}
@@ -2727,7 +2680,7 @@ void LLTextEditor::resetPreedit()
{
if (hasPreeditString())
{
- LL_WARNS() << "Preedit and selection!" << LL_ENDL;
+ llwarns << "Preedit and selection!" << llendl;
deselect();
}
else
@@ -2737,12 +2690,6 @@ void LLTextEditor::resetPreedit()
}
if (hasPreeditString())
{
- if (hasSelection())
- {
- LL_WARNS() << "Preedit and selection!" << LL_ENDL;
- deselect();
- }
-
setCursorPos(mPreeditPositions.front());
removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos);
insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString);
@@ -2932,7 +2879,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
setCursorPos(position);
if (hasPreeditString())
{
- LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL;
+ llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl;
}
mPreeditWString = LLWString( getWText(), position, length );
if (length > 0)