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