Bug 53763 - [PATCH] avoid style mess when using HSSFOptimiser
Summary: [PATCH] avoid style mess when using HSSFOptimiser
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.9-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-22 09:42 UTC by Artem Karpenko
Modified: 2012-10-12 12:56 UTC (History)
0 users



Attachments
Actual patch, tar.gz (2.21 KB, patch)
2012-08-22 09:43 UTC, Artem Karpenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

Regards,
Yegor