summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rw-r--r--indra/newview/llviewertexteditor.cpp79
1 files changed, 32 insertions, 47 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 1fd31a013a..728509e39c 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -894,51 +894,9 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
{
- BOOL handled = FALSE;
-
- // let scrollbar have first dibs
- handled = LLView::childrenHandleMouseUp(x, y, mask) != NULL;
-
- // Used to enable I Agree checkbox if the user scrolled through entire text
- BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax());
- if (mOnScrollEndCallback && was_scrolled_to_bottom)
- {
- mOnScrollEndCallback(mOnScrollEndData);
- }
-
- if( !handled && mTakesNonScrollClicks)
- {
- if( mIsSelecting )
- {
- // Finish selection
- if( y > getTextRect().mTop )
- {
- mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 );
- }
- else
- if( y < getTextRect().mBottom )
- {
- mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 );
- }
-
- setCursorAtLocalPos( x, y, TRUE );
- endSelection();
-
- updateScrollFromCursor();
- }
-
- if( !hasSelection() )
- {
- handleMouseUpOverSegment( x, y, mask );
- }
-
- handled = TRUE;
- }
-
- // Delay cursor flashing
- resetKeystrokeTimer();
+ BOOL handled = FALSE;
- if( hasMouseCapture() )
+ if( hasMouseCapture() )
{
if (mDragItem)
{
@@ -957,8 +915,15 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
}
}
mDragItem = NULL;
- gFocusMgr.setMouseCapture( NULL );
- handled = TRUE;
+ }
+
+ handled = LLTextEditor::handleMouseUp(x,y,mask);
+
+ // Used to enable I Agree checkbox if the user scrolled through entire text
+ BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax());
+ if (mOnScrollEndCallback && was_scrolled_to_bottom)
+ {
+ mOnScrollEndCallback(mOnScrollEndData);
}
return handled;
@@ -1000,6 +965,24 @@ BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
return handled;
}
+BOOL LLViewerTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = FALSE;
+ handled = childrenHandleMiddleMouseDown(x, y, mask) != NULL;
+ if (!handled)
+ {
+ handled = LLTextEditor::handleMiddleMouseDown(x, y, mask);
+ }
+ return handled;
+}
+
+BOOL LLViewerTextEditor::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = childrenHandleMiddleMouseUp(x, y, mask) != NULL;
+
+ return handled;
+}
+
BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
@@ -1022,7 +1005,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
}
}
}
-
setCursorAtLocalPos( x, y, FALSE );
deselect();
@@ -1060,6 +1042,9 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
// delay cursor flashing
resetKeystrokeTimer();
+ // take selection to 'primary' clipboard
+ updatePrimary();
+
handled = TRUE;
}
return handled;