From 6fb57fa78c8ac2a4e356345d8e18bd4487ea9e5e Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Thu, 9 Sep 2010 19:40:48 +0200 Subject: Code cleanup --- linden/indra/newview/llfloaterchat.cpp | 35 +--------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 4be20b5..1cf85de 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -459,41 +459,8 @@ BOOL LLFloaterChat::isOwnNameInText(const std::string &text_line) std::string pattern_s = "(^|.*[\\.\\?!:;\\*\\(\\s]+)(" + my_name + ")([,\\.\\?!:;\\*\\)\\s]+.*|$)"; boost::smatch what; boost::regex e1(pattern_s, boost::regex::icase); - return boost::regex_search(text_line, what, e1); - -/* - std::transform(my_name.begin(), my_name.end(), my_name.begin(), tolower); - - std::string lower_chat = std::string(text_line); - std::transform(lower_chat.begin(), lower_chat.end(), lower_chat.begin(), tolower); - std::string blank = " "; - - // yes yes, this sucks, will move to a nicer regexp as soon as i have time to make it lol - if (lower_chat.find(my_name + blank) == 0 || // at the beginning of the text - (lower_chat.find(my_name) == 0 && lower_chat.length() == my_name.length()) || // only my name in the text - lower_chat.find(blank + my_name + blank) != std::string::npos || // my name in the middle of the text - lower_chat.rfind(blank + my_name) == lower_chat.length() - (blank + my_name).length()) // my name at the end of the text - { - return TRUE; - } - - return FALSE; -*/ - -/* - regex_t compiled; - // ^.*([\.\?!:;\*\(\s]+)(elektra)([,\.\?!:;\*\)\s$]+).* <--- this works :) - std::string pre_pattern = "^.*([\\.\\?!:;\\*\\(\\s]+)("; - std::string post_pattern = ")([,\\.\\?!:;\\*\\)\\s$]+).*"; - std::string pattern_s = pre_pattern + my_name + post_pattern; - regcomp(&compiled, pattern_s.c_str(), REG_ICASE); - - if (regexec(&compiled, text_line.c_str(), 0, NULL, 0) == 0) - return TRUE; - - return FALSE; -*/ + return boost::regex_search(text_line, what, e1); } LLColor4 get_extended_text_color(const LLChat& chat, LLColor4 defaultColor) -- cgit v1.1