From 572ee5c9db2aeec17e1cc7e6c69c72ad8c7ff6fc Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 25 Jun 2009 18:41:04 +0000 Subject: DEV-34488 Can not save script to a prim. Underlying issue was LLPreview holding two member variables mObjectUUID and mObjectID. mObjectID was null for scripts. It appears to be used only for notecards (?), so I converted it to mNotecardObjectID and switched references to point to mObjectUUID. Renamed one other variable to mSaveObjectID for clarity. Removed unnecessary include files and de-inlined a couple functions because I was there. Reviewed with Steve. --- indra/newview/llpreview.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpreview.cpp') diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 64713108af..676943ff87 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -61,6 +61,7 @@ LLPreview::LLPreview(const LLSD& key) : LLFloater(key), mItemUUID(key.asUUID()), + mObjectUUID(), // set later by setObjectID() mCopyToInvBtn( NULL ), mForceClose(FALSE), mUserResized(FALSE), @@ -194,6 +195,13 @@ void LLPreview::changed(U32 mask) mDirty = TRUE; } +void LLPreview::setNotecardInfo(const LLUUID& notecard_inv_id, + const LLUUID& object_id) +{ + mNotecardInventoryID = notecard_inv_id; + mNotecardObjectID = object_id; +} + void LLPreview::draw() { LLFloater::draw(); @@ -338,6 +346,12 @@ void LLPreview::onOpen(const LLSD& key) } } +void LLPreview::setAuxItem( const LLInventoryItem* item ) +{ + if ( mAuxItem ) + mAuxItem->copyItem(item); +} + // static void LLPreview::onBtnCopyToInv(void* userdata) { @@ -349,7 +363,7 @@ void LLPreview::onBtnCopyToInv(void* userdata) // Copy to inventory if (self->mNotecardInventoryID.notNull()) { - copy_inventory_from_notecard(self->mObjectID, + copy_inventory_from_notecard(self->mNotecardObjectID, self->mNotecardInventoryID, item); } else -- cgit v1.2.3