summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2025-11-10 19:29:50 +0200
committerGitHub <noreply@github.com>2025-11-10 19:29:50 +0200
commit6b7c6b1f8e6e00341c11d5ef6dc8e46b98085bc1 (patch)
tree56af3668f9bbe72a396a351e8109e75eb40783ce /indra
parenta73bbcc64626ecc7ef6f7cc2ca1642fa50a18d6d (diff)
#4932 fix @mention being displayed twice if the name has a TM symbol
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp7
-rw-r--r--indra/llui/lltextbase.h9
2 files changed, 11 insertions, 5 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 44151a4355..2079ff17fc 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3477,7 +3477,6 @@ S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offs
void LLTextSegment::updateLayout(const LLTextBase& editor) {}
F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; }
bool LLTextSegment::canEdit() const { return false; }
-bool LLTextSegment::getPermitsEmoji() const { return true; }
void LLTextSegment::unlinkFromDocument(LLTextBase*) {}
void LLTextSegment::linkToDocument(LLTextBase*) {}
const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; }
@@ -3521,6 +3520,11 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e
{
mFontHeight = mStyle->getFont()->getLineHeight();
mCanEdit = !mStyle->getDrawHighlightBg();
+ if (!mCanEdit)
+ {
+ // Emoji shouldn't split the segment with the mention.
+ mPermitsEmoji = false;
+ }
LLUIImagePtr image = mStyle->getImage();
if (image.notNull())
@@ -4041,6 +4045,7 @@ LLInlineViewSegment::LLInlineViewSegment(const Params& p, S32 start, S32 end)
mTopPad(p.top_pad),
mBottomPad(p.bottom_pad)
{
+ mPermitsEmoji = false;
}
LLInlineViewSegment::~LLInlineViewSegment()
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index b248882aac..d32b8c2d0e 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -61,13 +61,15 @@ class LLTextSegment
public:
LLTextSegment(S32 start, S32 end)
: mStart(start),
- mEnd(end)
+ mEnd(end),
+ mPermitsEmoji(true)
{}
virtual ~LLTextSegment();
virtual LLTextSegmentPtr clone(LLTextBase& terget) const { return new LLTextSegment(mStart, mEnd); }
static LLStyleSP cloneStyle(LLTextBase& target, const LLStyle* source);
bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const;
+ bool getPermitsEmoji() const { return mPermitsEmoji; };
virtual bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;
virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const;
@@ -87,7 +89,6 @@ public:
virtual void updateLayout(const class LLTextBase& editor);
virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
virtual bool canEdit() const;
- virtual bool getPermitsEmoji() const;
virtual void unlinkFromDocument(class LLTextBase* editor);
virtual void linkToDocument(class LLTextBase* editor);
@@ -126,6 +127,8 @@ public:
protected:
S32 mStart;
S32 mEnd;
+
+ bool mPermitsEmoji;
};
class LLNormalTextSegment : public LLTextSegment
@@ -142,7 +145,6 @@ public:
/*virtual*/ void updateLayout(const class LLTextBase& editor);
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
/*virtual*/ bool canEdit() const { return mCanEdit; }
- /*virtual*/ bool getPermitsEmoji() const { return false; }
/*virtual*/ const LLUIColor& getColor() const { return mStyle->getColor(); }
/*virtual*/ LLStyleConstSP getStyle() const { return mStyle; }
/*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; }
@@ -257,7 +259,6 @@ public:
/*virtual*/ void updateLayout(const class LLTextBase& editor);
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
/*virtual*/ bool canEdit() const { return false; }
- /*virtual*/ bool getPermitsEmoji() const { return false; }
/*virtual*/ void unlinkFromDocument(class LLTextBase* editor);
/*virtual*/ void linkToDocument(class LLTextBase* editor);