From 3cf48ce9809add3a435c8b146b2c2df43464fcd5 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Mon, 17 Jan 2000 05:58:19 +0000 Subject: [PATCH] Scrollbar tweaks. git-svn-id: svn://10.0.0.236/trunk@57993 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xul/base/src/nsTreeRowGroupFrame.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) 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) {