diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2020-02-12 12:45:56 +0200 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2020-02-12 12:45:56 +0200 |
commit | b9f0eb54ce1a95adb0286302e977936ef8ed91d7 (patch) | |
tree | 5d50a9c3793db1c9a72f31ef7c2c55253868b674 | |
parent | 51222605155a02320e7744d1235987b58264b25d (diff) |
SL-12396 Triple clicking text in a textbox / textarea should only select the current line
-rwxr-xr-x | doc/contributions.txt | 2 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index c6ad23dc2c..441374ec43 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1431,6 +1431,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 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; } |