From c289a481bdcd767e4799a3fb68808ffb68844ea1 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 22 May 2019 14:57:24 +0300 Subject: [PATCH 1/7] SL-11191 FIXED Crash in LLCommandLineParser::parseCommandLineString(..) --- indra/newview/llcommandlineparser.cpp | 36 ++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 90a5483dc9..fe14bc081f 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -374,12 +374,40 @@ bool LLCommandLineParser::parseCommandLine(int argc, char **argv) bool LLCommandLineParser::parseCommandLineString(const std::string& str) { + std::string cmd_line_string(""); + if (!str.empty()) + { + bool add_last_c = true; + S32 last_c_pos = str.size() - 1; //don't get out of bounds on pos+1, last char will be processed separately + for (S32 pos = 0; pos < last_c_pos; ++pos) + { + cmd_line_string.append(&str[pos], 1); + if (str[pos] == '\\') + { + cmd_line_string.append("\\", 1); + if (str[pos + 1] == '\\') + { + ++pos; + add_last_c = (pos != last_c_pos); + } + } + } + if (add_last_c) + { + cmd_line_string.append(&str[last_c_pos], 1); + if (str[last_c_pos] == '\\') + { + cmd_line_string.append("\\", 1); + } + } + } + // Split the string content into tokens - const char* escape_chars = "\\"; - const char* separator_chars = "\r\n "; - const char* quote_chars = "\"'"; + const char* escape_chars = "\\"; + const char* separator_chars = "\r\n "; + const char* quote_chars = "\"'"; boost::escaped_list_separator sep(escape_chars, separator_chars, quote_chars); - boost::tokenizer< boost::escaped_list_separator > tok(str, sep); + boost::tokenizer< boost::escaped_list_separator > tok(cmd_line_string, sep); std::vector tokens; // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); for(boost::tokenizer< boost::escaped_list_separator >::iterator i = tok.begin(); From 401868c440fb77b101845f1efc6ec1b1f2ef3352 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 22 May 2019 15:36:10 +0300 Subject: [PATCH 2/7] SL-10898 revert --- indra/llui/llui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index a1b31fd5cc..e9f8ba020e 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -237,9 +237,13 @@ void LLUI::dirtyRect(LLRect rect) void LLUI::setMousePositionScreen(S32 x, S32 y) { S32 screen_x, screen_y; +#if defined(LL_DARWIN) + screen_x = ll_round((F32)x); + screen_y = ll_round((F32)y); +#else screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); - +#endif LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } From c2c8753d2565c9fba41f0d5dd390e14d72cd40b9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 21 May 2019 19:39:52 +0300 Subject: [PATCH 3/7] SL-11012 Ambient setting can be missing from llsd --- indra/newview/llvosky.cpp | 2 +- indra/newview/llwlparamset.cpp | 18 ++++++++++++++++++ indra/newview/llwlparamset.h | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index c131cb886f..1e631a2272 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -630,7 +630,7 @@ void LLVOSky::initAtmospherics(void) dome_radius = LLWLParamManager::getInstance()->getDomeRadius(); dome_offset_ratio = LLWLParamManager::getInstance()->getDomeOffset(); sunlight_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("sunlight_color", error)); - ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("ambient", error)); + ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getAmbient()); //lightnorm = LLWLParamManager::getInstance()->mCurParams.getVector("lightnorm", error); gamma = LLWLParamManager::getInstance()->mCurParams.getFloat("gamma", error); blue_density = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_density", error)); diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 066cb9a0ac..cd7a32abdd 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -284,6 +284,11 @@ void LLWLParamSet::setEastAngle(float val) mParamValues["east_angle"] = val; } +void LLWLParamSet::setAmbient(const LLVector4& val) +{ + set("ambient", val); +} + void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) { // set up the iterators @@ -379,6 +384,19 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) setSunAngle((1 - weight) * srcSunAngle + weight * destSunAngle); setEastAngle((1 - weight) * srcEastAngle + weight * destEastAngle); + + // ambient + + LLVector4 srcAmbient = src.getAmbient(); + LLVector4 destAmbient = dest.getAmbient(); + LLVector4 rsltAmbient; + + for (int i = 0; i < LENGTHOFVECTOR4; ++i) + { + rsltAmbient.mV[i] = srcAmbient.mV[i] + ((destAmbient.mV[i] - srcAmbient.mV[i]) * weight); + } + + setAmbient(rsltAmbient); // now setup the sun properly diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index 6e5f1d3a4b..9874f0f2e0 100644 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -136,6 +136,9 @@ public: void setEastAngle(F32 val); F32 getEastAngle(); + + void setAmbient(const LLVector4& val); + LLVector4 getAmbient(); @@ -207,6 +210,11 @@ inline F32 LLWLParamSet::getEastAngle() { return (F32) mParamValues["east_angle"].asReal(); } +inline LLVector4 LLWLParamSet::getAmbient() { + bool error; + return mParamValues.has("ambient") ? getVector("ambient", error) : LLVector4(0.5f, 0.75f, 1.0f, 1.19f); +} + inline void LLWLParamSet::setEnableCloudScrollX(bool val) { mParamValues["enable_cloud_scroll"][0] = val; From 23663234831dac45ba7c2415c7549eaa6dafb823 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 22 May 2019 20:30:50 +0300 Subject: [PATCH 4/7] SL-10562 Cleanup --- indra/newview/llcontrolavatar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index a9282169a2..340a2d311d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -591,7 +591,6 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV std::vector volumes; getAnimatedVolumes(volumes); - // Rebuild mSignaledAnimations from the associated volumes. std::map anims; for (std::vector::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it) { From e54c9987e772690cb649e945c891439a98b9fc0c Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 22 May 2019 20:41:23 +0300 Subject: [PATCH 5/7] SL-10562 Cleanup 2 --- indra/newview/llcontrolavatar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 340a2d311d..d24dac385f 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -591,7 +591,6 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV std::vector volumes; getAnimatedVolumes(volumes); - std::map anims; for (std::vector::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it) { LLVOVolume *volp = *vol_it; From fd51230df64a268aeb18e9a3ec4faf6765ac9d67 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 22 May 2019 21:48:46 +0300 Subject: [PATCH 6/7] SL-11190 Ability to duplicate a group role --- indra/newview/llpanelgrouproles.cpp | 62 +++++++++++++++++++ indra/newview/llpanelgrouproles.h | 4 ++ .../default/xui/en/panel_group_roles.xml | 12 +++- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 52a13304df..0efb234015 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1962,6 +1962,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mRoleDescription(NULL), mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), + mCopyRoleButton(NULL), mCreateRoleButton(NULL), mFirstOpen(TRUE), mHasRoleChange(FALSE) @@ -2012,6 +2013,14 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mCreateRoleButton->setClickedCallback(onCreateRole, this); mCreateRoleButton->setEnabled(FALSE); } + + mCopyRoleButton = + parent->getChild("role_copy", recurse); + if ( mCopyRoleButton ) + { + mCopyRoleButton->setClickedCallback(onCopyRole, this); + mCopyRoleButton->setEnabled(FALSE); + } mDeleteRoleButton = parent->getChild("role_delete", recurse); @@ -2226,6 +2235,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) mRoleTitle->clear(); setFooterEnabled(FALSE); mDeleteRoleButton->setEnabled(FALSE); + mCopyRoleButton->setEnabled(FALSE); } } @@ -2336,6 +2346,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() mSelectedRole = item->getUUID(); buildMembersList(); + mCopyRoleButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE)); can_delete = can_delete && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_DELETE); mDeleteRoleButton->setEnabled(can_delete); @@ -2661,6 +2672,57 @@ void LLPanelGroupRolesSubTab::handleCreateRole() notifyObservers(); } +// static +void LLPanelGroupRolesSubTab::onCopyRole(void* user_data) +{ + LLPanelGroupRolesSubTab* self = static_cast(user_data); + if (!self) return; + + self->handleCopyRole(); +} + +void LLPanelGroupRolesSubTab::handleCopyRole() +{ + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + + if (!gdatap) return; + + LLScrollListItem* role_item = mRolesList->getFirstSelected(); + if (!role_item || role_item->getUUID().isNull()) + { + return; + } + + LLRoleData rd; + if (!gdatap->getRoleData(role_item->getUUID(), rd)) + { + return; + } + + LLUUID new_role_id; + new_role_id.generate(); + rd.mRoleName += "(Copy)"; + gdatap->createRole(new_role_id,rd); + + mRolesList->deselectAllItems(TRUE); + LLSD row; + row["id"] = new_role_id; + row["columns"][0]["column"] = "name"; + row["columns"][0]["value"] = rd.mRoleName; + mRolesList->addElement(row, ADD_BOTTOM, this); + mRolesList->selectByID(new_role_id); + + // put focus on name field and select its contents + if(mRoleName) + { + mRoleName->setFocus(TRUE); + mRoleName->onTabInto(); + gFocusMgr.triggerFocusFlash(); + } + + notifyObservers(); +} + // static void LLPanelGroupRolesSubTab::onDeleteRole(void* user_data) { diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index aafbd242cb..459b77703f 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -269,6 +269,9 @@ public: static void onCreateRole(void*); void handleCreateRole(); + static void onCopyRole(void*); + void handleCopyRole(); + static void onDeleteRole(void*); void handleDeleteRole(); @@ -296,6 +299,7 @@ protected: LLCheckBoxCtrl* mMemberVisibleCheck; LLButton* mDeleteRoleButton; LLButton* mCreateRoleButton; + LLButton* mCopyRoleButton; LLUUID mSelectedRole; BOOL mHasRoleChange; diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 714d4166c0..f15f79e9aa 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -212,7 +212,15 @@ clicking on their names. layout="topleft" left="0" name="role_create" - width="120" /> + width="100" /> +