diff options
author | Oz Linden <oz@lindenlab.com> | 2012-01-04 10:37:17 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-01-04 10:37:17 -0500 |
commit | 23362692e156f12b5f7467241b1a94d57109e838 (patch) | |
tree | e9d4be2312d951b6066364a0e6fd4c59117cb52a /indra/newview | |
parent | 988cb62d432b862397eb1f06cb392e311be6915b (diff) | |
parent | ce6bd89ca4fbc3d1d75725e8cfc8857e21052107 (diff) |
merge changes for storm-1708
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpreviewscript.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index cab30b1295..88727bf59b 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1154,18 +1154,15 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) if( self->mSaveCallback ) { LLFilePicker& file_picker = LLFilePicker::instance(); - if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) ) + if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) ) { - //File picking cancelled by user, so nothing to do. - return; + std::string filename = file_picker.getFirstFile(); + std::string scriptText=self->mEditor->getText(); + std::ofstream fout(filename.c_str()); + fout<<(scriptText); + fout.close(); + self->mSaveCallback( self->mUserdata, FALSE ); } - - std::string filename = file_picker.getFirstFile(); - std::string scriptText=self->mEditor->getText(); - std::ofstream fout(filename.c_str()); - fout<<(scriptText); - fout.close(); - self->mSaveCallback( self->mUserdata, FALSE ); } } @@ -1187,8 +1184,7 @@ bool LLScriptEdCore::enableSaveToFileMenu(void* userdata) bool LLScriptEdCore::enableLoadFromFileMenu(void* userdata) { LLScriptEdCore* self = (LLScriptEdCore*)userdata; - if (!self || !self->mEditor) return FALSE; - return self->mEditor->canLoadOrSaveToFile(); + return (self && self->mEditor) ? self->mEditor->canLoadOrSaveToFile() : FALSE; } /// --------------------------------------------------------------------------- |