From f86d301fe77bbf506e467833ab6e9e35c8a1e937 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Sun, 15 Sep 2002 03:52:50 +0000 Subject: [PATCH] bug 160014 - re-calc cell spacing total when balancing. a=rjesup, edt=valeski, sr=kin, r=kmcclusk git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@129637 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/BasicTableLayoutStrategy.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index 8c253cd9c00..dc143403381 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -262,6 +262,10 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont maxWidth -= horOffset; maxWidth = PR_MAX(0, maxWidth); + // we will re-calc mCellSpacingTotal in case longer rows were added after Initialize was called + mCellSpacingTotal = 0; + nscoord spacingX = mTableFrame->GetCellSpacingX(); + PRInt32 numNonZeroWidthCols = 0; // set the table's columns to the min width nscoord minTableWidth = 0; @@ -276,6 +280,12 @@ BasicTableLayoutStrategy::BalanceColumnWidths(nsIPresContext* aPresCont (colFrame->GetPctWidth() > 0) || (colFrame->GetWidth(MIN_PRO) > 0)) { numNonZeroWidthCols++; } + if (mTableFrame->GetNumCellsOriginatingInCol(colX) > 0) { + mCellSpacingTotal += spacingX; + } + } + if (mCellSpacingTotal > 0) { + mCellSpacingTotal += spacingX; // add last cell spacing on right } minTableWidth += mCellSpacingTotal;