Compare commits

..

11 Commits

Author SHA1 Message Date
Liru Færs
2f24a53a01 Clean up some code 2020-01-04 12:15:00 -05:00
Liru Færs
28af96229b Cleaner port of Ansariel's fix for Attachment loss on TP/Crossing 2020-01-04 12:07:59 -05:00
Liru Færs
6d776632a9 Fix incorrect Link number in build floater. 2020-01-04 09:39:11 -05:00
Liru Færs
1853500e10 Fix Crash A: mFolders was being used without a null check 2020-01-04 02:57:40 -05:00
Liru Færs
8e01fcb7f0 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-01-02 01:55:02 -05:00
Liru Færs
3cddb0df2e Fix Crashes 1 and 5: LLTextEditor::replaceUrl, call to member
When a boost bind is converted into a suitable slot_function_type,
trackables will no longer be tracked, thus using ternary or static casts
breaks tracking, so old text editors were still receiving signals.
2020-01-01 21:35:07 -05:00
Liru Færs
37c4a4bbcb Fix possible unlinked and bad looking names in general tab of build tools 2020-01-01 13:07:49 -05:00
Router Gray
af8f0e1155 Fix gcc error 'extra qualification on member'. 2020-01-01 06:53:08 -06:00
Liru Færs
5df00a481d Code cleanup, now that erase is a member function 2020-01-01 02:59:52 -05:00
Liru Færs
d299c55ea4 Ve must erase ze kinderlach!!
Fixes Error 3, which was caused by deref of invalidated iterator
2020-01-01 02:59:23 -05:00
Liru Færs
d9d83a6807 Fix potential crash when SinguReplaceLinks is off. 2019-12-31 05:27:06 -05:00
13 changed files with 59 additions and 19 deletions

View File

@@ -3015,8 +3015,7 @@ void LLLineEditor::showContextMenu(S32 x, S32 y)
{
constexpr auto spell_sep = "Spell Check Sep";
// Remove everything after the separator if we added it, because menus don't autodie yet.
for (auto menu_end = menu->end(), menu_it = menu->find(menu->findChild<LLMenuItemGL>(spell_sep)); menu_it != menu_end; ++menu_it)
menu->removeChild(*menu_it);
menu->erase(menu->find(menu->findChild<LLMenuItemGL>(spell_sep)), menu->end());
menu->addSeparator(spell_sep);
// search for word matches

View File

@@ -3167,12 +3167,7 @@ void LLMenuGL::erase( S32 begin, S32 end, bool arrange/* = true*/)
item_list_t::iterator end_position = mItems.begin();
std::advance(end_position, end);
for (item_list_t::iterator position_iter = start_position; position_iter != end_position; position_iter++)
{
LLUICtrl::removeChild(*position_iter);
}
mItems.erase(start_position, end_position);
erase(start_position, end_position);
if (arrange)
{

View File

@@ -527,10 +527,16 @@ public:
// erase group of items from menu
void erase(S32 begin, S32 end, bool arrange = true);
typedef std::list<LLMenuItemGL*> item_list_t;
inline item_list_t::iterator erase(item_list_t::const_iterator first, item_list_t::const_iterator last)
{
for (auto it = first; it != last; ++it)
LLUICtrl::removeChild(*it);
return mItems.erase(first, last);
}
// add new item at position
void insert(S32 begin, LLView* ctrl, bool arrange = true);
typedef std::list<LLMenuItemGL*> item_list_t;
void insert(item_list_t::const_iterator position_iter, LLMenuItemGL* item, bool arrange = true);
// find an item's position
@@ -543,7 +549,7 @@ public:
const item_list_t& getItems() const { return mItems; }
// number of menu items
item_list_t::size_type LLMenuGL::getItemCount() const { return mItems.size(); }
item_list_t::size_type getItemCount() const { return mItems.size(); }
void setItemLastSelected(LLMenuItemGL* item); // must be in menu
LLMenuItemGL* getItem(S32 number); // 0 = first item

View File

@@ -4228,8 +4228,9 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
if (always_underline) link_style->mUnderline = true;
appendAndHighlightText(link, part, link_style, !always_underline/*match.underlineOnHoverOnly()*/);
};
const auto&& cb = force_replace_links ? boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3) : LLUrlLabelCallback();
while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, cb))
const auto&& cb = boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3);
auto& urlr = LLUrlRegistry::instance();
while (!text.empty() && (force_replace_links ? urlr.findUrl(text, match, cb) : urlr.findUrl(text, match)))
{
start = match.getStart();
end = match.getEnd()+1;

View File

@@ -381,6 +381,7 @@ LLAgent::LLAgent() :
mAgentAccess(new LLAgentAccess(gSavedSettings)),
mGodLevelChangeSignal(),
mIsCrossingRegion(false),
mCanEditParcel(false),
mTeleportSourceSLURL(new LLSLURL),
mTeleportRequest(),
@@ -4431,6 +4432,7 @@ void LLAgent::setTeleportState(ETeleportState state)
{
case TELEPORT_NONE:
mbTeleportKeepsLookAt = false;
mIsCrossingRegion = false; // Attachments getting lost on TP; finished TP
break;
case TELEPORT_MOVING:

View File

@@ -739,6 +739,13 @@ private:
** **
*******************************************************************************/
// Attachments getting lost on TP
public:
void setIsCrossingRegion(bool is_crossing) { mIsCrossingRegion = is_crossing; }
bool isCrossingRegion() const { return mIsCrossingRegion; }
private:
bool mIsCrossingRegion;
// Build
public:
bool canEditParcel() const { return mCanEditParcel; }

View File

@@ -2841,6 +2841,12 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
{
if(!category) return;
// Attachments getting lost on TP:
// We'll be sending the outfit change request to our current region,
// so we'll learn them if they've been sending bad kills.
// We don't take kindly to that sorta behaviour round these parts.
gAgent.setIsCrossingRegion(false);
selfClearPhases();
selfStartPhase("wear_inventory_category");

View File

@@ -600,12 +600,12 @@ void LLFloaterTools::refresh()
S32 index = 1;
for (const auto& child : children)
{
++index;
if (child->isSelected())
{
LLResMgr::getInstance()->getIntegerString(value_string, index);
break;
}
++index;
}
}
}

View File

@@ -1712,7 +1712,7 @@ void LLPanelObjectInventory::updateInventory()
// We're still interested in this task's inventory.
uuid_set_t selected_items;
BOOL inventory_has_focus = FALSE;
if (mHaveInventory)
if (mHaveInventory && mFolders)
{
selected_items = mFolders->getSelectionList();
inventory_has_focus = gFocusMgr.childHasKeyboardFocus(mFolders);

View File

@@ -390,7 +390,8 @@ void LLPanelPermissions::refresh()
// Update last owner text field
getChildView("Last Owner:")->setEnabled(TRUE);
std::string owner_app_link;
static const auto none_str = LLTrans::getString("GroupNameNone");
std::string owner_app_link(none_str);
if (auto view = getChild<LLTextBox>("Creator Name"))
{
if (LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, owner_app_link))
@@ -405,6 +406,7 @@ void LLPanelPermissions::refresh()
view->setEnabled(true);
}
owner_app_link = none_str;
const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_app_link);
if (auto view = getChild<LLTextBox>("Owner Name"))
{
@@ -422,6 +424,7 @@ void LLPanelPermissions::refresh()
if (auto view = getChild<LLTextBox>("Last Owner Name"))
{
owner_app_link = none_str;
if (LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, owner_app_link))
{
view->setValue(mLastOwnerID);

View File

@@ -8564,6 +8564,7 @@ void handle_rebake_textures(void*)
{
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
}
gAgent.setIsCrossingRegion(false); // Attachments getting lost on TP
}
void toggle_visibility(void* user_data)

View File

@@ -4904,6 +4904,8 @@ void process_crossed_region(LLMessageSystem* msg, void**)
}
LL_INFOS("Messaging") << "process_crossed_region()" << LL_ENDL;
gAgentAvatarp->resetRegionCrossingTimer();
gAgent.setIsCrossingRegion(false); // Attachments getting lost on TP, region crossing hook
U32 sim_ip;
msg->getIPAddrFast(_PREHASH_RegionData, _PREHASH_SimIP, sim_ip);
@@ -5300,10 +5302,23 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
LLViewerObject *objectp = gObjectList.findObject(id);
if (objectp)
{
if (different_region && gAgentAvatarp == objectp->getAvatar())
if (gAgentAvatarp == objectp->getAvatar())
{
LL_WARNS() << "Region other than our own killing our attachments!!" << LL_ENDL;
continue;
if (different_region)
{
LL_WARNS() << "Region other than our own killing our attachments!!" << LL_ENDL;
continue;
}
else if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
{
LL_WARNS() << "Region killing our attachments during teleport!!" << LL_ENDL;
continue;
}
else if (gAgent.isCrossingRegion())
{
LL_WARNS() << "Region killing our attachments during region cross!!" << LL_ENDL;
continue;
}
}
// Display green bubble on kill
if ( gShowObjectUpdates )
@@ -6804,7 +6819,6 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
std::string llsdRaw;
LLSD llsdBlock;
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_ExtraParams, llsdRaw);
if (llsdRaw.length())
{
@@ -6851,6 +6865,11 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
return true;
}
}
else if (notificationID == "expired_region_handoff" || notificationID == "invalid_region_handoff") // borked region handoff
{
gAgent.setIsCrossingRegion(false); // Attachments getting lost on TP
}
else
// HACK -- handle callbacks for specific alerts.
if (notificationID == "HomePositionSet")
{

View File

@@ -869,6 +869,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)
}
mRegionCrossingTimer.reset();
LLViewerObject::updateRegion(regionp);
gAgent.setIsCrossingRegion(false); // Attachments getting lost on TP
}
//--------------------------------------------------------------------