From cdb15ff15e41c24df477a15beec4881084466ea5 Mon Sep 17 00:00:00 2001 From: "buster@netscape.com" Date: Tue, 6 Oct 1998 08:00:07 +0000 Subject: [PATCH] fixed calculation for width of auto-width cells in constrained layout --- layout/html/table/src/BasicTableLayoutStrategy.cpp | 7 ++----- layout/tables/BasicTableLayoutStrategy.cpp | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/layout/html/table/src/BasicTableLayoutStrategy.cpp b/layout/html/table/src/BasicTableLayoutStrategy.cpp index 443ca2aa8056..c4655bb39414 100644 --- a/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -2171,12 +2171,9 @@ void BasicTableLayoutStrategy::DistributeRemainingSpace(nscoord aTableSpecified // in an auto width table, the column cannot be wider than its max width if (PR_TRUE==aTableIsAutoWidth) { // since the table shrinks to the content width, don't be wider than the content max width - nscoord newColWidth = PR_MIN(colWidth, colFrame->GetMaxColWidth()); - aComputedTableWidth += newColWidth-colWidth; - colWidth = newColWidth; + colWidth = PR_MIN(colWidth, colFrame->GetMaxColWidth()); } - else - aComputedTableWidth += colWidth - startingColWidth; + aComputedTableWidth += colWidth - startingColWidth; if (gsDebug==PR_TRUE) printf(" distribute width to auto columns: column %d was %d, now set to %d\n", colIndex, colFrame->GetEffectiveMaxColWidth(), colWidth); diff --git a/layout/tables/BasicTableLayoutStrategy.cpp b/layout/tables/BasicTableLayoutStrategy.cpp index 443ca2aa8056..c4655bb39414 100644 --- a/layout/tables/BasicTableLayoutStrategy.cpp +++ b/layout/tables/BasicTableLayoutStrategy.cpp @@ -2171,12 +2171,9 @@ void BasicTableLayoutStrategy::DistributeRemainingSpace(nscoord aTableSpecified // in an auto width table, the column cannot be wider than its max width if (PR_TRUE==aTableIsAutoWidth) { // since the table shrinks to the content width, don't be wider than the content max width - nscoord newColWidth = PR_MIN(colWidth, colFrame->GetMaxColWidth()); - aComputedTableWidth += newColWidth-colWidth; - colWidth = newColWidth; + colWidth = PR_MIN(colWidth, colFrame->GetMaxColWidth()); } - else - aComputedTableWidth += colWidth - startingColWidth; + aComputedTableWidth += colWidth - startingColWidth; if (gsDebug==PR_TRUE) printf(" distribute width to auto columns: column %d was %d, now set to %d\n", colIndex, colFrame->GetEffectiveMaxColWidth(), colWidth);