From 44fe66766180729cc6ee864430a0cbecf2447543 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 12 Feb 2020 12:45:56 +0200 Subject: [PATCH] SL-12396 Triple clicking text in a textbox / textarea should only select the current line --- doc/contributions.txt | 2 ++ indra/llui/lltextbase.cpp | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index e11c61953f..eb3dbe1786 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1437,6 +1437,8 @@ Thickbrick Sleaford STORM-956 STORM-1147 STORM-1325 +Thoys Pan + SL-12396 Thraxis Epsilon SVC-371 VWR-383 diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5f0cda9741..a17170b3a0 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1092,7 +1092,37 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) // handle triple click if (!mTripleClickTimer.hasExpired()) { - selectAll(); + S32 real_line = getLineNumFromDocIndex(mCursorPos, false); + S32 line_start = -1; + S32 line_end = -1; + for (line_list_t::const_iterator it = mLineInfoList.begin(), end_it = mLineInfoList.end(); + it != end_it; + ++it) + { + if (it->mLineNum < real_line) + { + continue; + } + if (it->mLineNum > real_line) + { + break; + } + if (line_start == -1) + { + line_start = it->mDocIndexStart; + } + line_end = it->mDocIndexEnd; + } + + if (line_start == -1) + { + return TRUE; + } + + mSelectionEnd = line_start; + mSelectionStart = line_end; + setCursorPos(line_start); + return TRUE; }