From 01a70022280c12173f12352b145670e06efb3d71 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 26 Sep 2013 00:34:00 +0300 Subject: MAINT-3163 FIXED Since CHUI, floaters can be moved totally underneath bottom toolbar buttons and "lost". --- indra/llui/llfloater.cpp | 31 +++++++++++++++++++++++++++++-- indra/llui/llfloater.h | 6 ++++++ indra/llui/lltoolbar.cpp | 26 ++++++++++++++++++++------ indra/llui/lltoolbar.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 6e6bcd6ab5..c1f8a077b5 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2742,8 +2742,6 @@ void LLFloaterView::refresh() } } -const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; - void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars/* = false*/) { if (floater->getParent() != this) @@ -2796,11 +2794,32 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } } + const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; + const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; + const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; + const LLRect& floater_rect = floater->getRect(); + + S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; + S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; + S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; + // move window fully onscreen if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } + else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) + { + floater->translate(delta_left, 0); + } + else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) + { + floater->translate(0, delta_bottom); + } + else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) + { + floater->translate(delta_right, 0); + } } void LLFloaterView::draw() @@ -3000,6 +3019,14 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) LLFloaterReg::blockShowFloaters(false); } +void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect) +{ + if (tb < LLToolBarEnums::TOOLBAR_COUNT) + { + mToolbarRects[tb] = toolbar_rect; + } +} + void LLFloater::setInstanceName(const std::string& name) { if (name != mInstanceName) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 75715ef296..ccaae1d02b 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -32,6 +32,7 @@ #define LL_FLOATER_H #include "llpanel.h" +#include "lltoolbar.h" #include "lluuid.h" //#include "llnotificationsutil.h" #include @@ -514,6 +515,8 @@ private: // LLFloaterView // Parent of all floating panels +const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; + class LLFloaterView : public LLUICtrl { public: @@ -572,10 +575,13 @@ public: void setFloaterSnapView(LLHandle snap_view) {mSnapView = snap_view; } LLFloater* getFrontmostClosableFloater(); + void setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect); + private: void hiddenFloaterClosed(LLFloater* floater); LLRect mLastSnapRect; + LLRect mToolbarRects[LLToolBarEnums::TOOLBAR_COUNT]; LLHandle mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 6bfe113933..e692d9847a 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -118,7 +118,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mButtonLeaveSignal(NULL), mButtonRemoveSignal(NULL), mDragAndDropTarget(false), - mCaretIcon(NULL) + mCaretIcon(NULL), + mCenterPanel(NULL) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon; @@ -200,14 +201,15 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) center_panel_p.auto_resize = false; center_panel_p.user_resize = false; center_panel_p.mouse_opaque = false; - LLLayoutPanel* center_panel = LLUICtrlFactory::create(center_panel_p); - mCenteringStack->addChild(center_panel); + mCenterPanel = LLUICtrlFactory::create(center_panel_p); + mCenteringStack->addChild(mCenterPanel); LLPanel::Params button_panel_p(p.button_panel); - button_panel_p.rect = center_panel->getLocalRect(); - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; + button_panel_p.rect = mCenterPanel->getLocalRect(); + button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; mButtonPanel = LLUICtrlFactory::create(button_panel_p); - center_panel->addChild(mButtonPanel); + mCenterPanel->setButtonPanel(mButtonPanel); + mCenterPanel->addChild(mButtonPanel); mCenteringStack->addChild(LLUICtrlFactory::create(border_panel_p)); @@ -1244,3 +1246,15 @@ const std::string LLToolBarButton::getToolTip() const return tooltip; } +void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_user) +{ + LLLayoutPanel::handleReshape(rect, by_user); + + if (!mReshapeCallback.empty()) + { + LLRect r; + localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView); + r.stretch(FLOATER_MIN_VISIBLE_PIXELS); + mReshapeCallback(mLocationId, r); + } +} diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 743951a41f..9e17eaed8b 100755 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -125,6 +125,19 @@ namespace LLToolBarEnums SIDE_TOP, }; + enum EToolBarLocation + { + TOOLBAR_NONE = 0, + TOOLBAR_LEFT, + TOOLBAR_RIGHT, + TOOLBAR_BOTTOM, + + TOOLBAR_COUNT, + + TOOLBAR_FIRST = TOOLBAR_LEFT, + TOOLBAR_LAST = TOOLBAR_BOTTOM, + }; + LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType); } @@ -150,6 +163,30 @@ class LLToolBar { friend class LLToolBarButton; public: + + class LLCenterLayoutPanel : public LLLayoutPanel + { + public: + typedef struct LLLayoutPanel::Params Params; + typedef boost::function reshape_callback_t; + + virtual ~LLCenterLayoutPanel() {} + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + + void setLocationId(LLToolBarEnums::EToolBarLocation id) { mLocationId = id; } + void setReshapeCallback(reshape_callback_t cb) { mReshapeCallback = cb; } + void setButtonPanel(LLPanel * panel) { mButtonPanel = panel; } + + protected: + friend class LLUICtrlFactory; + LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mButtonPanel(NULL) {} + + private: + reshape_callback_t mReshapeCallback; + LLToolBarEnums::EToolBarLocation mLocationId; + LLPanel * mButtonPanel; + }; + struct Params : public LLInitParam::Block { Mandatory button_display_mode; @@ -198,6 +235,7 @@ public: void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; } bool isReadOnly() const { return mReadOnly; } + LLCenterLayoutPanel * getCenterLayoutPanel() const { return mCenterPanel; } LLToolBarButton* createButton(const LLCommandId& id); @@ -270,6 +308,7 @@ private: // related widgets LLLayoutStack* mCenteringStack; + LLCenterLayoutPanel* mCenterPanel; LLPanel* mButtonPanel; LLHandle mPopupMenuHandle; LLHandle mRemoveButtonHandle; -- cgit v1.2.3 From ea14f690e2d5b567ecfdf1094f69b78b522efd51 Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 10 Oct 2013 12:00:10 +0300 Subject: MAINT-535 Wiki-style link markup hides potentially malicious secondlife: app URLs Partial fix: disabled URLs in the 'label' part of Wiki-style link --- indra/llui/llurlentry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index b1cc502c4b..840f67968d 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1067,7 +1067,8 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel() std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - return getLabelFromWikiLink(url); + std::string label = getLabelFromWikiLink(url); + return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); } std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const -- cgit v1.2.3 From b0a873570e2d8df1241f9b44759da7f803fe3baf Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Fri, 11 Oct 2013 22:45:12 +0300 Subject: MAINT-3289 (User is not able to open mini inspector by one click on 'i' icon) --- indra/llui/lltexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 62140dd9d6..81d9fd1ec9 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1620,7 +1620,7 @@ BOOL LLTextEditor::handleControlKey(const KEY key, const MASK mask) } } - if (handled) + if (handled && !gFocusMgr.getMouseCapture()) { updatePrimary(); } -- cgit v1.2.3 From 28339afa157956d6ae4e68d0f8ce4eee6a254cfe Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 22 Oct 2013 12:47:16 +0300 Subject: MAINT-535 'trust model' is added for secondlife:// URLs in wiki style links. Chat history is marked as untrusted source now. --- indra/llui/llscrolllistctrl.cpp | 2 +- indra/llui/lltextbase.cpp | 4 +++- indra/llui/lltextbase.h | 5 ++++- indra/llui/llurlaction.cpp | 6 +++--- indra/llui/llurlaction.h | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 6e03f604a2..594e1e150b 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1855,7 +1855,7 @@ void LLScrollListCtrl::showNameDetails(std::string id, bool is_group) // open the resident's details or the group details std::string sltype = is_group ? "group" : "agent"; std::string slurl = "secondlife:///app/" + sltype + "/" + id + "/about"; - LLUrlAction::clickAction(slurl); + LLUrlAction::clickAction(slurl, true); } void LLScrollListCtrl::copyNameToClipboard(std::string id, bool is_group) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5ec4cf4fe5..4144a42fd6 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -167,6 +167,7 @@ LLTextBase::Params::Params() max_text_length("max_length", 255), font_shadow("font_shadow"), wrap("wrap"), + trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), parse_highlights("parse_highlights", false) @@ -211,6 +212,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mLineSpacingPixels(p.line_spacing.pixels), mClip(p.clip), mClipPartial(p.clip_partial && !p.allow_scroll), + mTrustedContent(p.trusted_content), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -3164,7 +3166,7 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUrlAction::clickAction(getStyle()->getLinkHREF()); + LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); return TRUE; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index a74e97cac8..3603f55c3f 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -291,7 +291,8 @@ public: parse_urls, parse_highlights, clip, - clip_partial; + clip_partial, + trusted_content; Optional v_pad, h_pad; @@ -361,6 +362,7 @@ public: bool getWordWrap() { return mWordWrap; } bool getUseEllipses() { return mUseEllipses; } bool truncate(); // returns true of truncation occurred + bool isContentTrusted() {return mTrustedContent;} // TODO: move into LLTextSegment? void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url @@ -634,6 +636,7 @@ protected: bool mBGVisible; // render background? bool mClip; // clip text to widget rect bool mClipPartial; // false if we show lines that are partially inside bounding rect + bool mTrustedContent; // if false, does not allow to execute SURL links from this editor bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index 23e574cb74..12537d9dd1 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -87,14 +87,14 @@ void LLUrlAction::executeSLURL(std::string url) { if (sExecuteSLURLCallback) { - sExecuteSLURLCallback(url); + sExecuteSLURLCallback(url ,true); } } -void LLUrlAction::clickAction(std::string url) +void LLUrlAction::clickAction(std::string url, bool trusted_content) { // Try to handle as SLURL first, then http Url - if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) ) + if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) { if (sOpenURLCallback) { diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index e731376b95..5f3626490c 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -66,7 +66,7 @@ public: static void showLocationOnMap(std::string url); /// perform the appropriate action for left-clicking on a Url - static void clickAction(std::string url); + static void clickAction(std::string url, bool trusted_content); /// copy the label for a Url to the clipboard static void copyLabelToClipboard(std::string url); @@ -86,7 +86,7 @@ public: /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; - typedef boost::function execute_url_callback_t; + typedef boost::function execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); -- cgit v1.2.3 From a873a575dd0e5034313df09c89141e8be581c24e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 19 Nov 2013 13:36:59 +0200 Subject: MAINT-3375 FIXED Do not record visibility change if event logging is off(because it kills fps). --- indra/llui/llview.cpp | 20 +++++++++++++------- indra/llui/llviewereventrecorder.cpp | 2 +- indra/llui/llviewereventrecorder.h | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 20015dca1a..9cc8c951d5 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -645,14 +645,18 @@ void LLView::setVisible(BOOL visible) void LLView::handleVisibilityChange ( BOOL new_visibility ) { BOOL old_visibility; + BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus(); BOOST_FOREACH(LLView* viewp, mChildList) { // only views that are themselves visible will have their overall visibility affected by their ancestors old_visibility=viewp->getVisible(); - if (old_visibility!=new_visibility) + if(log_visibility_change) { - LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget"); + if (old_visibility!=new_visibility) + { + LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget"); + } } if (old_visibility) @@ -660,11 +664,13 @@ void LLView::handleVisibilityChange ( BOOL new_visibility ) viewp->handleVisibilityChange ( new_visibility ); } - // Consider changing returns to confirm success and know which widget grabbed it - // For now assume success and log at highest xui possible - // NOTE we log actual state - which may differ if it somehow failed to set visibility - lldebugs << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl; - + if(log_visibility_change) + { + // Consider changing returns to confirm success and know which widget grabbed it + // For now assume success and log at highest xui possible + // NOTE we log actual state - which may differ if it somehow failed to set visibility + lldebugs << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl; + } } } diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index a352f621eb..546a0f5866 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -31,7 +31,7 @@ LLViewerEventRecorder::LLViewerEventRecorder() { clear(UNDEFINED); - + logEvents = false; // Remove any previous event log file std::string old_log_ui_events_to_llsd_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife_Events_log.old"); LLFile::remove(old_log_ui_events_to_llsd_file); diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h index 72ca643ced..375efcc3de 100644 --- a/indra/llui/llviewereventrecorder.h +++ b/indra/llui/llviewereventrecorder.h @@ -65,7 +65,7 @@ class LLViewerEventRecorder : public LLSingleton std::string get_xui(); void update_xui(std::string xui); - bool getLoggingStatus(); + bool getLoggingStatus(){return logEvents;}; void setEventLoggingOn(); void setEventLoggingOff(); -- cgit v1.2.3 From 4a09065691b6a3461ff2f4541abb3accade207fe Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 9 Dec 2013 13:02:06 +0200 Subject: MAINT-3539 Additional checking was added to avoid possible crash. --- indra/llui/llview.cpp | 89 ++++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 43 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9cc8c951d5..5ee2169b66 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1314,52 +1314,55 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent) // move child views according to reshape flags BOOST_FOREACH(LLView* viewp, mChildList) { - LLRect child_rect( viewp->mRect ); - - if (viewp->followsRight() && viewp->followsLeft()) - { - child_rect.mRight += delta_width; - } - else if (viewp->followsRight()) - { - child_rect.mLeft += delta_width; - child_rect.mRight += delta_width; - } - else if (viewp->followsLeft()) + if (viewp != NULL) { - // left is 0, don't need to adjust coords - } - else - { - // BUG what to do when we don't follow anyone? - // for now, same as followsLeft - } + LLRect child_rect( viewp->mRect ); - if (viewp->followsTop() && viewp->followsBottom()) - { - child_rect.mTop += delta_height; - } - else if (viewp->followsTop()) - { - child_rect.mTop += delta_height; - child_rect.mBottom += delta_height; - } - else if (viewp->followsBottom()) - { - // bottom is 0, so don't need to adjust coords - } - else - { - // BUG what to do when we don't follow? - // for now, same as bottom - } + if (viewp->followsRight() && viewp->followsLeft()) + { + child_rect.mRight += delta_width; + } + else if (viewp->followsRight()) + { + child_rect.mLeft += delta_width; + child_rect.mRight += delta_width; + } + else if (viewp->followsLeft()) + { + // left is 0, don't need to adjust coords + } + else + { + // BUG what to do when we don't follow anyone? + // for now, same as followsLeft + } - S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft; - S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom; - viewp->translate( delta_x, delta_y ); - if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight()) - { - viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + if (viewp->followsTop() && viewp->followsBottom()) + { + child_rect.mTop += delta_height; + } + else if (viewp->followsTop()) + { + child_rect.mTop += delta_height; + child_rect.mBottom += delta_height; + } + else if (viewp->followsBottom()) + { + // bottom is 0, so don't need to adjust coords + } + else + { + // BUG what to do when we don't follow? + // for now, same as bottom + } + + S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft; + S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom; + viewp->translate( delta_x, delta_y ); + if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight()) + { + viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + } } } } -- cgit v1.2.3 From 065bbf7d383c36b8026a923a3837d1e7ea075b76 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 11 Dec 2013 14:42:02 +0200 Subject: MAINT-3553 Another checking is added to avoid possible crash. --- indra/llui/llfloater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c1f8a077b5..acf38afe32 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1951,6 +1951,7 @@ void LLFloater::drawShadow(LLPanel* panel) void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type) { + if (!view) return; child_list_t children = *view->getChildList(); child_list_t::iterator it = children.begin(); -- cgit v1.2.3 From f291995dac53c2aba9d79aef8b6cd91a5c836e9f Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 7 Jan 2014 15:18:29 -0800 Subject: Revert changes made for MAINT-535 to test in a release cohort. --- indra/llui/llscrolllistctrl.cpp | 4 +++- indra/llui/lltextbase.cpp | 10 +++++++--- indra/llui/lltextbase.h | 14 +++++++++----- indra/llui/llurlaction.cpp | 12 +++++++++--- indra/llui/llurlaction.h | 8 ++++++-- indra/llui/llurlentry.cpp | 6 ++++-- 6 files changed, 38 insertions(+), 16 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 594e1e150b..d290413f7a 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1855,7 +1855,9 @@ void LLScrollListCtrl::showNameDetails(std::string id, bool is_group) // open the resident's details or the group details std::string sltype = is_group ? "group" : "agent"; std::string slurl = "secondlife:///app/" + sltype + "/" + id + "/about"; - LLUrlAction::clickAction(slurl, true); + LLUrlAction::clickAction(slurl); + // MAINT-535 reversion test + //LLUrlAction::clickAction(slurl, true); } void LLScrollListCtrl::copyNameToClipboard(std::string id, bool is_group) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 4144a42fd6..b51053ca4c 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -167,7 +167,8 @@ LLTextBase::Params::Params() max_text_length("max_length", 255), font_shadow("font_shadow"), wrap("wrap"), - trusted_content("trusted_content", true), + // MAINT-535 reversion test + // trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), parse_highlights("parse_highlights", false) @@ -212,7 +213,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mLineSpacingPixels(p.line_spacing.pixels), mClip(p.clip), mClipPartial(p.clip_partial && !p.allow_scroll), - mTrustedContent(p.trusted_content), + // MAINT-535 reversion test + // mTrustedContent(p.trusted_content), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -3166,7 +3168,9 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); + LLUrlAction::clickAction(getStyle()->getLinkHREF()); + // MAINT-535 reversion test + // LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); return TRUE; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 3603f55c3f..515e4d4257 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -291,9 +291,11 @@ public: parse_urls, parse_highlights, clip, - clip_partial, - trusted_content; - + clip_partial; + // MAINT-535 reversion test + // clip_partial, + // trusted_content; + Optional v_pad, h_pad; @@ -362,7 +364,8 @@ public: bool getWordWrap() { return mWordWrap; } bool getUseEllipses() { return mUseEllipses; } bool truncate(); // returns true of truncation occurred - bool isContentTrusted() {return mTrustedContent;} + // MAINT-535 reversion test + //bool isContentTrusted() {return mTrustedContent;} // TODO: move into LLTextSegment? void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url @@ -636,7 +639,8 @@ protected: bool mBGVisible; // render background? bool mClip; // clip text to widget rect bool mClipPartial; // false if we show lines that are partially inside bounding rect - bool mTrustedContent; // if false, does not allow to execute SURL links from this editor + // MAINT-535 reversion test + //bool mTrustedContent; // if false, does not allow to execute SURL links from this editor bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index 12537d9dd1..e392a88b6a 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -87,14 +87,20 @@ void LLUrlAction::executeSLURL(std::string url) { if (sExecuteSLURLCallback) { - sExecuteSLURLCallback(url ,true); + sExecuteSLURLCallback(url); + // MAINT-535 reversion test + //sExecuteSLURLCallback(url ,true); } } -void LLUrlAction::clickAction(std::string url, bool trusted_content) +// MAINT-535 reversion test +//void LLUrlAction::clickAction(std::string url, bool trusted_content) +void LLUrlAction::clickAction(std::string url) { // Try to handle as SLURL first, then http Url - if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) + // MAINT-535 reversion test + // if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) + if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) ) { if (sOpenURLCallback) { diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 5f3626490c..407be9a756 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -66,7 +66,9 @@ public: static void showLocationOnMap(std::string url); /// perform the appropriate action for left-clicking on a Url - static void clickAction(std::string url, bool trusted_content); + static void clickAction(std::string url); + // MAINT-535 reversion test + //static void clickAction(std::string url, bool trusted_content); /// copy the label for a Url to the clipboard static void copyLabelToClipboard(std::string url); @@ -86,7 +88,9 @@ public: /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; - typedef boost::function execute_url_callback_t; + typedef boost::function execute_url_callback_t; + // MAINT-535 reversion test + //typedef boost::function execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 840f67968d..2d28ac41b2 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1067,8 +1067,10 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel() std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - std::string label = getLabelFromWikiLink(url); - return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); + // MAINT-535 reversion test + // std::string label = getLabelFromWikiLink(url); + // return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); + return getLabelFromWikiLink(url); } std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const -- cgit v1.2.3 From cfadbe631fbf845db8e26793613dea37ef08d11c Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 10 Jan 2014 13:15:19 -0800 Subject: Revert earlier back-out for MAINT-535 ... it's back in --- indra/llui/llscrolllistctrl.cpp | 4 +--- indra/llui/lltextbase.cpp | 10 +++------- indra/llui/lltextbase.h | 14 +++++--------- indra/llui/llurlaction.cpp | 12 +++--------- indra/llui/llurlaction.h | 8 ++------ indra/llui/llurlentry.cpp | 6 ++---- 6 files changed, 16 insertions(+), 38 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index d290413f7a..594e1e150b 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1855,9 +1855,7 @@ void LLScrollListCtrl::showNameDetails(std::string id, bool is_group) // open the resident's details or the group details std::string sltype = is_group ? "group" : "agent"; std::string slurl = "secondlife:///app/" + sltype + "/" + id + "/about"; - LLUrlAction::clickAction(slurl); - // MAINT-535 reversion test - //LLUrlAction::clickAction(slurl, true); + LLUrlAction::clickAction(slurl, true); } void LLScrollListCtrl::copyNameToClipboard(std::string id, bool is_group) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index b51053ca4c..4144a42fd6 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -167,8 +167,7 @@ LLTextBase::Params::Params() max_text_length("max_length", 255), font_shadow("font_shadow"), wrap("wrap"), - // MAINT-535 reversion test - // trusted_content("trusted_content", true), + trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), parse_highlights("parse_highlights", false) @@ -213,8 +212,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mLineSpacingPixels(p.line_spacing.pixels), mClip(p.clip), mClipPartial(p.clip_partial && !p.allow_scroll), - // MAINT-535 reversion test - // mTrustedContent(p.trusted_content), + mTrustedContent(p.trusted_content), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -3168,9 +3166,7 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUrlAction::clickAction(getStyle()->getLinkHREF()); - // MAINT-535 reversion test - // LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); + LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); return TRUE; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 515e4d4257..3603f55c3f 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -291,11 +291,9 @@ public: parse_urls, parse_highlights, clip, - clip_partial; - // MAINT-535 reversion test - // clip_partial, - // trusted_content; - + clip_partial, + trusted_content; + Optional v_pad, h_pad; @@ -364,8 +362,7 @@ public: bool getWordWrap() { return mWordWrap; } bool getUseEllipses() { return mUseEllipses; } bool truncate(); // returns true of truncation occurred - // MAINT-535 reversion test - //bool isContentTrusted() {return mTrustedContent;} + bool isContentTrusted() {return mTrustedContent;} // TODO: move into LLTextSegment? void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url @@ -639,8 +636,7 @@ protected: bool mBGVisible; // render background? bool mClip; // clip text to widget rect bool mClipPartial; // false if we show lines that are partially inside bounding rect - // MAINT-535 reversion test - //bool mTrustedContent; // if false, does not allow to execute SURL links from this editor + bool mTrustedContent; // if false, does not allow to execute SURL links from this editor bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index e392a88b6a..12537d9dd1 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -87,20 +87,14 @@ void LLUrlAction::executeSLURL(std::string url) { if (sExecuteSLURLCallback) { - sExecuteSLURLCallback(url); - // MAINT-535 reversion test - //sExecuteSLURLCallback(url ,true); + sExecuteSLURLCallback(url ,true); } } -// MAINT-535 reversion test -//void LLUrlAction::clickAction(std::string url, bool trusted_content) -void LLUrlAction::clickAction(std::string url) +void LLUrlAction::clickAction(std::string url, bool trusted_content) { // Try to handle as SLURL first, then http Url - // MAINT-535 reversion test - // if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) - if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) ) + if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) { if (sOpenURLCallback) { diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 407be9a756..5f3626490c 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -66,9 +66,7 @@ public: static void showLocationOnMap(std::string url); /// perform the appropriate action for left-clicking on a Url - static void clickAction(std::string url); - // MAINT-535 reversion test - //static void clickAction(std::string url, bool trusted_content); + static void clickAction(std::string url, bool trusted_content); /// copy the label for a Url to the clipboard static void copyLabelToClipboard(std::string url); @@ -88,9 +86,7 @@ public: /// specify the callbacks to enable this class's functionality typedef boost::function url_callback_t; - typedef boost::function execute_url_callback_t; - // MAINT-535 reversion test - //typedef boost::function execute_url_callback_t; + typedef boost::function execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 2d28ac41b2..840f67968d 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1067,10 +1067,8 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel() std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - // MAINT-535 reversion test - // std::string label = getLabelFromWikiLink(url); - // return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); - return getLabelFromWikiLink(url); + std::string label = getLabelFromWikiLink(url); + return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); } std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const -- cgit v1.2.3 From d7b902d57503dddca59c3d7a772e4f6a454afa7b Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 14 Feb 2014 13:56:36 -0800 Subject: [MAINT-3555] Crash in LLPanel::~LLPanel() on shutdown - Added clear() after DeletePointer() call to hopfully fix this... --- indra/llui/llkeywords.cpp | 2 ++ indra/llui/llscrolllistctrl.cpp | 1 + indra/llui/llscrolllistitem.cpp | 1 + indra/llui/lltabcontainer.cpp | 1 + indra/llui/lltexteditor.cpp | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 26d27d1f34..ddf33cf6e0 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -77,7 +77,9 @@ LLKeywords::~LLKeywords() { std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer()); std::for_each(mLineTokenList.begin(), mLineTokenList.end(), DeletePointer()); + mLineTokenList.clear(); std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); + mDelimiterTokenList.clear(); } BOOL LLKeywords::loadFromFile( const std::string& filename ) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 594e1e150b..7cd49d5a54 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -320,6 +320,7 @@ LLScrollListCtrl::~LLScrollListCtrl() delete mSortCallback; std::for_each(mItemList.begin(), mItemList.end(), DeletePointer()); + mItemList.clear(); std::for_each(mColumns.begin(), mColumns.end(), DeletePairedPointer()); } diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp index 5a1e96ab03..cc7f42e49a 100755 --- a/indra/llui/llscrolllistitem.cpp +++ b/indra/llui/llscrolllistitem.cpp @@ -50,6 +50,7 @@ LLScrollListItem::LLScrollListItem( const Params& p ) LLScrollListItem::~LLScrollListItem() { std::for_each(mColumns.begin(), mColumns.end(), DeletePointer()); + mColumns.clear(); } void LLScrollListItem::addColumn(const LLScrollListCell::Params& p) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 76ba53ec32..2b9286f663 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -281,6 +281,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) LLTabContainer::~LLTabContainer() { std::for_each(mTabList.begin(), mTabList.end(), DeletePointer()); + mTabList.clear(); } //virtual diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 81d9fd1ec9..02c81c0744 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -310,7 +310,7 @@ LLTextEditor::~LLTextEditor() // Scrollbar is deleted by LLView std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); - + mUndoStack.clear(); // context menu is owned by menu holder, not us //delete mContextMenu; } -- cgit v1.2.3 From 38915f119c5bf3d85084b12939ad815f68fefad0 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 14 Feb 2014 14:57:08 -0800 Subject: More memory cleanup of containers after DeletePairedPointer() usage. --- indra/llui/llkeywords.cpp | 1 + indra/llui/llscrolllistctrl.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index ddf33cf6e0..39153977bf 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -76,6 +76,7 @@ inline BOOL LLKeywordToken::isTail(const llwchar* s) const LLKeywords::~LLKeywords() { std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer()); + mWordTokenMap.clear(); std::for_each(mLineTokenList.begin(), mLineTokenList.end(), DeletePointer()); mLineTokenList.clear(); std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7cd49d5a54..d4bbea0f8e 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -322,6 +322,7 @@ LLScrollListCtrl::~LLScrollListCtrl() std::for_each(mItemList.begin(), mItemList.end(), DeletePointer()); mItemList.clear(); std::for_each(mColumns.begin(), mColumns.end(), DeletePairedPointer()); + mColumns.clear(); } -- cgit v1.2.3 From e6c85c46c4e301c54391280f3e63765158ea1708 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 5 Feb 2014 20:45:09 +0200 Subject: MAINT-3555 crash in LLPanel::~LLPanel() on shutdown: - memory leaks fixing; --- indra/llui/llpanel.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index e63b41f97c..17b9b91ba7 100755 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -330,17 +330,16 @@ private: // local static instance for registering a particular panel class template -class LLRegisterPanelClassWrapper -: public LLRegisterPanelClass + class LLPanelInjector { public: - // reigister with either the provided builder, or the generic templated builder - LLRegisterPanelClassWrapper(const std::string& tag); + // register with either the provided builder, or the generic templated builder + LLPanelInjector(const std::string& tag); }; template -LLRegisterPanelClassWrapper::LLRegisterPanelClassWrapper(const std::string& tag) + LLPanelInjector::LLPanelInjector(const std::string& tag) { LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder); } -- cgit v1.2.3 From 7faaaa9b113715827ad7103be1865d83eb67793f Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Thu, 20 Feb 2014 15:23:53 -0800 Subject: [MAINT-3555] Adding a bajillion log messages to (hopefully) narrow down the cause of the crash --- indra/llui/llfloater.cpp | 21 +++++++++++++++++++-- indra/llui/lllayoutstack.cpp | 9 +++++++++ indra/llui/llpanel.cpp | 6 ++++++ indra/llui/lltabcontainer.cpp | 8 ++++++++ indra/llui/lluictrl.cpp | 24 ++++++++++++++++++++++++ indra/llui/llview.cpp | 15 +++++++++++++++ 6 files changed, 81 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index acf38afe32..96964b528e 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -505,31 +505,48 @@ void LLFloater::destroy() // virtual LLFloater::~LLFloater() { + LL_INFOS("Baker") << "[3555] ~LLFloater() -------------------------------------------------" << LL_ENDL; + LLFloaterReg::removeInstance(mInstanceName, mKey); + LL_INFOS("Baker") << "[3555] ~LLFloater() - Does child have keyboard focus?" << LL_ENDL; if( gFocusMgr.childHasKeyboardFocus(this)) { - // Just in case we might still have focus here, release it. - releaseFocus(); + LL_INFOS("Baker") << "[3555] ~LLFloater() - Yes, release the focus." << LL_ENDL; + // Just in case we might still have focus here, release it. + releaseFocus(); } + LL_INFOS("Baker") << "[3555] ~LLFloater() - Setting minimized to false" << LL_ENDL; // This is important so that floaters with persistent rects (i.e., those // created with rect control rather than an LLRect) are restored in their // correct, non-minimized positions. setMinimized( FALSE ); + LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting the drag handle." << LL_ENDL; delete mDragHandle; for (S32 i = 0; i < 4; i++) { + LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting mResizeBar[" << i << "]" << LL_ENDL; delete mResizeBar[i]; + + LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting mResizeHandle[" << i << "]" << LL_ENDL; delete mResizeHandle[i]; } + LL_INFOS("Baker") << "[3555] ~LLFloater() - Setting visibility (false)" << LL_ENDL; setVisible(false); // We're not visible if we're destroyed + + LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing visibility control" << LL_ENDL; storeVisibilityControl(); + + LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing dock state control" << LL_ENDL; storeDockStateControl(); + LL_INFOS("Baker") << "[3555] ~LLFloater() - Delete mMinimizeSignal" << LL_ENDL; delete mMinimizeSignal; + + LL_INFOS("Baker") << "[3555] Exiting ~LLFloater()" << LL_ENDL; } void LLFloater::storeRectControl() diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index c89c0203b4..953025abbf 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -245,9 +245,18 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) LLLayoutStack::~LLLayoutStack() { + LL_INFOS("Baker") << "[3555] ~LLLayoutStack() -------------------------------------------------" << LL_ENDL; + + LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Copying panel pointers." << LL_ENDL; e_panel_list_t panels = mPanels; // copy list of panel pointers + + LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Clearing mPanels." << LL_ENDL; mPanels.clear(); // clear so that removeChild() calls don't cause trouble + + LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Deleing copied panel pointers." << LL_ENDL; std::for_each(panels.begin(), panels.end(), DeletePointer()); + + LL_INFOS("Baker") << "[3555] Exiting ~LLLayoutStack()" << LL_ENDL; } void LLLayoutStack::draw() diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 67472ad166..3ee93150f5 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -126,7 +126,13 @@ LLPanel::LLPanel(const LLPanel::Params& p) LLPanel::~LLPanel() { + LL_INFOS("Baker") << "[3555] ~LLPanel() -------------------------------------------------" << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLPanel() - Deleting mVisibleSignal..." << LL_ENDL; + delete mVisibleSignal; + + LL_INFOS("Baker") << "[3555] ~LLPanel() - deleted." << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLPanel()" << LL_ENDL; } // virtual diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 2b9286f663..203bf5b50e 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -280,8 +280,16 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) LLTabContainer::~LLTabContainer() { + LL_INFOS("Baker") << "[3555] ~LLTabContainer() -------------------------------------------------" << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLTabContainer() - Deleting mTabList contents..." << LL_ENDL; + std::for_each(mTabList.begin(), mTabList.end(), DeletePointer()); + + LL_INFOS("Baker") << "[3555] ~LLTabContainer() - Clearing mTabList" << LL_ENDL; mTabList.clear(); + + LL_INFOS("Baker") << "[3555] ~LLTabContainer() - done." << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLTabContainer()" << LL_ENDL; } //virtual diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 1722bf27bd..801d39ac70 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -207,23 +207,47 @@ void LLUICtrl::initFromParams(const Params& p) LLUICtrl::~LLUICtrl() { + LL_INFOS("Baker") << "[3555] ~LLUICtrl() -------------------------------------------------" << LL_ENDL; + gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - Released focus if needed." << LL_ENDL; + if( gFocusMgr.getTopCtrl() == this ) { + llinfos << "[3555] ~LLUICtrl() - UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; gFocusMgr.removeTopCtrlWithoutCallback( this ); } + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mCommitSignal" << LL_ENDL; delete mCommitSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mValidateSignal" << LL_ENDL; delete mValidateSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseEnterSignal" << LL_ENDL; delete mMouseEnterSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseLeaveSignal" << LL_ENDL; delete mMouseLeaveSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseDownSignal" << LL_ENDL; delete mMouseDownSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseUpSignal" << LL_ENDL; delete mMouseUpSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mRightMouseDownSignal" << LL_ENDL; delete mRightMouseDownSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mRightMouseUpSignal" << LL_ENDL; delete mRightMouseUpSignal; + + LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mDoubleClickSignal" << LL_ENDL; delete mDoubleClickSignal; + + LL_INFOS("Baker") << "[3555] Exiting ~LLUICtrl()" << LL_ENDL; } void default_commit_handler(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 5ee2169b66..daa87e8334 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -150,10 +150,16 @@ LLView::LLView(const LLView::Params& p) LLView::~LLView() { + LL_INFOS("Baker") << "[3555] ~LLView -------------------------------------------------" << LL_ENDL; + + LL_INFOS("Baker") << "[3555] ~LLView() - Dirtying view rect" << LL_ENDL; dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; + LL_INFOS("Baker") << "[3555] ~LLView() - Deleting view " << mName << ":" << (void*) this << LL_ENDL; if (LLView::sIsDrawing) { + LL_INFOS("Baker") << "[3555] ~LLView() - Deleting view " << mName << " during UI draw() phase" << LL_ENDL; + lldebugs << "Deleting view " << mName << " during UI draw() phase" << llendl; } // llassert(LLView::sIsDrawing == FALSE); @@ -163,21 +169,30 @@ LLView::~LLView() if( hasMouseCapture() ) { //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; + LL_INFOS("Baker") << "[3555] ~LLView() - View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << LL_ENDL; gFocusMgr.removeMouseCaptureWithoutCallback( this ); } + LL_INFOS("Baker") << "[3555] ~LLView() - Deleting all children..." << LL_ENDL; deleteAllChildren(); + LL_INFOS("Baker") << "[3555] ~LLView() - done." << LL_ENDL; + if (mParentView != NULL) { + LL_INFOS("Baker") << "[3555] ~LLView() - Removing this child view" << LL_ENDL; mParentView->removeChild(this); } if (mDefaultWidgets) { + LL_INFOS("Baker") << "[3555] ~LLView() - Deleting default widgets" << LL_ENDL; + delete mDefaultWidgets; mDefaultWidgets = NULL; } + + LL_INFOS("Baker") << "[3555] Exiting ~LLView()" << LL_ENDL; } // virtual -- cgit v1.2.3 From bd73465e51397bac59b4acc61d024d2923f023b3 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Tue, 25 Feb 2014 16:41:23 -0800 Subject: [MAINT-3784] - Viewer takes too long to shut down - Removed a lot of logging code to reduce application close time --- indra/llui/llfloater.cpp | 15 +++------------ indra/llui/lllayoutstack.cpp | 9 ++------- indra/llui/llpanel.cpp | 6 ++---- indra/llui/lltabcontainer.cpp | 8 ++------ indra/llui/lluictrl.cpp | 25 +++---------------------- indra/llui/llview.cpp | 15 ++++----------- 6 files changed, 16 insertions(+), 62 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 96964b528e..cc25bfcfeb 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -505,36 +505,29 @@ void LLFloater::destroy() // virtual LLFloater::~LLFloater() { - LL_INFOS("Baker") << "[3555] ~LLFloater() -------------------------------------------------" << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLFloater() -- " << getTitle() << ":" << (void*) this << " ----------------------" << LL_ENDL; LLFloaterReg::removeInstance(mInstanceName, mKey); - LL_INFOS("Baker") << "[3555] ~LLFloater() - Does child have keyboard focus?" << LL_ENDL; if( gFocusMgr.childHasKeyboardFocus(this)) { - LL_INFOS("Baker") << "[3555] ~LLFloater() - Yes, release the focus." << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLFloater() - Release keybaord focus." << LL_ENDL; // Just in case we might still have focus here, release it. releaseFocus(); } - LL_INFOS("Baker") << "[3555] ~LLFloater() - Setting minimized to false" << LL_ENDL; // This is important so that floaters with persistent rects (i.e., those // created with rect control rather than an LLRect) are restored in their // correct, non-minimized positions. setMinimized( FALSE ); - LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting the drag handle." << LL_ENDL; delete mDragHandle; for (S32 i = 0; i < 4; i++) { - LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting mResizeBar[" << i << "]" << LL_ENDL; delete mResizeBar[i]; - - LL_INFOS("Baker") << "[3555] ~LLFloater() - Deleting mResizeHandle[" << i << "]" << LL_ENDL; delete mResizeHandle[i]; } - LL_INFOS("Baker") << "[3555] ~LLFloater() - Setting visibility (false)" << LL_ENDL; setVisible(false); // We're not visible if we're destroyed LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing visibility control" << LL_ENDL; @@ -542,11 +535,9 @@ LLFloater::~LLFloater() LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing dock state control" << LL_ENDL; storeDockStateControl(); - - LL_INFOS("Baker") << "[3555] ~LLFloater() - Delete mMinimizeSignal" << LL_ENDL; delete mMinimizeSignal; - LL_INFOS("Baker") << "[3555] Exiting ~LLFloater()" << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLFloater() " << (void*) this << LL_ENDL; } void LLFloater::storeRectControl() diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 953025abbf..5da0386928 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -245,18 +245,13 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) LLLayoutStack::~LLLayoutStack() { - LL_INFOS("Baker") << "[3555] ~LLLayoutStack() -------------------------------------------------" << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLLayoutStack() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; - LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Copying panel pointers." << LL_ENDL; e_panel_list_t panels = mPanels; // copy list of panel pointers - - LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Clearing mPanels." << LL_ENDL; mPanels.clear(); // clear so that removeChild() calls don't cause trouble - - LL_INFOS("Baker") << "[3555] ~LLLayoutStack() - Deleing copied panel pointers." << LL_ENDL; std::for_each(panels.begin(), panels.end(), DeletePointer()); - LL_INFOS("Baker") << "[3555] Exiting ~LLLayoutStack()" << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLLayoutStack() " << (void*) this << LL_ENDL; } void LLLayoutStack::draw() diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 3ee93150f5..b1c5f2774d 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -126,13 +126,11 @@ LLPanel::LLPanel(const LLPanel::Params& p) LLPanel::~LLPanel() { - LL_INFOS("Baker") << "[3555] ~LLPanel() -------------------------------------------------" << LL_ENDL; - LL_INFOS("Baker") << "[3555] ~LLPanel() - Deleting mVisibleSignal..." << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLPanel() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; delete mVisibleSignal; - LL_INFOS("Baker") << "[3555] ~LLPanel() - deleted." << LL_ENDL; - LL_INFOS("Baker") << "[3555] Exiting ~LLPanel()" << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLPanel() " << (void*) this << LL_ENDL; } // virtual diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 203bf5b50e..26189fcb8c 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -280,16 +280,12 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) LLTabContainer::~LLTabContainer() { - LL_INFOS("Baker") << "[3555] ~LLTabContainer() -------------------------------------------------" << LL_ENDL; - LL_INFOS("Baker") << "[3555] ~LLTabContainer() - Deleting mTabList contents..." << LL_ENDL; + LL_INFOS("Baker") << "[3555] ~LLTabContainer() -- " << getPanelTitle(mCurrentTabIdx) << ":" << (void*) this << " ----------------------" << LL_ENDL; std::for_each(mTabList.begin(), mTabList.end(), DeletePointer()); - - LL_INFOS("Baker") << "[3555] ~LLTabContainer() - Clearing mTabList" << LL_ENDL; mTabList.clear(); - LL_INFOS("Baker") << "[3555] ~LLTabContainer() - done." << LL_ENDL; - LL_INFOS("Baker") << "[3555] Exiting ~LLTabContainer()" << LL_ENDL; + LL_INFOS("Baker") << "[3555] Exiting ~LLTabContainer() " << (void*) this << LL_ENDL; } //virtual diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 801d39ac70..cfb17c14ba 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -207,47 +207,28 @@ void LLUICtrl::initFromParams(const Params& p) LLUICtrl::~LLUICtrl() { - LL_INFOS("Baker") << "[3555] ~LLUICtrl() -------------------------------------------------" << LL_ENDL; + //LL_INFOS("Baker") << "[3555] ~LLUICtrl() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - Released focus if needed." << LL_ENDL; - if( gFocusMgr.getTopCtrl() == this ) { - llinfos << "[3555] ~LLUICtrl() - UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; + //llinfos << "[3555] ~LLUICtrl() - UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; gFocusMgr.removeTopCtrlWithoutCallback( this ); } - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mCommitSignal" << LL_ENDL; delete mCommitSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mValidateSignal" << LL_ENDL; delete mValidateSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseEnterSignal" << LL_ENDL; delete mMouseEnterSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseLeaveSignal" << LL_ENDL; delete mMouseLeaveSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseDownSignal" << LL_ENDL; delete mMouseDownSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mMouseUpSignal" << LL_ENDL; delete mMouseUpSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mRightMouseDownSignal" << LL_ENDL; delete mRightMouseDownSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mRightMouseUpSignal" << LL_ENDL; delete mRightMouseUpSignal; - - LL_INFOS("Baker") << "[3555] ~LLUICtrl() - deleting mDoubleClickSignal" << LL_ENDL; delete mDoubleClickSignal; - LL_INFOS("Baker") << "[3555] Exiting ~LLUICtrl()" << LL_ENDL; + //LL_INFOS("Baker") << "[3555] Exiting ~LLUICtrl()" << LL_ENDL; } void default_commit_handler(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index daa87e8334..10d9616152 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -150,12 +150,10 @@ LLView::LLView(const LLView::Params& p) LLView::~LLView() { - LL_INFOS("Baker") << "[3555] ~LLView -------------------------------------------------" << LL_ENDL; - - LL_INFOS("Baker") << "[3555] ~LLView() - Dirtying view rect" << LL_ENDL; + //LL_INFOS("Baker") << "[3555] ~LLView -- " << mName << ":" << (void*) this << " ----------------------" << LL_ENDL; + dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; - LL_INFOS("Baker") << "[3555] ~LLView() - Deleting view " << mName << ":" << (void*) this << LL_ENDL; if (LLView::sIsDrawing) { LL_INFOS("Baker") << "[3555] ~LLView() - Deleting view " << mName << " during UI draw() phase" << LL_ENDL; @@ -173,26 +171,21 @@ LLView::~LLView() gFocusMgr.removeMouseCaptureWithoutCallback( this ); } - LL_INFOS("Baker") << "[3555] ~LLView() - Deleting all children..." << LL_ENDL; deleteAllChildren(); - LL_INFOS("Baker") << "[3555] ~LLView() - done." << LL_ENDL; - if (mParentView != NULL) { - LL_INFOS("Baker") << "[3555] ~LLView() - Removing this child view" << LL_ENDL; + // LL_INFOS("Baker") << "[3555] ~LLView() - Removing this child view" << LL_ENDL; mParentView->removeChild(this); } if (mDefaultWidgets) { - LL_INFOS("Baker") << "[3555] ~LLView() - Deleting default widgets" << LL_ENDL; - delete mDefaultWidgets; mDefaultWidgets = NULL; } - LL_INFOS("Baker") << "[3555] Exiting ~LLView()" << LL_ENDL; + //LL_INFOS("Baker") << "[3555] Exiting ~LLView() " << (void*) this << LL_ENDL; } // virtual -- cgit v1.2.3 From 100b9154dd00187079529dab7b4076bdac92c027 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 26 Feb 2014 12:49:29 -0800 Subject: MAINT-3555 : crash in LLPanel::~LLPanel() on shutdown. Fixes to be paranoid about the return type for calls to LLView::getParent(): never assume a down cast is possible. --- indra/llui/lldraghandle.cpp | 5 ++- indra/llui/llfloater.cpp | 29 +++++++++---- indra/llui/llmenugl.cpp | 99 +++++++++++++++++++++++++++++++++------------ 3 files changed, 99 insertions(+), 34 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 5f69c6af31..304d21d0df 100755 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -315,14 +315,15 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) S32 delta_y = screen_y - mDragLastScreenY; // if dragging a docked floater we want to undock - if (((LLFloater*)getParent())->isDocked()) + LLFloater * parent = dynamic_cast(getParent()); + if (parent && parent->isDocked()) { const S32 SLOP = 12; if (delta_y <= -SLOP || delta_y >= SLOP) { - ((LLFloater*)getParent())->setDocked(false, false); + parent->setDocked(false, false); return TRUE; } else diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index cc25bfcfeb..e6db65916e 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1146,7 +1146,11 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) if (by_user && !getHost()) { - static_cast(getParent())->adjustToFitScreen(this, !isMinimized()); + LLFloaterView * floaterVp = dynamic_cast(getParent()); + if (floaterVp) + { + floaterVp->adjustToFitScreen(this, !isMinimized()); + } } // if not minimized, adjust all snapped dependents to new shape @@ -1357,7 +1361,8 @@ void LLFloater::setFocus( BOOL b ) if (b) { // only push focused floaters to front of stack if not in midst of ctrl-tab cycle - if (!getHost() && !((LLFloaterView*)getParent())->getCycleMode()) + LLFloaterView * parent = dynamic_cast(getParent()); + if (!getHost() && parent && !parent->getCycleMode()) { if (!isFrontmost()) { @@ -1627,7 +1632,7 @@ void LLFloater::bringToFront( S32 x, S32 y ) } else { - LLFloaterView* parent = (LLFloaterView*) getParent(); + LLFloaterView* parent = dynamic_cast( getParent() ); if (parent) { parent->bringToFront( this ); @@ -1666,7 +1671,11 @@ void LLFloater::setFrontmost(BOOL take_focus) { // there are more than one floater view // so we need to query our parent directly - ((LLFloaterView*)getParent())->bringToFront(this, take_focus); + LLFloaterView * parent = dynamic_cast( getParent() ); + if (parent) + { + parent->bringToFront(this, take_focus); + } // Make sure to set the appropriate transparency type (STORM-732). updateTransparency(hasFocus() || getIsChrome() ? TT_ACTIVE : TT_INACTIVE); @@ -2396,6 +2405,9 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) { + if (!child) + return; + if (mFrontChild == child) { if (give_focus && !gFocusMgr.childHasKeyboardFocus(child)) @@ -2874,10 +2886,13 @@ LLFloater *LLFloaterView::getFocusedFloater() const { for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLUICtrl* ctrlp = (*child_it)->isCtrl() ? static_cast(*child_it) : NULL; - if ( ctrlp && ctrlp->hasFocus() ) + if ((*child_it)->isCtrl()) { - return static_cast(ctrlp); + LLFloater* ctrlp = dynamic_cast(*child_it); + if ( ctrlp && ctrlp->hasFocus() ) + { + return ctrlp; + } } } return NULL; diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f854e1785d..6a57158eaa 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -693,8 +693,11 @@ void LLMenuItemTearOffGL::onCommit() { if (getMenu()->getTornOff()) { - LLTearOffMenu* torn_off_menu = (LLTearOffMenu*)(getMenu()->getParent()); - torn_off_menu->closeFloater(); + LLTearOffMenu * torn_off_menu = dynamic_cast(getMenu()->getParent()); + if (torn_off_menu) + { + torn_off_menu->closeFloater(); + } } else { @@ -1097,7 +1100,8 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) BOOL auto_open = getEnabled() && (!branch->getVisible() || branch->getTornOff()); // torn off menus don't open sub menus on hover unless they have focus - if (getMenu()->getTornOff() && !((LLFloater*)getMenu()->getParent())->hasFocus()) + LLFloater * menu_parent = dynamic_cast(getMenu()->getParent()); + if (getMenu()->getTornOff() && menu_parent && !menu_parent->hasFocus()) { auto_open = FALSE; } @@ -1118,7 +1122,11 @@ void LLMenuItemBranchGL::setHighlight( BOOL highlight ) { if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } branch->clearHoverItem(); } else @@ -1175,11 +1183,19 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) BOOL handled = branch->clearHoverItem(); if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } } if (handled && getMenu()->getTornOff()) { - ((LLFloater*)getMenu()->getParent())->setFocus(TRUE); + LLFloater * menu_parent = dynamic_cast(getMenu()->getParent()); + if (menu_parent) + { + menu_parent->setFocus(TRUE); + } } return handled; } @@ -1219,9 +1235,13 @@ void LLMenuItemBranchGL::openMenu() if (branch->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)branch->getParent()); - // this might not be necessary, as torn off branches don't get focus and hence no highligth - branch->highlightNextItem(NULL); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + gFloaterView->bringToFront(branch_parent); + // this might not be necessary, as torn off branches don't get focus and hence no highligth + branch->highlightNextItem(NULL); + } } else if( !branch->getVisible() ) { @@ -1348,7 +1368,11 @@ void LLMenuItemBranchDownGL::openMenu( void ) { if (branch->getTornOff()) { - gFloaterView->bringToFront((LLFloater*)branch->getParent()); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + gFloaterView->bringToFront(branch_parent); + } } else { @@ -1403,7 +1427,11 @@ void LLMenuItemBranchDownGL::setHighlight( BOOL highlight ) { if (branch->getTornOff()) { - ((LLFloater*)branch->getParent())->setFocus(FALSE); + LLFloater * branch_parent = dynamic_cast(branch->getParent()); + if (branch_parent) + { + branch_parent->setFocus(FALSE); + } branch->clearHoverItem(); } else @@ -1826,20 +1854,28 @@ BOOL LLMenuGL::jumpKeysActive() { LLMenuItemGL* highlighted_item = getHighlightedItem(); BOOL active = getVisible() && getEnabled(); - if (getTornOff()) - { - // activation of jump keys on torn off menus controlled by keyboard focus - active = active && ((LLFloater*)getParent())->hasFocus(); - } - else + if (active) { - // Are we the terminal active menu? - // Yes, if parent menu item deems us to be active (just being visible is sufficient for top-level menus) - // and we don't have a highlighted menu item pointing to an active sub-menu - active = active && (!getParentMenuItem() || getParentMenuItem()->isActive()) // I have a parent that is active... - && (!highlighted_item || !highlighted_item->isActive()); //... but no child that is active + if (getTornOff()) + { + // activation of jump keys on torn off menus controlled by keyboard focus + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + active = parent->hasFocus(); + } + } + else + { + // Are we the terminal active menu? + // Yes, if parent menu item deems us to be active (just being visible is sufficient for top-level menus) + // and we don't have a highlighted menu item pointing to an active sub-menu + active = (!getParentMenuItem() || getParentMenuItem()->isActive()) // I have a parent that is active... + && (!highlighted_item || !highlighted_item->isActive()); //... but no child that is active + } } + return active; } @@ -1855,7 +1891,12 @@ BOOL LLMenuGL::isOpen() return TRUE; } // otherwise we are only active if we have keyboard focus - return ((LLFloater*)getParent())->hasFocus(); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + return parent->hasFocus(); + } + return FALSE; } else { @@ -2714,7 +2755,11 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa // same as giving focus to it if (!cur_item && getTornOff()) { - ((LLFloater*)getParent())->setFocus(TRUE); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + parent->setFocus(TRUE); + } } // Current item position in the items list @@ -2816,7 +2861,11 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa // same as giving focus to it if (!cur_item && getTornOff()) { - ((LLFloater*)getParent())->setFocus(TRUE); + LLFloater * parent = dynamic_cast(getParent()); + if (parent) + { + parent->setFocus(TRUE); + } } // Current item reverse position from the end of the list -- cgit v1.2.3 From 483ad8dc558156b65bf1e0a301fc18040bb038c3 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 26 Feb 2014 20:14:41 +0200 Subject: MAINT-3555 FIXED crash in LLPanel::~LLPanel() on shutdown: - LLFloaterView::mToolbarRects[3] was transformed to LLRect mToolbarLeftRect, mToolbarBottomRect, mToolbarRightRect; --- indra/llui/llfloater.cpp | 27 ++++++++++++++++----------- indra/llui/llfloater.h | 4 +++- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e6db65916e..8e7aa7b22b 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2815,29 +2815,26 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } } - const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; - const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; - const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; const LLRect& floater_rect = floater->getRect(); - S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; - S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; - S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; + S32 delta_left = mToolbarLeftRect.notEmpty() ? mToolbarLeftRect.mRight - floater_rect.mRight : 0; + S32 delta_bottom = mToolbarBottomRect.notEmpty() ? mToolbarBottomRect.mTop - floater_rect.mTop : 0; + S32 delta_right = mToolbarRightRect.notEmpty() ? mToolbarRightRect.mLeft - floater_rect.mLeft : 0; // move window fully onscreen if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } - else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) + else if (delta_left > 0 && floater_rect.mTop < mToolbarLeftRect.mTop && floater_rect.mBottom > mToolbarLeftRect.mBottom) { floater->translate(delta_left, 0); } - else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) + else if (delta_bottom > 0 && floater_rect.mLeft > mToolbarBottomRect.mLeft && floater_rect.mRight < mToolbarBottomRect.mRight) { floater->translate(0, delta_bottom); } - else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) + else if (delta_right < 0 && floater_rect.mTop < mToolbarRightRect.mTop && floater_rect.mBottom > mToolbarRightRect.mBottom) { floater->translate(delta_right, 0); } @@ -3045,9 +3042,17 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect) { - if (tb < LLToolBarEnums::TOOLBAR_COUNT) + switch (tb) { - mToolbarRects[tb] = toolbar_rect; + case LLToolBarEnums::TOOLBAR_LEFT: + mToolbarLeftRect = toolbar_rect; + break; + case LLToolBarEnums::TOOLBAR_BOTTOM: + mToolbarBottomRect = toolbar_rect; + break; + case LLToolBarEnums::TOOLBAR_RIGHT: + mToolbarRightRect = toolbar_rect; + break; } } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ccaae1d02b..12eb3cdbfa 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -581,7 +581,9 @@ private: void hiddenFloaterClosed(LLFloater* floater); LLRect mLastSnapRect; - LLRect mToolbarRects[LLToolBarEnums::TOOLBAR_COUNT]; + LLRect mToolbarLeftRect; + LLRect mToolbarBottomRect; + LLRect mToolbarRightRect; LLHandle mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; -- cgit v1.2.3 From 0a46023db52cce799523e69de433b6b781145ffc Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Wed, 26 Feb 2014 23:52:34 +0000 Subject: Fix linux build - make default check in switch statement --- indra/llui/llfloater.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8e7aa7b22b..2b93237de6 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3053,6 +3053,9 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL case LLToolBarEnums::TOOLBAR_RIGHT: mToolbarRightRect = toolbar_rect; break; + default: + llwarns << "setToolbarRect() passed odd toolbar number " << (S32) tb << llendl; + break; } } -- cgit v1.2.3 From 28d3bb09751aeebb6d7411c426b21c56246f9ff0 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 3 Mar 2014 11:53:57 -0800 Subject: [MAINT-3555][MAINT-3703] - Removed logging for MAINT-3555 - Added NULL guard to fix MAINT-3703 (hopefully) --- indra/llui/llfloater.cpp | 9 --------- indra/llui/lllayoutstack.cpp | 4 ---- indra/llui/llpanel.cpp | 4 ---- indra/llui/lltabcontainer.cpp | 4 ---- indra/llui/lluictrl.cpp | 5 ----- indra/llui/llview.cpp | 8 -------- 6 files changed, 34 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 2b93237de6..c462b2aa52 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -505,13 +505,10 @@ void LLFloater::destroy() // virtual LLFloater::~LLFloater() { - LL_INFOS("Baker") << "[3555] ~LLFloater() -- " << getTitle() << ":" << (void*) this << " ----------------------" << LL_ENDL; - LLFloaterReg::removeInstance(mInstanceName, mKey); if( gFocusMgr.childHasKeyboardFocus(this)) { - LL_INFOS("Baker") << "[3555] ~LLFloater() - Release keybaord focus." << LL_ENDL; // Just in case we might still have focus here, release it. releaseFocus(); } @@ -529,15 +526,9 @@ LLFloater::~LLFloater() } setVisible(false); // We're not visible if we're destroyed - - LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing visibility control" << LL_ENDL; storeVisibilityControl(); - - LL_INFOS("Baker") << "[3555] ~LLFloater() - Storing dock state control" << LL_ENDL; storeDockStateControl(); delete mMinimizeSignal; - - LL_INFOS("Baker") << "[3555] Exiting ~LLFloater() " << (void*) this << LL_ENDL; } void LLFloater::storeRectControl() diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 5da0386928..c89c0203b4 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -245,13 +245,9 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) LLLayoutStack::~LLLayoutStack() { - LL_INFOS("Baker") << "[3555] ~LLLayoutStack() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; - e_panel_list_t panels = mPanels; // copy list of panel pointers mPanels.clear(); // clear so that removeChild() calls don't cause trouble std::for_each(panels.begin(), panels.end(), DeletePointer()); - - LL_INFOS("Baker") << "[3555] Exiting ~LLLayoutStack() " << (void*) this << LL_ENDL; } void LLLayoutStack::draw() diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index b1c5f2774d..67472ad166 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -126,11 +126,7 @@ LLPanel::LLPanel(const LLPanel::Params& p) LLPanel::~LLPanel() { - LL_INFOS("Baker") << "[3555] ~LLPanel() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; - delete mVisibleSignal; - - LL_INFOS("Baker") << "[3555] Exiting ~LLPanel() " << (void*) this << LL_ENDL; } // virtual diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 26189fcb8c..2b9286f663 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -280,12 +280,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) LLTabContainer::~LLTabContainer() { - LL_INFOS("Baker") << "[3555] ~LLTabContainer() -- " << getPanelTitle(mCurrentTabIdx) << ":" << (void*) this << " ----------------------" << LL_ENDL; - std::for_each(mTabList.begin(), mTabList.end(), DeletePointer()); mTabList.clear(); - - LL_INFOS("Baker") << "[3555] Exiting ~LLTabContainer() " << (void*) this << LL_ENDL; } //virtual diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index cfb17c14ba..1722bf27bd 100755 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -207,13 +207,10 @@ void LLUICtrl::initFromParams(const Params& p) LLUICtrl::~LLUICtrl() { - //LL_INFOS("Baker") << "[3555] ~LLUICtrl() -- " << getName() << ":" << (void*) this << " ----------------------" << LL_ENDL; - gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() if( gFocusMgr.getTopCtrl() == this ) { - //llinfos << "[3555] ~LLUICtrl() - UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl; gFocusMgr.removeTopCtrlWithoutCallback( this ); } @@ -227,8 +224,6 @@ LLUICtrl::~LLUICtrl() delete mRightMouseDownSignal; delete mRightMouseUpSignal; delete mDoubleClickSignal; - - //LL_INFOS("Baker") << "[3555] Exiting ~LLUICtrl()" << LL_ENDL; } void default_commit_handler(LLUICtrl* ctrl, const LLSD& param) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 10d9616152..5ee2169b66 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -150,14 +150,10 @@ LLView::LLView(const LLView::Params& p) LLView::~LLView() { - //LL_INFOS("Baker") << "[3555] ~LLView -- " << mName << ":" << (void*) this << " ----------------------" << LL_ENDL; - dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; if (LLView::sIsDrawing) { - LL_INFOS("Baker") << "[3555] ~LLView() - Deleting view " << mName << " during UI draw() phase" << LL_ENDL; - lldebugs << "Deleting view " << mName << " during UI draw() phase" << llendl; } // llassert(LLView::sIsDrawing == FALSE); @@ -167,7 +163,6 @@ LLView::~LLView() if( hasMouseCapture() ) { //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; - LL_INFOS("Baker") << "[3555] ~LLView() - View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << LL_ENDL; gFocusMgr.removeMouseCaptureWithoutCallback( this ); } @@ -175,7 +170,6 @@ LLView::~LLView() if (mParentView != NULL) { - // LL_INFOS("Baker") << "[3555] ~LLView() - Removing this child view" << LL_ENDL; mParentView->removeChild(this); } @@ -184,8 +178,6 @@ LLView::~LLView() delete mDefaultWidgets; mDefaultWidgets = NULL; } - - //LL_INFOS("Baker") << "[3555] Exiting ~LLView() " << (void*) this << LL_ENDL; } // virtual -- cgit v1.2.3