From d775f9b63dd842613abe254fd80451fb318502c1 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Aug 2017 18:45:45 +0300 Subject: MAINT-7732 FIXED Crash in LLLiveLSLEditor::loadScriptText --- indra/newview/llpreviewscript.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b7fea4e982..3c5e2544bb 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -584,6 +584,14 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) } } +void LLScriptEdCore::makeEditorPristine() +{ + if (mEditor) + { + mEditor->makePristine(); + } +} + bool LLScriptEdCore::loadScriptText(const std::string& filename) { if (filename.empty()) @@ -2026,7 +2034,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType buffer[file_length] = '\0'; mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mScriptEd->setScriptName(getItem()->getName()); } -- cgit v1.2.3 From e46f66ff31607d7580be3cae3fef9d070b9ba0d0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 25 Aug 2017 17:02:33 +0300 Subject: MAINT-7752 FIXED Crash in LLPreviewNotecard::handleSaveChangesDialog --- indra/newview/llpreviewscript.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 3c5e2544bb..2476b6d6ed 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -376,7 +376,8 @@ LLScriptEdCore::LLScriptEdCore( mLive(live), mContainer(container), mHasScriptData(FALSE), - mScriptRemoved(FALSE) + mScriptRemoved(FALSE), + mSaveDialogShown(FALSE) { setFollowsAll(); setBorderVisible(FALSE); @@ -855,8 +856,12 @@ BOOL LLScriptEdCore::canClose() } else { - // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); + if(!mSaveDialogShown) + { + mSaveDialogShown = TRUE; + // Bring up view-modal dialog: Save changes? Yes, No, Cancel + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); + } return FALSE; } } @@ -869,6 +874,7 @@ void LLScriptEdCore::setEnableEditing(bool enable) bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response ) { + mSaveDialogShown = FALSE; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { -- cgit v1.2.3 From f8254a9d787ab6235c8fb076bd65dc7cd978dce9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 Aug 2017 19:57:02 +0300 Subject: MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows folder. --- indra/newview/llpreviewscript.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 2476b6d6ed..6ecc4c7fb9 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1214,7 +1214,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) std::string filename = file_picker.getFirstFile(); - std::ifstream fin(filename.c_str()); + llifstream fin(filename.c_str()); std::string line; std::string text; @@ -1252,7 +1252,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) { std::string filename = file_picker.getFirstFile(); std::string scriptText=self->mEditor->getText(); - std::ofstream fout(filename.c_str()); + llofstream fout(filename.c_str()); fout<<(scriptText); fout.close(); self->mSaveCallback( self->mUserdata, FALSE ); -- cgit v1.2.3