From a0258435ebd6cbb949b9f5acdaedf57adce78f45 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 19 Jun 2010 00:03:44 +0300 Subject: EXT-7609 FIXED item title font size. - Moved inventory list item panel to a separate file. - Added xui customizable styles for wearable list items. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/551/. --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 9c308359fa..427a0dc34d 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -34,11 +34,11 @@ #include "llwearableitemslist.h" #include "lliconctrl.h" +#include "llmenugl.h" // for LLContextMenu #include "llagentwearables.h" #include "llappearancemgr.h" #include "llinventoryfunctions.h" -#include "llmenugl.h" // for LLContextMenu #include "lltransutil.h" #include "llviewerattachmenu.h" #include "llvoavatarself.h" @@ -113,18 +113,17 @@ LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item // virtual void LLPanelWearableOutfitItem::updateItem(const std::string& name, - const LLStyle::Params& input_params) + EItemState item_state) { std::string search_label = name; - LLStyle::Params style_params = input_params; if (mItem && get_is_item_worn(mItem->getUUID())) { search_label += LLTrans::getString("worn"); - style_params.font.style("BOLD"); + item_state = IS_WORN; } - LLPanelInventoryListItemBase::updateItem(search_label, style_params); + LLPanelInventoryListItemBase::updateItem(search_label, item_state); } ////////////////////////////////////////////////////////////////////////// @@ -264,19 +263,18 @@ LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryIt return list_item; } -void LLPanelAttachmentListItem::setTitle(const std::string& title, - const std::string& highlit_text, - const LLStyle::Params& input_params) +void LLPanelAttachmentListItem::updateItem(const std::string& name, + EItemState item_state) { - std::string title_joint = title; + std::string title_joint; if (mItem && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(mItem->getLinkedUUID())) { std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(mItem->getLinkedUUID())); - title_joint = title + " (" + joint + ")"; + title_joint = name + " (" + joint + ")"; } - LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text, input_params); + LLPanelInventoryListItemBase::updateItem(title_joint, item_state); } ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 632c287e9a03c3a447bdf1981a430cd4487b203b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 22 Jun 2010 11:57:29 +0300 Subject: EXT-7928 FIXED replace member pointer to LLViewerInventoryItem with calling LLInventory::getItem() Reason: access to deleted pointer to LLViewerInventoryItem in LLWearableItemsList::updateChangedItems. Fix: replaced member pointer to LLViewerInventoryItem with its LLUUID. Also improved a bit logic of the updateChangedItems() to avoid redundant iterations. Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/613/ --HG-- branch : product-engine --- indra/newview/llwearableitemslist.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llwearableitemslist.cpp') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 427a0dc34d..832d4a2fe6 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -117,7 +117,7 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - if (mItem && get_is_item_worn(mItem->getUUID())) + if (get_is_item_worn(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -268,9 +268,10 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name, { std::string title_joint; - if (mItem && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(mItem->getLinkedUUID())) + LLViewerInventoryItem* inv_item = getItem(); + if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID())) { - std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(mItem->getLinkedUUID())); + std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID())); title_joint = name + " (" + joint + ")"; } @@ -501,6 +502,9 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) { + // nothing to update + if (changed_items_uuids.empty()) return; + typedef std::vector item_panel_list_t; item_panel_list_t items; @@ -525,6 +529,7 @@ void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_ite if (linked_uuid == *iter) { item->setNeedsRefresh(true); + break; } } } -- cgit v1.2.3