diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-11-30 17:29:54 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2018-11-30 17:29:54 +0200 |
commit | d9983255569eb5c49e8a414b4b8e8f56f9d33533 (patch) | |
tree | 55001fc3fe558fa62a6c96603b0029402ee6f92a /indra/llui | |
parent | d9fdb948d9b7d7b873ec83c43332f97018573194 (diff) |
SL-10145 Right clicking on unselected link in editor near selected text shows wrong menu
Diffstat (limited to 'indra/llui')
-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; } |