From b9f0eb54ce1a95adb0286302e977936ef8ed91d7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 12 Feb 2020 12:45:56 +0200 Subject: SL-12396 Triple clicking text in a textbox / textarea should only select the current line --- indra/llui/lltextbase.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e64078828b..75eb274603 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1015,7 +1015,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; } -- cgit v1.2.3 From 0828d7375af44aa270635f374c993959ae3e2a28 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 8 May 2020 11:54:58 +0300 Subject: SL-12396 FIXED Last line can't be removed if it was selected via triple-clicking --- indra/llui/lltextbase.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index b48a32a622..30bf938591 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1037,6 +1037,7 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) line_start = it->mDocIndexStart; } line_end = it->mDocIndexEnd; + line_end = llclamp(line_end, 0, getLength()); } if (line_start == -1) -- cgit v1.2.3