Menu

#32 Spreadsheet Exception: if 2nd table has more rows than 1st

open
nobody
None
5
2007-06-14
2007-06-14
Anonymous
No

spreadsheet is crashing if you insert more rows in the second table than the first table has(same for higher tables).

exception:
{"Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.\r\nParametername: index"}

bei System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index)\r\n
bei AODL.Document.Content.Tables.RowCollection.get_Item(Int32 index) in odftoolkit\\aodl\\AODL\\Document\\Content\\Tables\\RowCollection.cs:Zeile 96.\r\n
bei AODL.Document.Content.Tables.Table.Row_OnRowChanged(Int32 rowNumber, Int32 cellCount) in odftoolkit\\aodl\\AODL\\Document\\Content\\Tables\\Table.cs:Zeile 375.\r\n
bei AODL.Document.Content.Tables.Row.RowChanged.Invoke(Int32 rowNumber, Int32 cellCount)\r\n
bei AODL.Document.Content.Tables.Row.CellCollection_Inserted(Int32 index, Object value) in odftoolkit\\aodl\\AODL\\Document\\Content\\Tables\\Row.cs:Zeile 303.\r\n
bei AODL.Document.Collections.CollectionWithEvents.OnInsertComplete(Int32 index, Object value) in odftoolkit\\aodl\\AODL\\Document\\Collection\\CollectionWithEvents.cs:Zeile 97.\r\n
bei System.Collections.CollectionBase.System.Collections.IList.Add(Object value)"

Discussion

  • Nobody/Anonymous

    example code

     
  • Nobody/Anonymous

    Logged In: NO

    same error source as
    [ 1736924 ] slow down / high memory consumption

    the problem is the static event OnRowChanged in rows.cs
    it lists all tables that are created since programm start.

    changes to be done(i used csv version(downloaded 12.6.2007 15:33)):

    Row.cs:
    line60 (remove static): public event RowChanged OnRowChanged;
    line154 (add eventhandler) OnRowChanged += new RowChanged(Table.Row_OnRowChanged);

    Table.cs:
    line365 (change private to public): public void Row_OnRowChanged(int rowNumber, int cellCount)
    line145 (remove add-eventhandler): //Row.OnRowChanged+=new AODL.Document.Content.Tables.Row.RowChanged(Row_OnRowChanged);
    line165 (remove add-eventhandler): //Row.OnRowChanged+=new AODL.Document.Content.Tables.Row.RowChanged(Row_OnRowChanged);

     

Log in to post a comment.