summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 151252fb2d..4be3f6c742 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2309,7 +2309,6 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id,
mItem = new LLViewerInventoryItem(item);
}
-
/*static*/
void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, bool isRunning)
{
@@ -2333,15 +2332,13 @@ void LLLiveLSLEditor::finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAs
preview->callbackLSLCompileFailed(response["errors"]);
}
}
-
}
-
// virtual
void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
- if(!object)
+ if (!object)
{
LLNotificationsUtil::add("SaveScriptFailObjectNotFound");
return;
@@ -2366,7 +2363,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
}
// Don't need to save if we're pristine
- if(!mScriptEd->hasChanged())
+ if (!mScriptEd->hasChanged())
{
return;
}
@@ -2383,6 +2380,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
{
mScriptEd->sync();
}
+
bool isRunning = getChild<LLCheckBoxCtrl>("running")->get();
getWindow()->incBusyCount();
mPendingUploads++;
@@ -2409,14 +2407,14 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
bool LLLiveLSLEditor::canClose()
{
- return (mScriptEd->canClose());
+ return mScriptEd->canClose();
}
void LLLiveLSLEditor::closeIfNeeded()
{
getWindow()->decBusyCount();
mPendingUploads--;
- if (mPendingUploads <= 0 && mCloseAfterSave)
+ if ((mPendingUploads <= 0) && mCloseAfterSave)
{
closeFloater();
}
@@ -2432,8 +2430,7 @@ void LLLiveLSLEditor::onLoad(void* userdata)
// static
void LLLiveLSLEditor::onSave(void* userdata, bool close_after_save)
{
- LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata;
- if(self)
+ if (LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata)
{
self->mCloseAfterSave = close_after_save;
self->mScriptEd->mErrorList->setCommentText("");
@@ -2441,7 +2438,6 @@ void LLLiveLSLEditor::onSave(void* userdata, bool close_after_save)
}
}
-
// static
void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
{
@@ -2453,8 +2449,7 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
LLSD floater_key;
floater_key["taskid"] = object_id;
floater_key["itemid"] = item_id;
- LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key);
- if(instance)
+ if (LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key))
{
instance->mHaveRunningInfo = true;
bool running;
@@ -2469,7 +2464,6 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
}
}
-
void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata)
{
LLLiveLSLEditor* self = static_cast<LLLiveLSLEditor*>(userdata);
@@ -2479,20 +2473,15 @@ void LLLiveLSLEditor::onMonoCheckboxClicked(LLUICtrl*, void* userdata)
bool LLLiveLSLEditor::monoChecked() const
{
- if(NULL != mMonoCheckbox)
- {
- return mMonoCheckbox->getValue()? true : false;
- }
- return false;
+ return mMonoCheckbox && mMonoCheckbox->getValue();
}
void LLLiveLSLEditor::setAssociatedExperience( LLHandle<LLLiveLSLEditor> editor, const LLSD& experience )
{
- LLLiveLSLEditor* scriptEd = editor.get();
- if(scriptEd)
+ if (LLLiveLSLEditor* scriptEd = editor.get())
{
LLUUID id;
- if(experience.has(LLExperienceCache::EXPERIENCE_ID))
+ if (experience.has(LLExperienceCache::EXPERIENCE_ID))
{
id=experience[LLExperienceCache::EXPERIENCE_ID].asUUID();
}