From 9204681c31184c4c76c8f41c48da76e174e3276a Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 18 Dec 2009 16:21:57 -0800 Subject: Fix slurl crashing, fix slurls highlighting objects, fix overlapping objects not "unhighlighting" --- indra/newview/llpanellogin.cpp | 2 ++ indra/newview/llviewerwindow.cpp | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cdfa64ba57..ce83ab3e37 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -688,6 +688,8 @@ void LLPanelLogin::refreshLocation( bool force_visible ) // static void LLPanelLogin::updateLocationUI() { + if (!sInstance) return; + std::string sim_string = LLURLSimString::sInstance.mSimString; if (!sim_string.empty()) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 08f598b288..71fe8dd773 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -839,12 +839,15 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); // special case SLURLs - if ( drop && std::string::npos != data.find("slurl.com") ) + if (std::string::npos != data.find("slurl.com") ) { - LLURLDispatcher::dispatch( data, NULL, true ); - LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); - LLPanelLogin::refreshLocation( true ); - LLPanelLogin::updateLocationUI(); + if (drop) + { + LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLPanelLogin::refreshLocation( true ); + LLPanelLogin::updateLocationUI(); + } return LLWindowCallbacks::DND_MOVE; }; @@ -908,10 +911,13 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi } else { - mDragHoveredObject = obj; - // Highlight the dragged object - LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); - + if ( obj != mDragHoveredObject) + { + // Highlight the dragged object + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = obj; + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + } result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } } -- cgit v1.2.3