|Summary:||Workbook.setSheetOrder does not fixup record list|
|Product:||POI||Reporter:||Richard Evans <richard.evans>|
|Component:||HSSF||Assignee:||POI Developers List <dev>|
Simple test case with input files to demonstrate the issue.
patch for version 3.8
Minimal test case
Description Richard Evans 2010-10-13 08:02:55 UTC
Workbook.setSheetOrder correcly changes the ordering in the internal boundsheets list _but does not_ reorder the corresponding BoundSheetRecord instances in the records list. If subsequently a sheet is removed, the wrong BoundSheetRecord instance will get removed from the record list, leading to serialization errors when the workbook is written because the calculated size of the workbook data is based on the records list, whist the sheet records are serialized using the boundsheets list. This problem is also present in 3.7beta3. It it probably the root cause of bug 48294.
Comment 1 Antti Koskimäki 2011-06-29 04:56:56 UTC
Still present (3.8b4)
Comment 2 Hamza 2011-06-30 07:38:00 UTC
+1 same happens with 3.8beta4
Comment 3 Jon Svede 2011-06-30 15:19:26 UTC
Created attachment 27231 [details] Simple test case with input files to demonstrate the issue. Attaching my test case to reproduce the issue. To enable the code that creates the error, pass any argument to the class when you run it. If you do not, the class will run fine (i.e., no exception).
Comment 4 Jon Svede 2011-06-30 15:21:02 UTC
(In reply to comment #3) This test case was exercised against POI 3.8 Beta 3 - not aware of a POI 3.8 Beta 4 version at this time.
Comment 5 recyclebin5385 2012-04-26 13:20:48 UTC
*** Bug 53147 has been marked as a duplicate of this bug. ***
Comment 6 recyclebin5385 2012-04-26 13:23:22 UTC
Created attachment 28685 [details] patch for version 3.8 Still present in version 3.8 final (and probably the trunk of the repository). I wrote a patch to fix this problem.
Comment 7 Rémy LeBeau 2012-07-03 14:25:25 UTC
Created attachment 29024 [details] Minimal test case Minimal reproduction of the same exception as the previous test case (27231), with an attempt to explain the cause of it.
Comment 8 Rémy LeBeau 2012-07-05 13:26:47 UTC
Created attachment 29034 [details] Patch Fixes order of 'records' list in InternalWorkbook.setSheetOrder + test case.