diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2013-12-09 13:02:06 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2013-12-09 13:02:06 +0200 |
commit | 1a456c2e41905e93e393dc2dda0d143ee7611275 (patch) | |
tree | cb3d8aa47803712256194a1f8ef07dcd4c39263e /indra/llui | |
parent | 6212cd2950e334aff93ac577a68627d5801ca646 (diff) |
MAINT-3539 Additional checking was added to avoid possible crash.
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llview.cpp | 89 |
1 files changed, 46 insertions, 43 deletions
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()); + } } } } |