aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llkeywords.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llkeywords.cpp')
-rw-r--r--linden/indra/llui/llkeywords.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/linden/indra/llui/llkeywords.cpp b/linden/indra/llui/llkeywords.cpp
index 3adde76..1d157d2 100644
--- a/linden/indra/llui/llkeywords.cpp
+++ b/linden/indra/llui/llkeywords.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -233,7 +233,7 @@ LLColor3 LLKeywords::readColor( const LLString& s )
233 233
234// Walk through a string, applying the rules specified by the keyword token list and 234// Walk through a string, applying the rules specified by the keyword token list and
235// create a list of color segments. 235// create a list of color segments.
236void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWString& wtext) 236void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor)
237{ 237{
238 std::for_each(seg_list->begin(), seg_list->end(), DeletePointer()); 238 std::for_each(seg_list->begin(), seg_list->end(), DeletePointer());
239 seg_list->clear(); 239 seg_list->clear();
@@ -245,7 +245,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
245 245
246 S32 text_len = wtext.size(); 246 S32 text_len = wtext.size();
247 247
248 seg_list->push_back( new LLTextSegment( LLColor3(0,0,0), 0, text_len ) ); 248 seg_list->push_back( new LLTextSegment( LLColor3(defaultColor), 0, text_len ) );
249 249
250 const llwchar* base = wtext.c_str(); 250 const llwchar* base = wtext.c_str();
251 const llwchar* cur = base; 251 const llwchar* cur = base;
@@ -299,7 +299,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
299 //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start) << "]" << llendl; 299 //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start) << "]" << llendl;
300 LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); 300 LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );
301 text_segment->setToken( cur_token ); 301 text_segment->setToken( cur_token );
302 insertSegment( seg_list, text_segment, text_len); 302 insertSegment( seg_list, text_segment, text_len, defaultColor);
303 line_done = TRUE; // to break out of second loop. 303 line_done = TRUE; // to break out of second loop.
304 break; 304 break;
305 } 305 }
@@ -409,7 +409,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
409 //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start ) << "]" << llendl; 409 //llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start ) << "]" << llendl;
410 LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end ); 410 LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end );
411 text_segment->setToken( cur_delimiter ); 411 text_segment->setToken( cur_delimiter );
412 insertSegment( seg_list, text_segment, text_len); 412 insertSegment( seg_list, text_segment, text_len, defaultColor);
413 413
414 // Note: we don't increment cur, since the end of one delimited seg may be immediately 414 // Note: we don't increment cur, since the end of one delimited seg may be immediately
415 // followed by the start of another one. 415 // followed by the start of another one.
@@ -442,7 +442,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
442 442
443 LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end ); 443 LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );
444 text_segment->setToken( cur_token ); 444 text_segment->setToken( cur_token );
445 insertSegment( seg_list, text_segment, text_len); 445 insertSegment( seg_list, text_segment, text_len, defaultColor);
446 } 446 }
447 cur += seg_len; 447 cur += seg_len;
448 continue; 448 continue;
@@ -457,7 +457,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS
457 } 457 }
458} 458}
459 459
460void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegment* new_segment, S32 text_len ) 460void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor )
461{ 461{
462 LLTextSegment* last = seg_list->back(); 462 LLTextSegment* last = seg_list->back();
463 S32 new_seg_end = new_segment->getEnd(); 463 S32 new_seg_end = new_segment->getEnd();
@@ -475,7 +475,7 @@ void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegm
475 475
476 if( new_seg_end < text_len ) 476 if( new_seg_end < text_len )
477 { 477 {
478 seg_list->push_back( new LLTextSegment( LLColor3(0,0,0), new_seg_end, text_len ) ); 478 seg_list->push_back( new LLTextSegment( defaultColor, new_seg_end, text_len ) );
479 } 479 }
480} 480}
481 481