private void PlaceCell(ArrayList someRows, Cell aCell, System.Drawing.Point aPosition) {
int i;
Row row = null;
int rowCount = aPosition.X + aCell.Rowspan - someRows.Count;
AssumeTableDefaults(aCell);
if ( (aPosition.X + aCell.Rowspan) > someRows.Count ) { //create new rows ?
for (i = 0; i < rowCount; i++) {
row = new Row(columns);
someRows.Add(row);
}
}
// reserve cell in rows below
for (i = aPosition.X + 1; i < (aPosition.X + aCell.Rowspan); i++) {
if ( !((Row) someRows[i]).Reserve(aPosition.Y, aCell.Colspan)) {
// should be impossible to come here :-)
throw new Exception("addCell - error in reserve");
}
}
row = (Row) someRows[aPosition.X];
row.AddElement(aCell, aPosition.Y);
}