diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorylistitem.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewertexteditor.cpp | 50 | ||||
-rw-r--r-- | indra/newview/llviewertexteditor.h | 7 | ||||
-rw-r--r-- | indra/newview/llworldmap.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llworldmap.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_roles.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 1 |
11 files changed, 102 insertions, 34 deletions
diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index e4a7a158a3..2546390fcb 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -96,9 +96,12 @@ void LLPanelInventoryListItemBase::draw() if (mSeparatorVisible && mSeparatorImage) { - // stretch along bottom of listitem, using image height + // place under bottom of listitem, using image height + // item_pad in list using the item should be >= image height + // to avoid cropping of top of the next item. LLRect separator_rect = getLocalRect(); - separator_rect.mTop = mSeparatorImage->getHeight(); + separator_rect.mTop = separator_rect.mBottom; + separator_rect.mBottom -= mSeparatorImage->getHeight(); mSeparatorImage->draw(separator_rect); } diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 26e8a932aa..445cfe64f7 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1593,6 +1593,7 @@ void LLPanelGroupMembersSubTab::updateMembers() LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); + LLUIString donated = getString("donation_area"); S32 i = 0; for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME; @@ -1614,9 +1615,7 @@ void LLPanelGroupMembersSubTab::updateMembers() if (add_member) { - // Build the donated tier string. - std::ostringstream donated; - donated << mMemberProgress->second->getContribution() << " sq. m."; + donated.setArg("[AREA]", llformat("%d", mMemberProgress->second->getContribution())); LLSD row; row["id"] = (*mMemberProgress).first; @@ -1625,7 +1624,7 @@ void LLPanelGroupMembersSubTab::updateMembers() // value is filled in by name list control row["columns"][1]["column"] = "donated"; - row["columns"][1]["value"] = donated.str(); + row["columns"][1]["value"] = donated.getString(); row["columns"][2]["column"] = "online"; row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus(); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 8c1f5d0915..99e48cca6d 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -60,7 +60,8 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() mScrollingPanelWidth(0), mInfoType(UNKNOWN), mScrollingPanel(NULL), - mScrollContainer(NULL) + mScrollContainer(NULL), + mDescEditor(NULL) {} //virtual @@ -248,6 +249,16 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) // virtual void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) { + + // This if was added to force collapsing description textbox on Windows at the beginning of reshape + // (the only case when reshape is skipped here is when it's caused by this textbox, so called_from_parent is FALSE) + // This way it is consistent with Linux where topLost collapses textbox at the beginning of reshape. + // On windows it collapsed only after reshape which caused EXT-8342. + if(called_from_parent) + { + if(mDescEditor) mDescEditor->onTopLost(); + } + LLPanel::reshape(width, height, called_from_parent); if (!mScrollContainer || !mScrollingPanel) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 2d57c16889..5d90af0cfe 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1172,6 +1172,14 @@ void move_inventory_item( void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id) { + if (NULL == src) + { + LL_WARNS("copy_inventory_from_notecard") << "Null pointer to item was passed for object_id " + << object_id << " and notecard_inv_id " + << notecard_inv_id << LL_ENDL; + return; + } + LLViewerRegion* viewer_region = NULL; LLViewerObject* vo = NULL; if (object_id.notNull() && (vo = gObjectList.findObject(object_id)) != NULL) @@ -1194,6 +1202,16 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar return; } + // check capability to prevent a crash while LL_ERRS in LLCapabilityListener::capListener. See EXT-8459. + std::string url = viewer_region->getCapability("CopyInventoryFromNotecard"); + if (url.empty()) + { + LL_WARNS("copy_inventory_from_notecard") << "There is no 'CopyInventoryFromNotecard' capability" + << " for region: " << viewer_region->getName() + << LL_ENDL; + return; + } + LLSD request, body; body["notecard-id"] = notecard_inv_id; body["object-id"] = object_id; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 04eb8164f8..fa0e860ae9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1138,10 +1138,26 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam } else if(from_name.empty()) { + std::string folder_name; + if (parent_folder) + { + // Localize folder name. + // *TODO: share this code? + folder_name = parent_folder->getName(); + if (LLFolderType::lookupIsProtectedType(parent_folder->getPreferredType())) + { + LLTrans::findString(folder_name, "InvFolder " + folder_name); + } + } + else + { + folder_name = LLTrans::getString("Unknown"); + } + // we receive a message from LLOpenTaskOffer, it mean that new landmark has been added. LLSD args; args["LANDMARK_NAME"] = item->getName(); - args["FOLDER_NAME"] = std::string(parent_folder ? parent_folder->getName() : "unknown"); + args["FOLDER_NAME"] = folder_name; LLNotificationsUtil::add("LandmarkCreated", args); } } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 59efae4cb2..8bd43bb30c 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -90,7 +90,7 @@ public: } static void processForeignLandmark(LLLandmark* landmark, const LLUUID& object_id, const LLUUID& notecard_inventory_id, - LLInventoryItem* item) + LLPointer<LLInventoryItem> item_ptr) { LLVector3d global_pos; landmark->getGlobalPos(global_pos); @@ -103,8 +103,16 @@ public: } else { - LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); - copy_inventory_from_notecard(object_id, notecard_inventory_id, item, gInventoryCallbacks.registerCB(cb)); + if (item_ptr.isNull()) + { + // check to prevent a crash. See EXT-8459. + llwarns << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << llendl; + } + else + { + LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); + copy_inventory_from_notecard(object_id, notecard_inventory_id, item_ptr.get(), gInventoryCallbacks.registerCB(cb)); + } } } }; @@ -300,14 +308,14 @@ public: void markSaved(); - static LLInventoryItem* getEmbeddedItem(llwchar ext_char); // returns item from static list + static LLPointer<LLInventoryItem> getEmbeddedItemPtr(llwchar ext_char); // returns pointer to item from static list static BOOL getEmbeddedItemSaved(llwchar ext_char); // returns whether item from static list is saved private: struct embedded_info_t { - LLPointer<LLInventoryItem> mItem; + LLPointer<LLInventoryItem> mItemPtr; BOOL mSaved; }; typedef std::map<llwchar, embedded_info_t > item_map_t; @@ -378,7 +386,7 @@ BOOL LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_ch ++wc_emb; } - sEntries[wc_emb].mItem = item; + sEntries[wc_emb].mItemPtr = item; sEntries[wc_emb].mSaved = is_new ? FALSE : TRUE; *ext_char = wc_emb; mEmbeddedUsedChars.insert(wc_emb); @@ -400,14 +408,14 @@ BOOL LLEmbeddedItems::removeEmbeddedItem( llwchar ext_char ) } // static -LLInventoryItem* LLEmbeddedItems::getEmbeddedItem(llwchar ext_char) +LLPointer<LLInventoryItem> LLEmbeddedItems::getEmbeddedItemPtr(llwchar ext_char) { if( ext_char >= LLTextEditor::FIRST_EMBEDDED_CHAR && ext_char <= LLTextEditor::LAST_EMBEDDED_CHAR ) { item_map_t::iterator iter = sEntries.find(ext_char); if (iter != sEntries.end()) { - return iter->second.mItem; + return iter->second.mItemPtr; } } return NULL; @@ -505,7 +513,7 @@ BOOL LLEmbeddedItems::hasEmbeddedItem(llwchar ext_char) LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const { - LLInventoryItem* item = getEmbeddedItem(ext_char); + LLInventoryItem* item = getEmbeddedItemPtr(ext_char); if (item) { const char* img_name = ""; @@ -567,7 +575,7 @@ void LLEmbeddedItems::getEmbeddedItemList( std::vector<LLPointer<LLInventoryItem for (std::set<llwchar>::iterator iter = mEmbeddedUsedChars.begin(); iter != mEmbeddedUsedChars.end(); ++iter) { llwchar wc = *iter; - LLPointer<LLInventoryItem> item = getEmbeddedItem(wc); + LLPointer<LLInventoryItem> item = getEmbeddedItemPtr(wc); if (item) { items.push_back(item); @@ -698,7 +706,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { wc = getWText()[mCursorPos]; } - LLInventoryItem* item_at_pos = LLEmbeddedItems::getEmbeddedItem(wc); + LLPointer<LLInventoryItem> item_at_pos = LLEmbeddedItems::getEmbeddedItemPtr(wc); if (item_at_pos) { mDragItem = item_at_pos; @@ -1019,7 +1027,7 @@ llwchar LLViewerTextEditor::pasteEmbeddedItem(llwchar ext_char) { return ext_char; // already exists in my list } - LLInventoryItem* item = LLEmbeddedItems::getEmbeddedItem(ext_char); + LLInventoryItem* item = LLEmbeddedItems::getEmbeddedItemPtr(ext_char); if (item) { // Add item to my list and return new llwchar associated with it @@ -1053,7 +1061,7 @@ void LLViewerTextEditor::findEmbeddedItemSegments(S32 start, S32 end) && embedded_char <= LAST_EMBEDDED_CHAR && mEmbeddedItemList->hasEmbeddedItem(embedded_char) ) { - LLInventoryItem* itemp = mEmbeddedItemList->getEmbeddedItem(embedded_char); + LLInventoryItem* itemp = mEmbeddedItemList->getEmbeddedItemPtr(embedded_char); LLUIImagePtr image = mEmbeddedItemList->getItemImage(embedded_char); insertSegment(new LLEmbeddedItemSegment(idx, image, itemp, *this)); } @@ -1065,7 +1073,7 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos) if( pos < getLength()) { llwchar wc = getWText()[pos]; - LLInventoryItem* item = LLEmbeddedItems::getEmbeddedItem( wc ); + LLPointer<LLInventoryItem> item = LLEmbeddedItems::getEmbeddedItemPtr( wc ); if( item ) { BOOL saved = LLEmbeddedItems::getEmbeddedItemSaved( wc ); @@ -1083,7 +1091,7 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos) } -BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc) +BOOL LLViewerTextEditor::openEmbeddedItem(LLPointer<LLInventoryItem> item, llwchar wc) { switch( item->getType() ) @@ -1151,17 +1159,17 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item, llwchar wc ) } -void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item, llwchar wc ) +void LLViewerTextEditor::openEmbeddedLandmark( LLPointer<LLInventoryItem> item_ptr, llwchar wc ) { - if (!item) + if (item_ptr.isNull()) return; - LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID(), - boost::bind(&LLEmbeddedLandmarkCopied::processForeignLandmark, _1, mObjectID, mNotecardInventoryID, item)); + LLLandmark* landmark = gLandmarkList.getAsset(item_ptr->getAssetUUID(), + boost::bind(&LLEmbeddedLandmarkCopied::processForeignLandmark, _1, mObjectID, mNotecardInventoryID, item_ptr)); if (landmark) { LLEmbeddedLandmarkCopied::processForeignLandmark(landmark, mObjectID, - mNotecardInventoryID, item); + mNotecardInventoryID, item_ptr); } } @@ -1220,7 +1228,7 @@ bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD& { LLUUID item_id = notification["payload"]["item_id"].asUUID(); llwchar wc = llwchar(notification["payload"]["item_wc"].asInteger()); - LLInventoryItem* itemp = LLEmbeddedItems::getEmbeddedItem(wc); + LLInventoryItem* itemp = LLEmbeddedItems::getEmbeddedItemPtr(wc); if (itemp) copyInventory(itemp); } diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index ba0c40cb2e..74b6d70640 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -104,13 +104,16 @@ private: virtual llwchar pasteEmbeddedItem(llwchar ext_char); BOOL openEmbeddedItemAtPos( S32 pos ); - BOOL openEmbeddedItem(LLInventoryItem* item, llwchar wc); + BOOL openEmbeddedItem(LLPointer<LLInventoryItem> item, llwchar wc); S32 insertEmbeddedItem(S32 pos, LLInventoryItem* item); + // *NOTE: most of openEmbeddedXXX methods except openEmbeddedLandmark take pointer to LLInventoryItem. + // Be sure they don't bind it to callback function to avoid situation when it gets invalid when + // callback is trigged after text editor is closed. See EXT-8459. void openEmbeddedTexture( LLInventoryItem* item, llwchar wc ); void openEmbeddedSound( LLInventoryItem* item, llwchar wc ); - void openEmbeddedLandmark( LLInventoryItem* item, llwchar wc ); + void openEmbeddedLandmark( LLPointer<LLInventoryItem> item_ptr, llwchar wc ); void openEmbeddedNotecard( LLInventoryItem* item, llwchar wc); void openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc); void showCopyToInvDialog( LLInventoryItem* item, llwchar wc ); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 66cb02ce99..9bbe005de8 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -37,6 +37,7 @@ #include "llworldmapmessage.h" #include "message.h" #include "lltracker.h" +#include "lluistring.h" #include "llviewertexturelist.h" #include "lltrans.h" @@ -522,8 +523,12 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& case MAP_ITEM_LAND_FOR_SALE: // land for sale case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale { - std::string tooltip = llformat("%d sq. m. L$%d", extra, extra2); - new_item.setTooltip(tooltip); + static LLUIString tooltip_fmt = LLTrans::getString("worldmap_item_tooltip_format"); + + tooltip_fmt.setArg("[AREA]", llformat("%d", extra)); + tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2)); + new_item.setTooltip(tooltip_fmt.getString()); + if (type == MAP_ITEM_LAND_FOR_SALE) { siminfo->insertLandForSale(new_item); diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index e4e677eb64..b97e5249e1 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -52,7 +52,7 @@ public: LLItemInfo(F32 global_x, F32 global_y, const std::string& name, LLUUID id); // Setters - void setTooltip(std::string& tooltip) { mToolTip = tooltip; } + void setTooltip(const std::string& tooltip) { mToolTip = tooltip; } void setElevation(F64 z) { mPosGlobal.mdV[VZ] = z; } void setCount(S32 count) { mCount = count; } // void setSelected(bool selected) { mSelected = selected; } diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 0eb5c47f85..18a2f37ba2 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -50,6 +50,10 @@ Select multiple Members by holding the Ctrl key and clicking on their names. </panel.string> <panel.string + name="donation_area"> + [AREA] m² + </panel.string> + <panel.string name="power_folder_icon" translate="false"> Inv_FolderClosed </panel.string> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index e5bd549036..3d8ceb9912 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -278,6 +278,7 @@ <!-- world map --> <string name="texture_loading">Loading...</string> <string name="worldmap_offline">Offline</string> + <string name="worldmap_item_tooltip_format">[AREA] m² L$[PRICE]</string> <string name="worldmap_results_none_found">None found.</string> <!-- animations uploading status codes --> |