summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
authorMartin Reddy <lynx@lindenlab.com>2009-09-23 13:57:06 +0000
committerMartin Reddy <lynx@lindenlab.com>2009-09-23 13:57:06 +0000
commit47abd559082f6023dcdfadd2ec740195b1d07990 (patch)
tree244c81063dd56a8095a8fc137d89ad87c0e024c5 /indra/llui/lltexteditor.cpp
parent658849ee953da606035efba20a6e599ea7e9eb0f (diff)
EXT-944 EXT-1026: reverting my previous fix for these crashes.
This didn't work on Windows because wchar_t is 2 bytes on that platform, not 4 bytes (whereas llwchar is 4 bytes everywhere). Boost's regex methods need to work on wchar_t, but I believe that using a UTF-16 string would still be prone to crashing on Windows as UTF-16 is still a variable-length encoding. Besides, trying to compile a UTF-16 solution generates weird link errors. Instead, I'm going to fix this problem a different way. And I'm starting by reverting the previous attempt. Thanks Win32.
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index f7680a0a2b..983777b747 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -3525,7 +3525,7 @@ void LLTextEditor::appendStyledText(const std::string &new_text,
S32 start=0,end=0;
LLUrlMatch match;
- LLWString text = utf8str_to_wstring(new_text);
+ std::string text = new_text;
while ( LLUrlRegistry::instance().findUrl(text, match,
boost::bind(&LLTextEditor::onUrlLabelUpdated, this, _1, _2)) )
{
@@ -3549,8 +3549,8 @@ void LLTextEditor::appendStyledText(const std::string &new_text,
{
part = (S32)LLTextParser::MIDDLE;
}
- std::string subtext = wstring_to_utf8str(text.substr(0,start));
- appendHighlightedText(subtext, allow_undo, prepend_newline, part, style_params);
+ std::string subtext=text.substr(0,start);
+ appendHighlightedText(subtext,allow_undo, prepend_newline, part, style_params);
prepend_newline = false;
}
@@ -3595,8 +3595,7 @@ void LLTextEditor::appendStyledText(const std::string &new_text,
}
}
if (part != (S32)LLTextParser::WHOLE) part=(S32)LLTextParser::END;
- if (end < (S32)text.length()) appendHighlightedText(wstring_to_utf8str(text), allow_undo,
- prepend_newline, part, style_params);
+ if (end < (S32)text.length()) appendHighlightedText(text,allow_undo, prepend_newline, part, style_params);
}
else
{
@@ -4138,7 +4137,7 @@ void LLTextEditor::updateLinkSegments()
LLUrlMatch match;
LLStyleSP style = static_cast<LLStyleSP>(segment->getStyle());
std::string url_label = getText().substr(segment->getStart(), segment->getEnd()-segment->getStart());
- if (LLUrlRegistry::instance().findUrl(utf8str_to_wstring(url_label), match))
+ if (LLUrlRegistry::instance().findUrl(url_label, match))
{
LLStringUtil::trim(url_label);
style->setLinkHREF(url_label);