summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelemojicomplete.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-10 17:16:14 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-10 17:16:14 -0400
commitdca6f0deae49d133f180ef937939b8648649fbc6 (patch)
tree22a8d38915a22346504708e112c5fa18af68bf87 /indra/newview/llpanelemojicomplete.cpp
parent9f38f25b93be2566399fac2d528da9810edd2fa6 (diff)
Fix risky signature of `wchar_to_utf8chars()`. Add `ll_convert()` alias.
`wchar_to_utf8chars()` used to require a `char*` output buffer with no length, assuming that its caller knew enough to provide a buffer of sufficient length. In fact a `char[8]` buffer suffices, but nothing in the header indicated that. Eliminate the output parameter and return `std::string`. Fix the few existing callers. Also set an `ll_convert_alias` so that `ll_convert_to<std::string>(llwchar)` directly calls `wchar_to_utf8chars()`. Replace instances of the workaround `wstring_to_utf8str(LLWString(1, llwchar))`.
Diffstat (limited to 'indra/newview/llpanelemojicomplete.cpp')
-rw-r--r--indra/newview/llpanelemojicomplete.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/indra/newview/llpanelemojicomplete.cpp b/indra/newview/llpanelemojicomplete.cpp
index cb89a5910e..7f72677e34 100644
--- a/indra/newview/llpanelemojicomplete.cpp
+++ b/indra/newview/llpanelemojicomplete.cpp
@@ -280,8 +280,7 @@ void LLPanelEmojiComplete::onCommit()
{
if (mCurSelected < mTotalEmojis)
{
- LLSD value(wstring_to_utf8str(LLWString(1, mEmojis[mCurSelected].Character)));
- setValue(value);
+ setValue(ll_convert_to<std::string>(mEmojis[mCurSelected].Character));
LLUICtrl::onCommit();
}
}