diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2025-10-02 20:05:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-02 20:05:35 -0400 |
| commit | 0b7bc35131ce4a526c1e696904c4e8332e1b0fe9 (patch) | |
| tree | 6410603aa44e66f726aebe030ecfa31d37db1f68 /indra/llui/lltextbase.cpp | |
| parent | f25c2a56c0c8079163e9ef18f6a9e590341b1e1a (diff) | |
| parent | 18c84a9d6ad2381836a0c8263a8e9cb800b6c28e (diff) | |
Merge pull request #4779 from secondlife/geenz/lua_editor-2025.07
Merge 2025.07 into lua editor
Diffstat (limited to 'indra/llui/lltextbase.cpp')
| -rw-r--r-- | indra/llui/lltextbase.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7007049e1c..3fe0df1848 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1069,6 +1069,14 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s S32 LLTextBase::removeStringNoUndo(S32 pos, S32 length) { + S32 text_length = (S32)getLength(); + if (pos >= text_length || pos < 0) + { + return 0; // nothing to remove + } + // Clamp length to not go past the end of the text + length = std::min(length, text_length - pos); + beforeValueChange(); segment_set_t::iterator seg_iter = getSegIterContaining(pos); while(seg_iter != mSegments.end()) @@ -2227,6 +2235,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.RemoveFriend", boost::bind(&LLUrlAction::removeFriend, url)); registrar.add("Url.ReportAbuse", boost::bind(&LLUrlAction::reportAbuse, url)); registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url)); + registrar.add("Url.ZoomInObject", boost::bind(&LLUrlAction::zoomInObject, url)); registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.ShowParcelOnMap", boost::bind(&LLUrlAction::showParcelOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); @@ -3756,7 +3765,7 @@ bool LLNormalTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& w { height = 0; width = 0; - if (num_chars > 0) + if (num_chars > 0 && (mStart + first_char >= 0)) { height = mFontHeight; const LLWString &text = getWText(); |
