From 6a02f5bbcec2b1a530ceeacb0dc564cfeb7cbc7f Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 11 Dec 2015 19:58:08 +0200 Subject: Initial version of Visual Outfit Browser --- indra/llui/llfocusmgr.cpp | 1 - indra/llui/lllayoutstack.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 547f0bd398..87c50ad465 100755 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -168,7 +168,6 @@ void LLFocusMgr::releaseFocusIfNeeded( LLView* view ) LLUI::removePopup(view); } - void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL keystrokes_only) { // notes if keyboard focus is changed again (by onFocusLost/onFocusReceived) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 69246a2f57..11769760aa 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -283,7 +283,7 @@ void LLLayoutStack::removeChild(LLView* view) if (embedded_panelp) { mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); - delete embedded_panelp; + //delete embedded_panelp; updateFractionalSizes(); mNeedsLayout = true; } -- cgit v1.2.3 From e76b5643effc0a38c28a561ce403c97033419398 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 10 Aug 2016 13:31:25 +0300 Subject: MAINT-6608 FIXED URI parser problem with links with username, password --- indra/llui/llurlentry.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e4848362a7..797fae81c4 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -205,9 +205,15 @@ std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const std::string label; up.extractParts(); - up.glueFirst(label); - std::string query = url.substr(label.size()); - return query; + up.glueFirst(label, false); + + size_t pos = url.find(label); + if (pos == std::string::npos) + { + return ""; + } + pos += label.size(); + return url.substr(pos); } -- cgit v1.2.3 From 471ff40c2c544158158abebcd88070c3c6aaf4c8 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Tue, 9 Aug 2016 17:37:48 +0300 Subject: Reverted change to lllayoutstack.cpp which could possibly cause memory leak --- indra/llui/lllayoutstack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 11769760aa..69246a2f57 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -283,7 +283,7 @@ void LLLayoutStack::removeChild(LLView* view) if (embedded_panelp) { mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); - //delete embedded_panelp; + delete embedded_panelp; updateFractionalSizes(); mNeedsLayout = true; } -- cgit v1.2.3 From 377683a8ed85a0f6dcf78ba0d3c78f2fd9fff5d7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 23 Aug 2016 13:01:19 +0300 Subject: MAINT-6648 FIXED [SECURITY] Link tags do not filter unicode and allow for easy URL spoofing. --- indra/llui/llurlentry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 797fae81c4..27a2456deb 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -183,8 +183,9 @@ bool LLUrlEntryBase::isLinkDisabled() const bool LLUrlEntryBase::isWikiLinkCorrect(std::string url) { - std::string label = getLabelFromWikiLink(url); - return (LLUrlRegistry::instance().hasUrl(label)) ? false : true; + LLWString label = utf8str_to_wstring(getLabelFromWikiLink(url)); + label.erase(std::remove(label.begin(), label.end(), L'\u200B'), label.end()); + return (LLUrlRegistry::instance().hasUrl(wstring_to_utf8str(label))) ? false : true; } std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const -- cgit v1.2.3 From b4ee80b91bfa1bdc427aaf5f5821e2a5590e21f4 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 23 Aug 2016 17:58:36 +0300 Subject: MAINT-6511 Crash in LLFloaterView::restoreAll - exception handling --- indra/llui/llfloater.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 1f9869fadc..b3048a9b16 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2320,7 +2320,17 @@ void LLFloaterView::restoreAll() // make sure all subwindows aren't minimized for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = dynamic_cast(*child_it); + LLFloater* floaterp = nullptr; + try + { + floaterp = dynamic_cast(*child_it); + } + catch (std::exception e) // See MAINT-6511 + { + LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL; + continue; + } + if (floaterp) { floaterp->setMinimized(FALSE); -- cgit v1.2.3 From 534bffb257044c407b8d3d8384ed0223fa9cb709 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 23 Aug 2016 17:58:36 +0300 Subject: MAINT-6511 Crash in LLFloaterView::restoreAll - exception handling --- indra/llui/llfloater.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 1f9869fadc..93ee1ceee3 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2320,7 +2320,17 @@ void LLFloaterView::restoreAll() // make sure all subwindows aren't minimized for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = dynamic_cast(*child_it); + LLFloater* floaterp = NULL; + try + { + floaterp = dynamic_cast(*child_it); + } + catch (std::exception e) // See MAINT-6511 + { + LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL; + continue; + } + if (floaterp) { floaterp->setMinimized(FALSE); -- cgit v1.2.3 From 7ea2f091a69794ce4aa121968175f69d88f0e644 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 25 Aug 2016 17:33:54 +0300 Subject: MAINT-6511 Buildfix --- indra/llui/llfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index b3048a9b16..93ee1ceee3 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2320,7 +2320,7 @@ void LLFloaterView::restoreAll() // make sure all subwindows aren't minimized for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = nullptr; + LLFloater* floaterp = NULL; try { floaterp = dynamic_cast(*child_it); -- cgit v1.2.3 From 9e73d04811f65006198297f527d38f1c6262bdce Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 2 Sep 2016 19:20:31 +0300 Subject: MAINT-6461 crash due to invalid menu pointer during visibility change --- indra/llui/llfloater.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 93ee1ceee3..4f664a1ccc 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2318,19 +2318,10 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) void LLFloaterView::restoreAll() { // make sure all subwindows aren't minimized - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) + child_list_t child_list = *(getChildList()); + for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it) { - LLFloater* floaterp = NULL; - try - { - floaterp = dynamic_cast(*child_it); - } - catch (std::exception e) // See MAINT-6511 - { - LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL; - continue; - } - + LLFloater* floaterp = dynamic_cast(*child_it); if (floaterp) { floaterp->setMinimized(FALSE); -- cgit v1.2.3 From 74ec1116a22f325d0c726c109e0664fda566a7a6 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 2 Sep 2016 19:20:31 +0300 Subject: MAINT-6461 crash due to invalid menu pointer during visibility change --- indra/llui/llfloater.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 93ee1ceee3..4f664a1ccc 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2318,19 +2318,10 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) void LLFloaterView::restoreAll() { // make sure all subwindows aren't minimized - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) + child_list_t child_list = *(getChildList()); + for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it) { - LLFloater* floaterp = NULL; - try - { - floaterp = dynamic_cast(*child_it); - } - catch (std::exception e) // See MAINT-6511 - { - LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL; - continue; - } - + LLFloater* floaterp = dynamic_cast(*child_it); if (floaterp) { floaterp->setMinimized(FALSE); -- cgit v1.2.3 From ff118b7d21633cc020b2fb4c833684b4f98b4e5e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Sep 2016 17:45:12 +0300 Subject: MAINT-6720 Fixed onVisibilityChange() crash in LLTextBase --- indra/llui/lltextbase.cpp | 76 ++++++++++++++++++++++++++--------------------- indra/llui/lltextbase.h | 2 +- 2 files changed, 43 insertions(+), 35 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index c7d7535f87..7061d16dd4 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -181,7 +181,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mMaxTextByteLength( p.max_text_length ), mFont(p.font), mFontShadow(p.font_shadow), - mPopupMenu(NULL), + mPopupMenuHandle(), mReadOnly(p.read_only), mSpellCheck(p.spellcheck), mSpellCheckStart(-1), @@ -1263,9 +1263,10 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c) //virtual void LLTextBase::onVisibilityChange( BOOL new_visibility ) { - if(!new_visibility && mPopupMenu) + LLContextMenu* menu = static_cast(mPopupMenuHandle.get()); + if(!new_visibility && menu) { - mPopupMenu->hide(); + menu->hide(); } LLUICtrl::onVisibilityChange(new_visibility); } @@ -1956,41 +1957,48 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url)); // create and return the context menu from the XUI file - delete mPopupMenu; + + LLContextMenu* menu = static_cast(mPopupMenuHandle.get()); + if (menu) + { + menu->updateParent(NULL); + mPopupMenuHandle.markDead(); + } llassert(LLMenuGL::sMenuContainer != NULL); - mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile(xui_file, LLMenuGL::sMenuContainer, - LLMenuHolderGL::child_registry_t::instance()); - if (mIsFriendSignal) - { - bool isFriend = *(*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); - LLView* addFriendButton = mPopupMenu->getChild("add_friend"); - LLView* removeFriendButton = mPopupMenu->getChild("remove_friend"); + menu = LLUICtrlFactory::getInstance()->createFromFile(xui_file, LLMenuGL::sMenuContainer, + LLMenuHolderGL::child_registry_t::instance()); + if (menu) + { + mPopupMenuHandle = menu->getHandle(); - if (addFriendButton && removeFriendButton) - { - addFriendButton->setEnabled(!isFriend); - removeFriendButton->setEnabled(isFriend); - } - } + if (mIsFriendSignal) + { + bool isFriend = *(*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); + LLView* addFriendButton = menu->getChild("add_friend"); + LLView* removeFriendButton = menu->getChild("remove_friend"); - if (mIsObjectBlockedSignal) - { - bool is_blocked = *(*mIsObjectBlockedSignal)(LLUUID(LLUrlAction::getObjectId(url)), LLUrlAction::getObjectName(url)); - LLView* blockButton = mPopupMenu->getChild("block_object"); - LLView* unblockButton = mPopupMenu->getChild("unblock_object"); + if (addFriendButton && removeFriendButton) + { + addFriendButton->setEnabled(!isFriend); + removeFriendButton->setEnabled(isFriend); + } + } - if (blockButton && unblockButton) - { - blockButton->setVisible(!is_blocked); - unblockButton->setVisible(is_blocked); - } - } - - if (mPopupMenu) - { - mPopupMenu->show(x, y); - LLMenuGL::showPopup(this, mPopupMenu, x, y); - } + if (mIsObjectBlockedSignal) + { + bool is_blocked = *(*mIsObjectBlockedSignal)(LLUUID(LLUrlAction::getObjectId(url)), LLUrlAction::getObjectName(url)); + LLView* blockButton = menu->getChild("block_object"); + LLView* unblockButton = menu->getChild("unblock_object"); + + if (blockButton && unblockButton) + { + blockButton->setVisible(!is_blocked); + unblockButton->setVisible(is_blocked); + } + } + menu->show(x, y); + LLMenuGL::showPopup(this, menu, x, y); + } } void LLTextBase::setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params) diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 85641fd899..3d3a6ca869 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -673,7 +673,7 @@ protected: S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes // support widgets - LLContextMenu* mPopupMenu; + LLHandle mPopupMenuHandle; LLView* mDocumentView; LLScrollContainer* mScroller; -- cgit v1.2.3 From da23e0f925742045013fc09e75b962c65e1cda88 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 13 Sep 2016 20:32:34 +0300 Subject: MAINT-6726 Fixed LLLineEditor menus staying in memory forever --- indra/llui/lllineeditor.cpp | 15 +++++++++++---- indra/llui/lllineeditor.h | 4 +++- indra/llui/lltextbase.cpp | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 492c9315d1..c89e1dac1d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2636,10 +2636,17 @@ void LLLineEditor::showContextMenu(S32 x, S32 y) void LLLineEditor::setContextMenu(LLContextMenu* new_context_menu) { - if (new_context_menu) - mContextMenuHandle = new_context_menu->getHandle(); - else - mContextMenuHandle.markDead(); + LLContextMenu* menu = static_cast(mContextMenuHandle.get()); + if (menu) + { + menu->die(); + mContextMenuHandle.markDead(); + } + + if (new_context_menu) + { + mContextMenuHandle = new_context_menu->getHandle(); + } } void LLLineEditor::setFont(const LLFontGL* font) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index c6d472f59b..ccbd305a16 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -272,7 +272,7 @@ public: void setReplaceNewlinesWithSpaces(BOOL replace); - void setContextMenu(LLContextMenu* new_context_menu); + void resetContextMenu() { setContextMenu(NULL); }; private: // private helper methods @@ -308,6 +308,8 @@ private: virtual S32 getPreeditFontSize() const; virtual LLWString getPreeditString() const { return getWText(); } + void setContextMenu(LLContextMenu* new_context_menu); + protected: LLUIString mText; // The string being edited. std::string mPrevText; // Saved string for 'ESC' revert diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7061d16dd4..20be739286 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1961,7 +1961,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) LLContextMenu* menu = static_cast(mPopupMenuHandle.get()); if (menu) { - menu->updateParent(NULL); + menu->die(); mPopupMenuHandle.markDead(); } llassert(LLMenuGL::sMenuContainer != NULL); -- cgit v1.2.3 From 21fdf0485fc4198ef6b159afb6577cbd31687fc4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 23 Sep 2016 19:45:58 +0300 Subject: MAINT-6747 eliminating convertion error --- indra/llui/llspinctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 8b1ba406c8..d49e216898 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -153,7 +153,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision) for (S32 i = 0; i < decimal_precision; i++) clamped_value *= 10.0; - clamped_value = ll_round((F32)clamped_value); + clamped_value = ll_round(clamped_value); for (S32 i = 0; i < decimal_precision; i++) clamped_value /= 10.0; -- cgit v1.2.3