diff options
author | Kadah_Coba <kadah.coba@gmail.com> | 2019-10-14 20:44:51 -0700 |
---|---|---|
committer | Kadah_Coba <kadah.coba@gmail.com> | 2019-10-14 20:44:51 -0700 |
commit | add146291737c6b9b4d773b3a910c9506b4939b3 (patch) | |
tree | f43e349d7790ed7633eca114e886afbeca9bebc8 /indra/llui/lltexteditor.cpp | |
parent | 1e1707d532560583744bb877adfed11864f2db31 (diff) | |
parent | 379b480f0e9d6947f0da8f15dbcb7e7010f0509a (diff) |
Merged in andreyl_productengine/486-copypaste
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r-- | indra/llui/lltexteditor.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 134b76c720..137167db2a 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -732,14 +732,30 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) { setFocus(TRUE); } + + bool show_menu = false; + // Prefer editor menu if it has selection. See EXT-6806. - if (hasSelection() || !LLTextBase::handleRightMouseDown(x, y, mask)) + if (hasSelection()) { - if(getShowContextMenu()) + S32 click_pos = getDocIndexFromLocalCoord(x, y, FALSE); + if (click_pos > mSelectionStart && click_pos < mSelectionEnd) { - showContextMenu(x, y); + show_menu = true; } } + + // Let segments handle the click, if nothing does, show editor menu + if (!show_menu && !LLTextBase::handleRightMouseDown(x, y, mask)) + { + show_menu = true; + } + + if (show_menu && getShowContextMenu()) + { + showContextMenu(x, y); + } + return TRUE; } |