diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llfloatergodtools.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llfloaterworldmap.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 21 | ||||
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpreviewscript.cpp | 6 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llvoiceclient.cpp | 23 |
11 files changed, 86 insertions, 42 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index a94f0206a6..0492ab0f25 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -95,7 +95,7 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname) LLDockableFloater* instance = dynamic_cast<LLDockableFloater*> (LLFloaterReg::findInstance(name)); // if floater closed or docked - if (instance == NULL || instance != NULL && instance->isDocked()) + if (instance == NULL || (instance && instance->isDocked())) { LLFloaterReg::toggleInstance(name, key); // restore button toggle state diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 846b2843dd..5011b191f4 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -526,21 +526,30 @@ void LLAvatarListItem::updateChildren() LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) { LLView* child_view = mAvatarName; - if (child_view_index < 0 || ALIC_COUNT <= child_view_index) - { - LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; - return child_view; - } + switch (child_view_index) { - case ALIC_ICON: child_view = mAvatarIcon; break; - case ALIC_NAME: child_view = mAvatarName; break; - case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; - case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; - case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; - case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; + case ALIC_ICON: + child_view = mAvatarIcon; + break; + case ALIC_NAME: + child_view = mAvatarName; + break; + case ALIC_INTERACTION_TIME: + child_view = mLastInteractionTime; + break; + case ALIC_SPEAKER_INDICATOR: + child_view = mSpeakingIndicator; + break; + case ALIC_INFO_BUTTON: + child_view = mInfoBtn; + break; + case ALIC_PROFILE_BUTTON: + child_view = mProfileBtn; + break; default: LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + // leave child_view untouched } return child_view; diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 5294f09e64..eb56f387cd 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -213,6 +213,9 @@ void LLFloaterGodTools::showPanel(const std::string& panel_name) // static void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) { + llassert(msg); + if (!msg) return; + LLHost host = msg->getSender(); if (host != gAgent.getRegionHost()) { @@ -270,8 +273,7 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) if ( gAgent.isGodlike() && LLFloaterReg::instanceVisible("god_tools") && god_tools->mPanelRegionTools - && god_tools->mPanelObjectTools - && msg ) + && god_tools->mPanelObjectTools) { LLPanelRegionTools* rtool = god_tools->mPanelRegionTools; god_tools->mCurrentHost = host; diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index f4d4ea3553..b6de409611 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -788,8 +788,11 @@ void LLFloaterWorldMap::friendsChanged() if(avatar_id.notNull()) { LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo"); - if(!iface || !iface->setCurrentByID(avatar_id) || - !t.getBuddyInfo(avatar_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) || gAgent.isGodlike()) + const LLRelationship* buddy_info = t.getBuddyInfo(avatar_id); + if(!iface || + !iface->setCurrentByID(avatar_id) || + (buddy_info && !buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) || + gAgent.isGodlike()) { LLTracker::stopTracking(NULL); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ec2be0e8e9..5b59f52fa5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -293,12 +293,27 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* LLMessageSystem* msg = gMessageSystem; const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); LLViewerInventoryItem* item = NULL; - LLViewerInventoryCategory* cat = NULL; std::vector<LLUUID> move_ids; LLInventoryModel::update_map_t update; bool start_new_message = true; S32 count = batch.count(); S32 i; + + // first, hide any 'preview' floaters that correspond to the items + // being deleted. + for(i = 0; i < count; ++i) + { + bridge = (LLInvFVBridge*)(batch.get(i)); + if(!bridge || !bridge->isItemRemovable()) continue; + item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); + if(item) + { + LLPreview::hide(item->getUUID()); + } + } + + // do the inventory move to trash + for(i = 0; i < count; ++i) { bridge = (LLInvFVBridge*)(batch.get(i)); @@ -308,7 +323,6 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* { if(item->getParentUUID() == trash_id) continue; move_ids.push_back(item->getUUID()); - LLPreview::hide(item->getUUID()); --update[item->getParentUUID()]; ++update[trash_id]; if(start_new_message) @@ -340,11 +354,12 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* gInventory.accountForUpdate(update); update.clear(); } + for(i = 0; i < count; ++i) { bridge = (LLInvFVBridge*)(batch.get(i)); if(!bridge || !bridge->isItemRemovable()) continue; - cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); + LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); if(cat) { if(cat->getParentUUID() == trash_id) continue; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index f48c96190f..c66d067779 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -833,10 +833,13 @@ void LLLocationInputCtrl::refreshParcelIcons() mDamageText->setVisible(false); } - S32 left_pad, right_pad; - mTextEntry->getTextPadding(&left_pad, &right_pad); - right_pad = mTextEntry->getRect().mRight - x; - mTextEntry->setTextPadding(left_pad, right_pad); + if (mTextEntry) + { + S32 left_pad, right_pad; + mTextEntry->getTextPadding(&left_pad, &right_pad); + right_pad = mTextEntry->getRect().mRight - x; + mTextEntry->setTextPadding(left_pad, right_pad); + } } void LLLocationInputCtrl::refreshHealth() diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 1895993a8e..2d3401966b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1003,7 +1003,10 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } const LLUUID item_id = current_item->getListener()->getUUID(); LLViewerInventoryItem *item = gInventory.getItem(item_id); - item->regenerateLink(); + if (item) + { + item->regenerateLink(); + } active_panel->setSelection(item_id, TAKE_FOCUS_NO); } if (command_name == "find_original") diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 3221745fa3..f5a9f82d50 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -955,8 +955,12 @@ BOOL LLPreviewLSL::postBuild() { const LLInventoryItem* item = getItem(); + llassert(item); + if (item) + { + childSetText("desc", item->getDescription()); + } childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index fdf9e1df2e..fb78b6a415 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1263,11 +1263,10 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) return false; LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL; - if(!mep) return false; - viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; + viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 8c61ba7558..24a788aaed 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3554,9 +3554,15 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat, BOOL is_agent_mappable(const LLUUID& agent_id) { - return (LLAvatarActions::isFriend(agent_id) && - LLAvatarTracker::instance().getBuddyInfo(agent_id)->isOnline() && - LLAvatarTracker::instance().getBuddyInfo(agent_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) + const LLRelationship* buddy_info = NULL; + bool is_friend = LLAvatarActions::isFriend(agent_id); + + if (is_friend) + buddy_info = LLAvatarTracker::instance().getBuddyInfo(agent_id); + + return (buddy_info && + buddy_info->isOnline() && + buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION) ); } @@ -6402,7 +6408,6 @@ class LLToolsSelectedScriptAction : public view_listener_t else { llwarns << "Failed to generate LLFloaterScriptQueue with action: " << action << llendl; - delete queue; } return true; } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index f3bfc2e86c..3d153db733 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5377,24 +5377,25 @@ LLVoiceClient::sessionState* LLVoiceClient::startUserIMSession(const LLUUID &uui // No session with user, need to start one. std::string uri = sipURIFromID(uuid); session = addSession(uri); + + llassert(session); + if (!session) return NULL; + session->mIsSpatial = false; session->mReconnect = false; session->mIsP2P = true; session->mCallerID = uuid; } - if(session) + if(session->mHandle.empty()) { - if(session->mHandle.empty()) - { - // Session isn't active -- start it up. - sessionCreateSendMessage(session, false, true); - } - else - { - // Session is already active -- start up text. - sessionTextConnectSendMessage(session); - } + // Session isn't active -- start it up. + sessionCreateSendMessage(session, false, true); + } + else + { + // Session is already active -- start up text. + sessionTextConnectSendMessage(session); } return session; |