Bug 53763

Summary: [PATCH] avoid style mess when using HSSFOptimiser
Product: POI Reporter: Artem Karpenko <gooyozh>
Component: HSSFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.9-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Actual patch, tar.gz

Description Artem Karpenko 2012-08-22 09:42:21 UTC
In some cases HSSFOptimiser messes up styles of the cells. In particular, this happens when cells with duplicate styles are not near each other but have other cells between them. 

Problem is that styles are removed by object (not index) (InternalWorkbook#removeExFormatRecord(ExtendedFormatRecord)) and since underlying structure is a list this removes the first suitable style and not the one we actually need to remove.

Added method to remove style by its index, used it in HSSFOptimiser. Added test that fails unless suggested changes applied.

On a separate topic - patch.xml excludes patch.txt from resulting archive?
Comment 1 Artem Karpenko 2012-08-22 09:43:58 UTC
Created attachment 29264 [details]
Actual patch, tar.gz
Comment 2 Yegor Kozlov 2012-10-12 12:56:34 UTC
Thanks for the patch, applied in r1397548