aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpreview.cpp')
-rw-r--r--linden/indra/newview/llpreview.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp
index 7137f85..9b2d3f8 100644
--- a/linden/indra/newview/llpreview.cpp
+++ b/linden/indra/newview/llpreview.cpp
@@ -70,7 +70,7 @@ LLPreview::LLPreview(const std::string& name) :
70 mAutoFocus = FALSE; 70 mAutoFocus = FALSE;
71} 71}
72 72
73LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize, S32 min_width, S32 min_height ) 73LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize, S32 min_width, S32 min_height, LLPointer<LLViewerInventoryItem> inv_item )
74: LLFloater(name, rect, title, allow_resize, min_width, min_height ), 74: LLFloater(name, rect, title, allow_resize, min_width, min_height ),
75 mItemUUID(item_uuid), 75 mItemUUID(item_uuid),
76 mSourceID(LLUUID::null), 76 mSourceID(LLUUID::null),
@@ -79,7 +79,8 @@ LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::str
79 mForceClose( FALSE ), 79 mForceClose( FALSE ),
80 mUserResized(FALSE), 80 mUserResized(FALSE),
81 mCloseAfterSave(FALSE), 81 mCloseAfterSave(FALSE),
82 mAssetStatus(PREVIEW_ASSET_UNLOADED) 82 mAssetStatus(PREVIEW_ASSET_UNLOADED),
83 mItem(inv_item)
83{ 84{
84 mAuxItem = new LLInventoryItem; 85 mAuxItem = new LLInventoryItem;
85 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action 86 // don't necessarily steal focus on creation -- sometimes these guys pop up without user action
@@ -154,9 +155,11 @@ void LLPreview::setSourceID(const LLUUID& source_id)
154 sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, mViewHandle)); 155 sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, mViewHandle));
155} 156}
156 157
157LLViewerInventoryItem* LLPreview::getItem() const 158const LLViewerInventoryItem *LLPreview::getItem() const
158{ 159{
159 LLViewerInventoryItem* item = NULL; 160 if(mItem)
161 return mItem;
162 const LLViewerInventoryItem *item = NULL;
160 if(mObjectUUID.isNull()) 163 if(mObjectUUID.isNull())
161 { 164 {
162 // it's an inventory item, so get the item. 165 // it's an inventory item, so get the item.
@@ -177,7 +180,7 @@ LLViewerInventoryItem* LLPreview::getItem() const
177// Sub-classes should override this function if they allow editing 180// Sub-classes should override this function if they allow editing
178void LLPreview::onCommit() 181void LLPreview::onCommit()
179{ 182{
180 LLViewerInventoryItem* item = getItem(); 183 const LLViewerInventoryItem *item = getItem();
181 if(item) 184 if(item)
182 { 185 {
183 if (!item->isComplete()) 186 if (!item->isComplete())
@@ -350,7 +353,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)
350 { 353 {
351 S32 screen_x; 354 S32 screen_x;
352 S32 screen_y; 355 S32 screen_y;
353 LLViewerInventoryItem *item = getItem(); 356 const LLViewerInventoryItem *item = getItem();
354 357
355 localPointToScreen(x, y, &screen_x, &screen_y ); 358 localPointToScreen(x, y, &screen_x, &screen_y );
356 if(item 359 if(item
@@ -436,7 +439,7 @@ void LLPreview::onDiscardBtn(void* data)
436{ 439{
437 LLPreview* self = (LLPreview*)data; 440 LLPreview* self = (LLPreview*)data;
438 441
439 LLViewerInventoryItem* item = self->getItem(); 442 const LLViewerInventoryItem* item = self->getItem();
440 if (!item) return; 443 if (!item) return;
441 444
442 self->mForceClose = TRUE; 445 self->mForceClose = TRUE;