summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-08-02 21:54:09 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-08-02 21:54:09 +0100
commit6ce09ad712f98fe5d0097f1de6a5d1793f5f2bdd (patch)
tree0d4ca8e3d55647d713447b0d865c75565e6458cf /indra/newview/llpreviewscript.cpp
parentac889b1eeb7f9a00e7a6d1d9ba14c70d0c7a33fc (diff)
parent09f97172bb478a2c977d8b7b0958196e7e98c433 (diff)
merge
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index d4eecaffce..9431914ba3 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1741,14 +1741,22 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
buffer[file_length] = 0;
preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
preview->mScriptEd->mEditor->makePristine();
+
+ std::string script_name = DEFAULT_SCRIPT_NAME;
LLInventoryItem* item = gInventory.getItem(*item_uuid);
BOOL is_modifiable = FALSE;
- if(item
- && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(),
- GP_OBJECT_MANIPULATE))
+ if (item)
{
- is_modifiable = TRUE;
+ if (!item->getName().empty())
+ {
+ script_name = item->getName();
+ }
+ if (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))
+ {
+ is_modifiable = TRUE;
+ }
}
+ preview->mScriptEd->setScriptName(script_name);
preview->mScriptEd->setEnableEditing(is_modifiable);
preview->mAssetStatus = PREVIEW_ASSET_LOADED;
}