diff options
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
| -rw-r--r-- | indra/llui/lltexteditor.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 12ad339886..0184878e45 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -967,17 +967,6 @@ void LLTextEditor::endSelection() mIsSelecting = FALSE; mSelectionEnd = mCursorPos; } - if (mParseHTML && mHTML.length() > 0) - { - //Special handling for slurls - if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) - { - if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); - - //load_url(url.c_str()); - } - mHTML=""; - } } BOOL LLTextEditor::selectionContainsLineBreaks() @@ -1408,6 +1397,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) if( hasMouseCapture() ) { gFocusMgr.setMouseCapture( NULL ); + handled = TRUE; } @@ -3814,6 +3804,22 @@ void LLTextEditor::findEmbeddedItemSegments() BOOL LLTextEditor::handleMouseUpOverSegment(S32 x, S32 y, MASK mask) { + if ( hasMouseCapture() ) + { + // This mouse up was part of a click. + // Regardless of where the cursor is, see if we recently touched a link + // and launch it if we did. + if (mParseHTML && mHTML.length() > 0) + { + //Special handling for slurls + if ( (mSecondlifeURLcallback!=NULL) && !(*mSecondlifeURLcallback)(mHTML) ) + { + if (mURLcallback!=NULL) (*mURLcallback)(mHTML.c_str()); + } + mHTML=""; + } + } + return FALSE; } @@ -4245,6 +4251,12 @@ BOOL LLTextEditor::findHTML(const LLString &line, S32 *begin, S32 *end) strpos = url.find(slurlID); } + if (strpos < 0) + { + slurlID="sl://"; + strpos = url.find(slurlID); + } + if (strpos >= 0) { strpos+=slurlID.length(); |
