Bug 64327 - SXSSFSheet returns true in isColumnTrackedForAutoSizing if you track all columns and then untrack one
Summary: SXSSFSheet returns true in isColumnTrackedForAutoSizing if you track all colu...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-09 14:19 UTC by Eugene Kortov
Modified: 2020-04-09 20:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kortov 2020-04-09 14:19:03 UTC
Method isColumnTrackedForAutoSizing in SXSSFSheet
https://github.com/apache/poi/blob/84ba670e27948adcb572caa5065affbf1aa3a769/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java#L1502-L1505

returns true for untracked column if you invoked trackAllColumnsForAutoSizing()

steps:
1. Create workbook, SXSSFSheet, and row with 2 cells
2. invoke trackAllColumnsForAutoSizing() on the sheet
3. invoke untrackColumnForAutoSizing(0) on the sheet
4. invoke isColumnTrackedForAutoSizing(0) on the sheet

expected result: false
actual result: true

it's because `AutoSizeColumnTracker` checks `trackAllColumns` first

https://github.com/apache/poi/blob/84ba670e27948adcb572caa5065affbf1aa3a769/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java#L140-L142
Comment 1 PJ Fanning 2020-04-09 20:17:12 UTC
Thanks - applied using https://svn.apache.org/repos/asf/poi/trunk@1876336