diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2018-06-26 09:45:14 -0400 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2018-06-26 09:45:14 -0400 |
| commit | f4a772b2b8e70eb3ef3b734a7d3e1623e3f1be15 (patch) | |
| tree | cc1759aeb34319f3af32085a7fc778fca7eda92d /indra/newview/llpreviewscript.cpp | |
| parent | 020757ff0170aa894c56cd719d46413c9e99fde6 (diff) | |
| parent | 9db683c13e67575bd347cf8a795f1a4ee148c4ea (diff) | |
DRTVWR-453: Update from MAINT (viewer-lynx).
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 16 |
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; } |
