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.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 6a9965dbfb..4cf103508d 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -450,12 +450,14 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
LLFloater* help_floater = LLFloater::getFloaterByHandle(mLiveHelpHandle);
if (!help_floater) return;
+#if LL_LIBXUL_ENABLED
// update back and forward buttons
LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn");
LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn");
LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(help_floater, "lsl_guide_html");
back_button->setEnabled(browser->canNavigateBack());
fwd_button->setEnabled(browser->canNavigateForward());
+#endif // LL_LIBXUL_ENABLED
if (!immediate && !gSavedSettings.getBOOL("ScriptHelpFollowsCursor"))
{
@@ -523,7 +525,9 @@ void LLScriptEdCore::setHelpPage(const LLString& help_string)
url_string.setArg("[LSL_STRING]", help_string);
addHelpItemToHistory(help_string);
+#if LL_LIBXUL_ENABLED
web_browser->navigateTo(url_string);
+#endif // LL_LIBXUL_ENABLED
}
void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string)
@@ -655,8 +659,10 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata)
live_help_floater->childSetAction("back_btn", onClickBack, userdata);
live_help_floater->childSetAction("fwd_btn", onClickForward, userdata);
+#if LL_LIBXUL_ENABLED
LLWebBrowserCtrl* browser = LLUICtrlFactory::getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html");
browser->setAlwaysRefresh(TRUE);
+#endif // LL_LIBXUL_ENABLED
LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo");
LLKeywordToken *token;
@@ -680,6 +686,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata)
//static
void LLScriptEdCore::onClickBack(void* userdata)
{
+#if LL_LIBXUL_ENABLED
LLScriptEdCore* corep = (LLScriptEdCore*)userdata;
LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle);
if (live_help_floater)
@@ -690,11 +697,13 @@ void LLScriptEdCore::onClickBack(void* userdata)
browserp->navigateBack();
}
}
+#endif // LL_LIBXUL_ENABLED
}
//static
void LLScriptEdCore::onClickForward(void* userdata)
{
+#if LL_LIBXUL_ENABLED
LLScriptEdCore* corep = (LLScriptEdCore*)userdata;
LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle);
if (live_help_floater)
@@ -705,6 +714,7 @@ void LLScriptEdCore::onClickForward(void* userdata)
browserp->navigateForward();
}
}
+#endif // LL_LIBXUL_ENABLED
}
// static
@@ -737,16 +747,17 @@ void LLScriptEdCore::onHelpComboCommit(LLUICtrl* ctrl, void* userdata)
LLFloater* live_help_floater = LLFloater::getFloaterByHandle(corep->mLiveHelpHandle);
if (live_help_floater)
{
- LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html");
-
LLString help_string = ctrl->getValue().asString();
corep->addHelpItemToHistory(help_string);
+#if LL_LIBXUL_ENABLED
+ LLWebBrowserCtrl* web_browser = gUICtrlFactory->getWebBrowserCtrlByName(live_help_floater, "lsl_guide_html");
LLUIString url_string = gSavedSettings.getString("LSLHelpURL");
url_string.setArg("[APP_DIRECTORY]", gDirUtilp->getWorkingDir());
url_string.setArg("[LSL_STRING]", help_string);
web_browser->navigateTo(url_string);
+#endif // LL_LIBXUL_ENABLED
}
}
@@ -1316,10 +1327,6 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
{
break;
}
- else if(!buffer)
- {
- continue;
- }
else
{
line.assign(buffer);
@@ -1689,7 +1696,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new)
mScriptEd->mEditor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
- else if(mItem.notNull())
+ else if(item && mItem.notNull())
{
// request the text from the object
LLUUID* user_data = new LLUUID(mItemID ^ mObjectID);
@@ -1815,6 +1822,7 @@ void LLLiveLSLEditor::loadScriptText(const char* filename)
if(!filename)
{
llerrs << "Filename is Empty!" << llendl;
+ return;
}
FILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if(file)
@@ -2095,10 +2103,6 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
{
break;
}
- else if(!buffer)
- {
- continue;
- }
else
{
line.assign(buffer);