Compare commits

..

5 Commits

Author SHA1 Message Date
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
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
5 changed files with 16 additions and 12 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

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

@@ -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);