From 0fb904927259aa45250733dc24994c51fc048bf2 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Mon, 3 Jan 2000 00:56:12 +0000 Subject: [PATCH] fixed tinderbox warnings git-svn-id: svn://10.0.0.236/trunk@56650 18797224-902f-48f8-a5cc-f745e15eee43 --- .../table/src/BasicTableLayoutStrategy.cpp | 4 +--- mozilla/layout/html/table/src/nsCellMap.cpp | 22 +++++++------------ .../layout/html/table/src/nsTableColFrame.cpp | 1 - .../html/table/src/nsTableColGroupFrame.cpp | 4 ---- .../layout/html/table/src/nsTableFrame.cpp | 1 - .../tables/BasicTableLayoutStrategy.cpp | 4 +--- mozilla/layout/tables/nsCellMap.cpp | 22 +++++++------------ mozilla/layout/tables/nsTableColFrame.cpp | 1 - .../layout/tables/nsTableColGroupFrame.cpp | 4 ---- mozilla/layout/tables/nsTableFrame.cpp | 1 - 10 files changed, 18 insertions(+), 46 deletions(-) diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index a73ebf88631..4d501b4fc7d 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -433,7 +433,7 @@ nscoord GetConstrainedWidth(nsTableColFrame* colFrame, { nscoord conWidth = WIDTH_NOT_SET; if (aConsiderPct) { - nscoord conWidth = colFrame->GetPctWidth(); + conWidth = colFrame->GetPctWidth(); } if (conWidth <= 0 ) { conWidth = colFrame->GetFixWidth(); @@ -1268,8 +1268,6 @@ PRBool BasicTableLayoutStrategy::RecomputeAdjMinIfNecessary() return PR_FALSE; } - nscoord spacingX = mTableFrame->GetCellSpacingX(); - for (colX = numCols - 1; colX >= 0; colX--) { for (rowX = 0; rowX < numRows; rowX++) { PRBool originates; diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp index 57c0734c953..059e49b708a 100644 --- a/mozilla/layout/html/table/src/nsCellMap.cpp +++ b/mozilla/layout/html/table/src/nsCellMap.cpp @@ -156,8 +156,6 @@ nsCellMap::InsertRows(nsVoidArray& aRows, return; } - PRInt32 numMapRows = mRows.Count(); - // if any cells span into or out of the row being inserted, then rebuild PRBool spansCauseRebuild = CellsSpanInOrOut(aFirstRowIndex, aFirstRowIndex, 0, numCols - 1); @@ -446,7 +444,6 @@ nsCellMap::ExpandWithRows(nsVoidArray& aRowFrames, PRInt32 numNewRows = aRowFrames.Count();; PRInt32 origNumCols = mCols.Count(); PRInt32 endRowIndex = aStartRowIndex + numNewRows - 1; - PRInt32 numMapRows = mRows.Count(); // create the new rows first PRInt32 newRowIndex = 0; @@ -639,7 +636,6 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellFrame& aCellFrame, PRInt32 rowX; for (rowX = aRowIndex; rowX <= endRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); - PRInt32 colX; for (colX = aColIndex; colX <= endColIndex; colX++) { row->RemoveElementAt(colX); } @@ -650,12 +646,11 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellFrame& aCellFrame, } PRInt32 numCols = mCols.Count(); - PRInt32 numRows = mRows.Count(); // update the row and col info due to shifting for (rowX = aRowIndex; rowX <= endRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); - for (PRInt32 colX = aColIndex; colX < numCols - colSpan; colX++) { + for (colX = aColIndex; colX < numCols - colSpan; colX++) { CellData* data = (CellData*) row->ElementAt(colX); if (data) { if (data->mOrigCell) { @@ -698,9 +693,9 @@ nsCellMap::RemoveUnusedCols(PRInt32 aMaxToRemove) } else { // remove the col from the cols array - nsColInfo* colInfo = (nsColInfo *) mCols.ElementAt(colX); - delete colInfo; + colInfo = (nsColInfo *) mCols.ElementAt(colX); mCols.RemoveElementAt(colX); + delete colInfo; PRInt32 numMapRows = mRows.Count(); // remove the col from each of the rows @@ -725,19 +720,18 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, nsVoidArray* aRowsToInsert, PRBool aNumRowsToRemove) { - PRInt32 numNewRows = 0; // copy the old cell map into a new array PRInt32 numOrigRows = mRows.Count(); PRInt32 numOrigCols = mCols.Count(); void** origRows = new void*[numOrigRows]; if (!origRows) return; - PRInt32 rowX; + PRInt32 rowX, colX; // copy the orig rows for (rowX = 0; rowX < numOrigRows; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); origRows[rowX] = row; } - for (PRInt32 colX = 0; colX < numOrigCols; colX++) { + for (colX = 0; colX < numOrigCols; colX++) { nsColInfo* colInfo = (nsColInfo *)mCols.ElementAt(colX); colInfo->mNumCellsOrig = 0; } @@ -752,7 +746,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (rowX = 0; rowX < aStartRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)origRows[rowX]; PRInt32 numCols = row->Count(); - for (PRInt32 colX = 0; colX < numCols; colX++) { + for (colX = 0; colX < numCols; colX++) { // put in the original cell from the cell map CellData* data = (CellData*) row->ElementAt(colX); if (data && data->mOrigCell) { @@ -792,7 +786,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (PRInt32 copyRowX = copyStartRowIndex; copyRowX <= copyEndRowIndex; copyRowX++) { nsVoidArray* row = (nsVoidArray *)origRows[copyRowX]; PRInt32 numCols = row->Count(); - for (PRInt32 colX = 0; colX < numCols; colX++) { + for (colX = 0; colX < numCols; colX++) { // put in the original cell from the cell map CellData* data = (CellData*) row->ElementAt(colX); if (data && data->mOrigCell) { @@ -808,7 +802,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (rowX = 0; rowX < numOrigRows; rowX++) { nsVoidArray* row = (nsVoidArray *)origRows[rowX]; PRInt32 len = row->Count(); - for (PRInt32 colX = 0; colX < len; colX++) { + for (colX = 0; colX < len; colX++) { CellData* data = (CellData*) row->ElementAt(colX); delete data; } diff --git a/mozilla/layout/html/table/src/nsTableColFrame.cpp b/mozilla/layout/html/table/src/nsTableColFrame.cpp index 55bea8a6e68..9e6184fd233 100644 --- a/mozilla/layout/html/table/src/nsTableColFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColFrame.cpp @@ -149,7 +149,6 @@ NS_METHOD nsTableColFrame::Reflow(nsIPresContext* aPresContext, PRInt32 nsTableColFrame::GetSpan() { - PRInt32 span = 1; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); return tableStyle->mSpan; diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp index 64463664974..015096e766c 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp @@ -594,9 +594,6 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsIPresContext* aPresC { nsresult rv; - // Remember the old col count - const PRInt32 oldColCount = GetColCount(); - // Pass along the reflow command nsHTMLReflowMetrics desiredSize(nsnull); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aNextFrame, @@ -613,7 +610,6 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsIPresContext* aPresC // compare the new col count to the old col count. // If they are the same, we just need to rebalance column widths // If they differ, we need to fix up other column groups and the column cache - const PRInt32 newColCount = GetColCount(); tableFrame->InvalidateColumnWidths(); } return rv; diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index dc73a34657e..eee1bf364b1 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -976,7 +976,6 @@ nsTableFrame::InsertRows(nsIPresContext& aPresContext, PR_TRUE); } if (aRowIndex < origNumRows) { - PRInt32 numNewRows = aRowFrames.Count(); AdjustRowIndices(aRowIndex, numNewRows); } // assign the correct row indices to the new rows. If they were adjusted above diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index a73ebf88631..4d501b4fc7d 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -433,7 +433,7 @@ nscoord GetConstrainedWidth(nsTableColFrame* colFrame, { nscoord conWidth = WIDTH_NOT_SET; if (aConsiderPct) { - nscoord conWidth = colFrame->GetPctWidth(); + conWidth = colFrame->GetPctWidth(); } if (conWidth <= 0 ) { conWidth = colFrame->GetFixWidth(); @@ -1268,8 +1268,6 @@ PRBool BasicTableLayoutStrategy::RecomputeAdjMinIfNecessary() return PR_FALSE; } - nscoord spacingX = mTableFrame->GetCellSpacingX(); - for (colX = numCols - 1; colX >= 0; colX--) { for (rowX = 0; rowX < numRows; rowX++) { PRBool originates; diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp index 57c0734c953..059e49b708a 100644 --- a/mozilla/layout/tables/nsCellMap.cpp +++ b/mozilla/layout/tables/nsCellMap.cpp @@ -156,8 +156,6 @@ nsCellMap::InsertRows(nsVoidArray& aRows, return; } - PRInt32 numMapRows = mRows.Count(); - // if any cells span into or out of the row being inserted, then rebuild PRBool spansCauseRebuild = CellsSpanInOrOut(aFirstRowIndex, aFirstRowIndex, 0, numCols - 1); @@ -446,7 +444,6 @@ nsCellMap::ExpandWithRows(nsVoidArray& aRowFrames, PRInt32 numNewRows = aRowFrames.Count();; PRInt32 origNumCols = mCols.Count(); PRInt32 endRowIndex = aStartRowIndex + numNewRows - 1; - PRInt32 numMapRows = mRows.Count(); // create the new rows first PRInt32 newRowIndex = 0; @@ -639,7 +636,6 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellFrame& aCellFrame, PRInt32 rowX; for (rowX = aRowIndex; rowX <= endRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); - PRInt32 colX; for (colX = aColIndex; colX <= endColIndex; colX++) { row->RemoveElementAt(colX); } @@ -650,12 +646,11 @@ void nsCellMap::ShrinkWithoutCell(nsTableCellFrame& aCellFrame, } PRInt32 numCols = mCols.Count(); - PRInt32 numRows = mRows.Count(); // update the row and col info due to shifting for (rowX = aRowIndex; rowX <= endRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); - for (PRInt32 colX = aColIndex; colX < numCols - colSpan; colX++) { + for (colX = aColIndex; colX < numCols - colSpan; colX++) { CellData* data = (CellData*) row->ElementAt(colX); if (data) { if (data->mOrigCell) { @@ -698,9 +693,9 @@ nsCellMap::RemoveUnusedCols(PRInt32 aMaxToRemove) } else { // remove the col from the cols array - nsColInfo* colInfo = (nsColInfo *) mCols.ElementAt(colX); - delete colInfo; + colInfo = (nsColInfo *) mCols.ElementAt(colX); mCols.RemoveElementAt(colX); + delete colInfo; PRInt32 numMapRows = mRows.Count(); // remove the col from each of the rows @@ -725,19 +720,18 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, nsVoidArray* aRowsToInsert, PRBool aNumRowsToRemove) { - PRInt32 numNewRows = 0; // copy the old cell map into a new array PRInt32 numOrigRows = mRows.Count(); PRInt32 numOrigCols = mCols.Count(); void** origRows = new void*[numOrigRows]; if (!origRows) return; - PRInt32 rowX; + PRInt32 rowX, colX; // copy the orig rows for (rowX = 0; rowX < numOrigRows; rowX++) { nsVoidArray* row = (nsVoidArray *)mRows.ElementAt(rowX); origRows[rowX] = row; } - for (PRInt32 colX = 0; colX < numOrigCols; colX++) { + for (colX = 0; colX < numOrigCols; colX++) { nsColInfo* colInfo = (nsColInfo *)mCols.ElementAt(colX); colInfo->mNumCellsOrig = 0; } @@ -752,7 +746,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (rowX = 0; rowX < aStartRowIndex; rowX++) { nsVoidArray* row = (nsVoidArray *)origRows[rowX]; PRInt32 numCols = row->Count(); - for (PRInt32 colX = 0; colX < numCols; colX++) { + for (colX = 0; colX < numCols; colX++) { // put in the original cell from the cell map CellData* data = (CellData*) row->ElementAt(colX); if (data && data->mOrigCell) { @@ -792,7 +786,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (PRInt32 copyRowX = copyStartRowIndex; copyRowX <= copyEndRowIndex; copyRowX++) { nsVoidArray* row = (nsVoidArray *)origRows[copyRowX]; PRInt32 numCols = row->Count(); - for (PRInt32 colX = 0; colX < numCols; colX++) { + for (colX = 0; colX < numCols; colX++) { // put in the original cell from the cell map CellData* data = (CellData*) row->ElementAt(colX); if (data && data->mOrigCell) { @@ -808,7 +802,7 @@ nsCellMap::RebuildConsideringRows(PRInt32 aStartRowIndex, for (rowX = 0; rowX < numOrigRows; rowX++) { nsVoidArray* row = (nsVoidArray *)origRows[rowX]; PRInt32 len = row->Count(); - for (PRInt32 colX = 0; colX < len; colX++) { + for (colX = 0; colX < len; colX++) { CellData* data = (CellData*) row->ElementAt(colX); delete data; } diff --git a/mozilla/layout/tables/nsTableColFrame.cpp b/mozilla/layout/tables/nsTableColFrame.cpp index 55bea8a6e68..9e6184fd233 100644 --- a/mozilla/layout/tables/nsTableColFrame.cpp +++ b/mozilla/layout/tables/nsTableColFrame.cpp @@ -149,7 +149,6 @@ NS_METHOD nsTableColFrame::Reflow(nsIPresContext* aPresContext, PRInt32 nsTableColFrame::GetSpan() { - PRInt32 span = 1; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); return tableStyle->mSpan; diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index 64463664974..015096e766c 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -594,9 +594,6 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsIPresContext* aPresC { nsresult rv; - // Remember the old col count - const PRInt32 oldColCount = GetColCount(); - // Pass along the reflow command nsHTMLReflowMetrics desiredSize(nsnull); nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aNextFrame, @@ -613,7 +610,6 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsIPresContext* aPresC // compare the new col count to the old col count. // If they are the same, we just need to rebalance column widths // If they differ, we need to fix up other column groups and the column cache - const PRInt32 newColCount = GetColCount(); tableFrame->InvalidateColumnWidths(); } return rv; diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index dc73a34657e..eee1bf364b1 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -976,7 +976,6 @@ nsTableFrame::InsertRows(nsIPresContext& aPresContext, PR_TRUE); } if (aRowIndex < origNumRows) { - PRInt32 numNewRows = aRowFrames.Count(); AdjustRowIndices(aRowIndex, numNewRows); } // assign the correct row indices to the new rows. If they were adjusted above