summaryrefslogtreecommitdiff
path: root/indra/llui/llviewmodel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-09-04 13:42:11 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-09-05 06:55:53 +0300
commit238a2a64b31e6a0b431309e363067a7fe57125ae (patch)
tree99244c8e7cb542c9dc37f551e7aaf15720f5c478 /indra/llui/llviewmodel.cpp
parent49abe2c8bc23e306d304d02704e2b883648baea6 (diff)
viewer#2411 Use font buffer in text segments
Diffstat (limited to 'indra/llui/llviewmodel.cpp')
-rw-r--r--indra/llui/llviewmodel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp
index 93106b344f..35963c2b99 100644
--- a/indra/llui/llviewmodel.cpp
+++ b/indra/llui/llviewmodel.cpp
@@ -82,11 +82,20 @@ void LLTextViewModel::setValue(const LLSD& value)
// approximate LLSD storage usage
LLViewModel::setValue(value);
mDisplay = utf8str_to_wstring(mStringValue = value.asString());
+ mDisplayGeneration++;
// mDisplay and mValue agree
mUpdateFromDisplay = false;
}
+LLWString& LLTextViewModel::getEditableDisplay()
+{
+ mDirty = true;
+ mDisplayGeneration++;
+ mUpdateFromDisplay = true;
+ return mDisplay;
+}
+
void LLTextViewModel::setDisplay(const LLWString& value)
{
// This is the strange way to alter the value. Normally we'd setValue()
@@ -94,6 +103,7 @@ void LLTextViewModel::setDisplay(const LLWString& value)
// value. But a text editor might want to edit the display string
// directly, then convert back to UTF8 on commit.
mDisplay = value;
+ mDisplayGeneration++;
mDirty = true;
// Don't immediately convert to UTF8 -- do it lazily -- we expect many
// more setDisplay() calls than getValue() calls. Just flag that it needs