From b41b54e79eb24ccdc1eb3f4d99e58e3f34373ab2 Mon Sep 17 00:00:00 2001 From: "kyle.yuan%sun.com" Date: Thu, 18 Jul 2002 02:19:12 +0000 Subject: [PATCH] Bug 131883 All filenames of attachment disappeared by resizing attachment area; r=hewitt, sr=scc, a=scc Force listitem's rect to be recalculated when its parent was going wider. --- layout/xul/base/src/nsListBoxLayout.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layout/xul/base/src/nsListBoxLayout.cpp b/layout/xul/base/src/nsListBoxLayout.cpp index e9bbf9e07e6..f6a2e8211e8 100644 --- a/layout/xul/base/src/nsListBoxLayout.cpp +++ b/layout/xul/base/src/nsListBoxLayout.cpp @@ -212,10 +212,12 @@ nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState) box->HasDirtyChildren(dirtyChildren); nsRect childRect; + box->GetBounds(childRect); box->GetMargin(margin); // relayout if we must or we are dirty or some of our children are dirty - if (relayout || dirty || dirtyChildren) { + // or the client area is wider than us + if (relayout || dirty || dirtyChildren || childRect.width < clientRect.width) { childRect.x = 0; childRect.y = yOffset; childRect.width = clientRect.width; @@ -232,7 +234,6 @@ nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState) } else { // if the child did not need to be relayed out. Then its easy. // Place the child by just grabbing its rect and adjusting the y. - box->GetBounds(childRect); PRInt32 newPos = yOffset+margin.top; // are we pushing down or pulling up any rows?