From 6aa7ddc238b1a8f8a4dd184dd2758f93f6a55bec Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 23 Sep 2011 19:56:07 -0700 Subject: fix for widget registration and crash on login --- indra/llui/lldockcontrol.cpp | 1 + indra/llui/lltoolbar.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index b1c27126d9..7b9084671d 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -97,6 +97,7 @@ void LLDockControl::getAllowedRect(LLRect& rect) void LLDockControl::repositionDockable() { + if (!mDockWidget) return; LLRect dockRect = mDockWidget->calcScreenRect(); LLRect rootRect; mGetAllowedRectCallback(rootRect); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 31a18dc707..96f892d974 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -33,9 +33,7 @@ #include "llcommandmanager.h" #include "lltrans.h" -// uncomment this and remove the one in llui.cpp when there is an external reference to this translation unit -// thanks, MSVC! -//static LLDefaultChildRegistry::Register r1("toolbar"); +static LLDefaultChildRegistry::Register r1("toolbar"); namespace LLToolBarEnums { @@ -264,8 +262,8 @@ void LLToolBar::updateLayoutAsNeeded() std::vector buttons_in_row; - BOOST_FOREACH(LLToolBarButton* button, mButtons) - { + BOOST_FOREACH(LLToolBarButton* button, mButtons) + { button->reshape(mMinButtonWidth, mButtonHeight); button->autoResize(); @@ -296,11 +294,11 @@ void LLToolBar::updateLayoutAsNeeded() cur_start = row_pad_start; cur_row += max_row_girth + mPadBetween; max_row_girth = 0; - } + } LLRect button_rect; if (orientation == LLLayoutStack::HORIZONTAL) - { + { button_rect.setLeftTopAndSize(cur_start, panel_rect.mTop - cur_row, button_clamped_width, button->getRect().getHeight()); } else // VERTICAL @@ -341,7 +339,7 @@ void LLToolBar::updateLayoutAsNeeded() mButtonPanel->translate(mButtonPanel->getRect().getWidth() - total_girth, 0); } mButtonPanel->reshape(total_girth, max_row_length); - } + } // re-center toolbar buttons mCenteringStack->updateLayout(); -- cgit v1.2.3 From c5d930b280c71dfd6ba2f63960c91895083ecc19 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 23 Sep 2011 20:06:35 -0700 Subject: made LLView a possible parent for all default widgets --- indra/llui/llpanel.h | 3 --- indra/llui/llview.h | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 790025cb2d..ab1c87caff 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -96,9 +96,6 @@ public: Params(); }; - // valid children for LLPanel are stored in this registry - typedef LLDefaultChildRegistry child_registry_t; - protected: friend class LLUICtrlFactory; // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 594a5eec6b..43986a3a84 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -95,9 +95,6 @@ private: static std::vector sDrawContextStack; }; -class LLViewWidgetRegistry : public LLChildRegistry -{}; - class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElement { public: @@ -150,7 +147,8 @@ public: Params(); }; - typedef LLViewWidgetRegistry child_registry_t; + // most widgets are valid children of LLView + typedef LLDefaultChildRegistry child_registry_t; void initFromParams(const LLView::Params&); -- cgit v1.2.3