diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a01e828b2ca419adb0638025ad6903e62878de7a..617f5ab87bf492d6fa17e0131d51a962bcf285de 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3696,8 +3696,7 @@ public: } //K now we want to accept the invitation - std::string url = gAgent.getRegion()->getCapability( - "ChatSessionRequest"); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); if (!url.empty()) { diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 985c94e184fe05b23ee39282d4cf929fadbd592d..9b4a19a53181091c79518df0d837a09ce64b1f46 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -174,6 +174,8 @@ public: bool wantsKeyUpKeyDown() const override; bool wantsReturnKey() const override; + virtual BOOL acceptsTextInput() const { return TRUE; } + protected: void convertInputCoords(S32& x, S32& y); diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index 133cae4b999aeb65689f328c2d025e71ec66c605..0ed8dc8d343b637b2165f467d892d82ff37fb1f6 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -166,6 +166,8 @@ void LLPanelSnapshotPostcard::sendPostcardFinished(LLSD result) void LLPanelSnapshotPostcard::sendPostcard() { + if (!gAgent.getRegion()) return; + // upload the image std::string url = gAgent.getRegion()->getCapability("SendPostcard"); if (!url.empty()) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index d9444f088d94c8446c0668fd3a37f864b7ab2a52..c7c020e6e4fb684fb83a302a1ae6f317ed851155 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -589,6 +589,23 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) } } +std::string LLScriptEdCore::getScriptText() +{ + if (mEditor) + { + return mEditor->getText(); + } + return LLStringUtil::null; +} + +void LLScriptEdCore::makeEditorPristine() +{ + if (mEditor) + { + mEditor->makePristine(); + } +} + bool LLScriptEdCore::loadScriptText(const std::string& filename) { if (filename.empty()) @@ -644,7 +661,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename) return false; } - std::string utf8text = mEditor->getText(); + std::string utf8text = getScriptText(); // Special case for a completely empty script - stuff in one space so it can store properly. See SL-46889 if (utf8text.size() == 0) @@ -1248,7 +1265,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) ) { std::string filename = file_picker.getFirstFile(); - std::string scriptText=self->mEditor->getText(); + std::string scriptText=self->getScriptText(); llofstream fout(filename.c_str()); fout<<(scriptText); fout.close(); @@ -1616,7 +1633,7 @@ void LLPreviewLSL::loadAsset() else { mScriptEd->setScriptText(mScriptEd->getString("can_not_view"), FALSE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mScriptEd->mFunctions->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -1704,7 +1721,7 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) mPendingUploads = 0; mScriptEd->mErrorList->deleteAllItems(); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); if (sync) { @@ -1725,7 +1742,7 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); if (!url.empty()) { - std::string buffer(mScriptEd->mEditor->getText()); + std::string buffer(mScriptEd->getScriptText()); LLBufferedAssetUploadInfo::invnUploadFinish_f proc = boost::bind(&LLPreviewLSL::finishedLSLUpload, _1, _4); LLResourceUploadInfo::ptr_t uploadInfo(new LLScriptAssetUpload(mItemUUID, buffer, proc)); @@ -1756,7 +1773,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset // put a EOS at the end buffer[file_length] = 0; preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); - preview->mScriptEd->mEditor->makePristine(); + preview->mScriptEd->makeEditorPristine(); LLInventoryItem* item = gInventory.getItem(*item_uuid); BOOL is_modifiable = FALSE; if(item @@ -1841,7 +1858,7 @@ BOOL LLLiveLSLEditor::postBuild() childSetCommitCallback("mono", &LLLiveLSLEditor::onMonoCheckboxClicked, this); getChildView("mono")->setEnabled(FALSE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mScriptEd->mEditor->setFocus(TRUE); @@ -1932,7 +1949,7 @@ void LLLiveLSLEditor::loadAsset() { mItem = new LLViewerInventoryItem(item); mScriptEd->setScriptText(getString("not_allowed"), FALSE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mScriptEd->enableSave(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -1967,7 +1984,7 @@ void LLLiveLSLEditor::loadAsset() if(mItem.isNull()) { mScriptEd->setScriptText(LLStringUtil::null, FALSE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mAssetStatus = PREVIEW_ASSET_LOADED; mIsModifiable = FALSE; } @@ -2070,7 +2087,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()); } @@ -2258,9 +2275,9 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) // save the script mScriptEd->enableSave(FALSE); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); mScriptEd->mErrorList->deleteAllItems(); - mScriptEd->mEditor->makePristine(); + mScriptEd->makeEditorPristine(); if (sync) { @@ -2274,7 +2291,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) if (!url.empty()) { - std::string buffer(mScriptEd->mEditor->getText()); + std::string buffer(mScriptEd->getScriptText()); LLBufferedAssetUploadInfo::taskUploadFinish_f proc = boost::bind(&LLLiveLSLEditor::finishLSLUpload, _1, _2, _3, _4, isRunning); LLResourceUploadInfo::ptr_t uploadInfo(new LLScriptAssetUpload(mObjectUUID, mItemUUID, diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 7e2820f427895e2da2619c307e358603f0f50d42..1936b7c86fc1588b203c46dde53f3b9cf3310a70 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -85,6 +85,8 @@ public: bool canLoadOrSaveToFile( void* userdata ); void setScriptText(const std::string& text, BOOL is_valid); + std::string getScriptText(); + void makeEditorPristine(); bool loadScriptText(const std::string& filename); bool writeToFile(const std::string& filename); void sync(); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 53cfb9caa48540b50044ac43c0751245f1ae63f8..d9d8ef91255a6a60060b398b7dec4f32dcedaae3 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1256,9 +1256,11 @@ void LLViewerObjectList::clearDebugText() void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) { + bool new_dead_object = true; if (mDeadObjects.find(objectp->mID) != mDeadObjects.end()) { LL_INFOS() << "Object " << objectp->mID << " already on dead list!" << LL_ENDL; + new_dead_object = false; } else { @@ -1295,7 +1297,10 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) // Also, not cleaned up removeDrawable(objectp->mDrawable); - mNumDeadObjects++; + if (new_dead_object) + { + mNumDeadObjects++; + } } static LLTrace::BlockTimerStatHandle FTM_REMOVE_DRAWABLE("Remove Drawable");