aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreviewnotecard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpreviewnotecard.cpp')
-rw-r--r--linden/indra/newview/llpreviewnotecard.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/linden/indra/newview/llpreviewnotecard.cpp b/linden/indra/newview/llpreviewnotecard.cpp
index 471fe8a..5943b3e 100644
--- a/linden/indra/newview/llpreviewnotecard.cpp
+++ b/linden/indra/newview/llpreviewnotecard.cpp
@@ -81,10 +81,12 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
81 const LLUUID& item_id, 81 const LLUUID& item_id,
82 const LLUUID& object_id, 82 const LLUUID& object_id,
83 const LLUUID& asset_id, 83 const LLUUID& asset_id,
84 BOOL show_keep_discard) : 84 BOOL show_keep_discard,
85 LLPointer<LLViewerInventoryItem> inv_item) :
85 LLPreview(name, rect, title, item_id, object_id, TRUE, 86 LLPreview(name, rect, title, item_id, object_id, TRUE,
86 PREVIEW_MIN_WIDTH, 87 PREVIEW_MIN_WIDTH,
87 PREVIEW_MIN_HEIGHT), 88 PREVIEW_MIN_HEIGHT,
89 inv_item),
88 mAssetID( asset_id ), 90 mAssetID( asset_id ),
89 mNotecardItemID(item_id), 91 mNotecardItemID(item_id),
90 mObjectID(object_id) 92 mObjectID(object_id)
@@ -104,7 +106,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
104 106
105 if( mAssetID.isNull() ) 107 if( mAssetID.isNull() )
106 { 108 {
107 LLInventoryItem* item = getItem(); 109 const LLInventoryItem* item = getItem();
108 if( item ) 110 if( item )
109 { 111 {
110 mAssetID = item->getAssetUUID(); 112 mAssetID = item->getAssetUUID();
@@ -121,7 +123,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
121 123
122 childSetVisible("lock", FALSE); 124 childSetVisible("lock", FALSE);
123 125
124 LLInventoryItem* item = getItem(); 126 const LLInventoryItem* item = getItem();
125 127
126 childSetCommitCallback("desc", LLPreview::onText, this); 128 childSetCommitCallback("desc", LLPreview::onText, this);
127 if (item) 129 if (item)
@@ -260,7 +262,7 @@ void LLPreviewNotecard::refreshFromInventory()
260void LLPreviewNotecard::loadAsset() 262void LLPreviewNotecard::loadAsset()
261{ 263{
262 // request the asset. 264 // request the asset.
263 LLInventoryItem* item = getItem(); 265 const LLInventoryItem* item = getItem();
264 LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); 266 LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor");
265 267
266 if (!editor) 268 if (!editor)
@@ -384,7 +386,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
384 386
385 previewEditor->makePristine(); 387 previewEditor->makePristine();
386 388
387 LLInventoryItem* item = preview->getItem(); 389 const LLInventoryItem* item = preview->getItem();
388 BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, 390 BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY,
389 item->getPermissions(), GP_OBJECT_MANIPULATE); 391 item->getPermissions(), GP_OBJECT_MANIPULATE);
390 preview->setEnabled(modifiable); 392 preview->setEnabled(modifiable);
@@ -489,7 +491,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
489 file.setMaxSize(size); 491 file.setMaxSize(size);
490 file.write((U8*)buffer.c_str(), size); 492 file.write((U8*)buffer.c_str(), size);
491 493
492 LLInventoryItem* item = getItem(); 494 const LLInventoryItem* item = getItem();
493 // save it out to database 495 // save it out to database
494 if (item) 496 if (item)
495 { 497 {