To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=79482


User linox changed the following:

                What    |Old value                 |New value
================================================================================
                 Summary|InsertCellAt loops on a ch|Table.InsertCellAt loops o
                        |anging collection and thro|n a changing collection an
                        |ws an exception           |d throws an exception. Mor
                        |                          |eover it doesn't respect t
                        |                          |he zero based index
--------------------------------------------------------------------------------




------- Additional comments from [EMAIL PROTECTED] Thu Jul 12 07:08:32 +0000 
2007 -------
I found that even with the fix the method doesn't respect the "zero based index"
param spec.

Table.InsertCellAt(0,0) should insert at "A1"
This is a more complete and clean patch:

diff -w -b -i -r1.3 Table.cs
210,211c210,211
<               /// Inserts the cell at the specified position. Both indexes 
are zero
<               /// based indexes!
---
>               /// Inserts the cell at the specified position. 
>               /// Both indexes are zero based indexes!
220,223c220,221
<                       if(this.RowCollection.Count <= rowIndex)
<                       {
<                               for(int i=0; i < 
rowIndex-this.RowCollection.Count; i++)
<                                       this.RowCollection.Add(new Row(this,
"row"+this.RowCollection.Count.ToString()+i.ToString()));
---
>             for (int i = this.RowCollection.Count; i <= rowIndex; i++)
>                 this.RowCollection.Add(new Row(this, "row" + i.ToString()));
225,239c223,224
<                               
this.RowCollection[rowIndex-1].InsertCellAt(columnIndex-1, cell);
<                               cell.Row                                = 
this.RowCollection[rowIndex-1];
<                       }
<                       else if(this.RowCollection.Count+1 == rowIndex)
<                       {
<                               Row row                                 = new 
Row(this,
this.RowCollection[this.RowCollection.Count-1].StyleName);
<                               row.InsertCellAt(columnIndex-1, cell);
<                               cell.Row                                = row;
<                               this.RowCollection.Add(row);
<                       }
<                       else
<                       {
<                               
this.RowCollection[rowIndex-1].InsertCellAt(columnIndex-1, cell);
<                               cell.Row                                = 
this.RowCollection[rowIndex-1];
<                       }
---
>                       this.RowCollection[rowIndex].InsertCellAt(columnIndex, 
> cell);
>                       cell.Row = this.RowCollection[rowIndex];

and

diff -w -b -i -r1.2 Row.cs
174,177c174
<                       if(this.CellCollection.Count <= position)
<                       {
<                               //3 - 5 = 6, 5 - 5 = 6
<                               for(int i=0; i < 
position-this.CellCollection.Count; i++)
---
>             for (int i = this.CellCollection.Count; i < position; i++)
179,186c176
<                               this.CellCollection.Add(cell);
<                       }
<                       else if(this.CellCollection.Count+1 == position)
<                       {
<                               this.CellCollection.Add(cell);
<                       }
<                       else
<                       {
---
> 
189d178
<               }


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to