diff --git a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp index fe0bd79e0b4..6054e1cf2d8 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -1021,6 +1021,10 @@ nsTreeRowGroupFrame::ReflowAfterRowLayout(nsIPresContext* aPresContext, PRInt32 count = 0; ComputeTotalRowCount(count, mContent); // XXX This sucks! Needs to be cheap! + nsTableFrame* tableFrame; + nsTableFrame::GetTableFrame(this, tableFrame); + nsTreeFrame* treeFrame = (nsTreeFrame*)tableFrame; + // Our page size is the # of rows instantiated. PRInt32 pageRowCount; GetRowCount(pageRowCount); @@ -1063,10 +1067,7 @@ nsTreeRowGroupFrame::ReflowAfterRowLayout(nsIPresContext* aPresContext, mScrollbar = nsnull; // Dirty the tree for another reflow. - nsTableFrame* tableFrame; - nsTableFrame::GetTableFrame(this, tableFrame); - - MarkTreeAsDirty(aPresContext, (nsTreeFrame*)tableFrame); + MarkTreeAsDirty(aPresContext, treeFrame); } } @@ -1089,6 +1090,12 @@ nsTreeRowGroupFrame::ReflowAfterRowLayout(nsIPresContext* aPresContext, if (rowCount < 0) rowCount = 0; + // Subtract one from our maxpos if we're a fixed row height. + PRInt32 rowSize = treeFrame->GetFixedRowSize(); + if (rowSize != -1) { + rowCount--; + } + nsAutoString maxpos; if (!mIsFull) { // We are not full. This means that we are not allowed to scroll any further. We are @@ -1411,9 +1418,22 @@ PRBool nsTreeRowGroupFrame::ContinueReflow(nsIFrame* aFrame, nsIPresContext* aPr } PRBool reflowStopped = treeFrame->IsReflowHalted(); + /*if (reflowStopped) { + // This is only hit for fixed row trees (e.g., rows="3") + nsCOMPtr nextRow; + nsCOMPtr treeContent; + treeFrame->GetContent(getter_AddRefs(treeContent)); + + FindRowContentAtIndex(rowSize, treeContent, + getter_AddRefs(nextRow)); + + if (nextRow) + mIsFull = PR_TRUE; + }*/ if ((rowSize == -1 && height <= 0) || reflowStopped) { mIsFull = PR_TRUE; + nsIFrame* lastChild = GetLastFrame(); nsIFrame* startingPoint = mBottomFrame; if (startingPoint == nsnull) {