bug 42443 - consider over specified col spans when allocating array, sr=buster

This commit is contained in:
karnaze%netscape.com 2000-12-21 23:06:44 +00:00
parent 72e4c1afd4
commit 5e96046abb
2 changed files with 6 additions and 4 deletions

View File

@ -1081,7 +1081,8 @@ BasicTableLayoutStrategy::AssignPctColumnWidths(const nsHTMLReflowState aReflowS
// on percent cells/cols. This probably should only be a NavQuirks thing, since
// a percentage based cell or column on an auto table should force the column to auto
basis = 0;
float* rawPctValues = new float[numCols]; // store the raw pct values
float* rawPctValues = new float[mTableFrame->GetColCount()]; // store the raw pct values, allow for spans past the effective numCols
if (!rawPctValues) return NS_ERROR_OUT_OF_MEMORY;
for (colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
if (!colFrame) continue;
@ -1383,7 +1384,7 @@ nscoord BasicTableLayoutStrategy::GetTableMaxWidth(const nsHTMLReflowState& aRef
if (mTableFrame->IsAutoWidth()) {
nscoord spacingX = mTableFrame->GetCellSpacingX();
PRInt32 numCols = mTableFrame->GetColCount();
PRInt32 numCols = mTableFrame->GetEffectiveColCount();
for (PRInt32 colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
if (!colFrame) continue;

View File

@ -1081,7 +1081,8 @@ BasicTableLayoutStrategy::AssignPctColumnWidths(const nsHTMLReflowState aReflowS
// on percent cells/cols. This probably should only be a NavQuirks thing, since
// a percentage based cell or column on an auto table should force the column to auto
basis = 0;
float* rawPctValues = new float[numCols]; // store the raw pct values
float* rawPctValues = new float[mTableFrame->GetColCount()]; // store the raw pct values, allow for spans past the effective numCols
if (!rawPctValues) return NS_ERROR_OUT_OF_MEMORY;
for (colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
if (!colFrame) continue;
@ -1383,7 +1384,7 @@ nscoord BasicTableLayoutStrategy::GetTableMaxWidth(const nsHTMLReflowState& aRef
if (mTableFrame->IsAutoWidth()) {
nscoord spacingX = mTableFrame->GetCellSpacingX();
PRInt32 numCols = mTableFrame->GetColCount();
PRInt32 numCols = mTableFrame->GetEffectiveColCount();
for (PRInt32 colX = 0; colX < numCols; colX++) {
nsTableColFrame* colFrame = mTableFrame->GetColFrame(colX);
if (!colFrame) continue;