Bug 68031 - The inconsistency about default column style
Summary: The inconsistency about default column style
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 5.2.3-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on: 56525 66679
Blocks:
  Show dependency tree
 
Reported: 2023-10-31 09:35 UTC by Nina
Modified: 2024-02-25 12:51 UTC (History)
0 users



Attachments
Test code&Template&Result (19.36 KB, application/x-zip-compressed)
2023-10-31 09:35 UTC, Nina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nina 2023-10-31 09:35:53 UTC
Created attachment 39325 [details]
Test code&Template&Result

I found some problems after I upgraded the version from 4.1.2 to 5.2.4.

What I do is reading a xlsx file as template to do something then output it just like the Test.java attached. Generally I will look through all cells but here just read the null cells (A1-A4 & B1-B4) to reproduce the issue.

The expected result is the file TestColumnStyleResult(4.1.2).xlsx but actual one is TestColumnStyleResult(5.2.4).xlsx.

The problems are below:

1. The empty cells filled with a default column style which are different with the behavior before.

About the column default style, I saw the same question in Bug 56525. It seems I will always get a default cell style instead of null by the codes but it doesn't conform to the API doc. I don't know either the codes or the doc descrition is wrong.

2. The default column style is only used on A column not on all null cells.

Just like the result file, both A1-A4 & B1-B4 are null cells but the default column style only happened on the cells of A column. The problem happened in the XSSFRow.onDocumentWrite() method when outputing. The order is to apply cell style first then the for loop will break if compare result is not equal. I'm not sure if the order is correct but it caused the inconsistency in this case.

I want to know if these 2 problems are bug and how should I do to get the same result as version 4.1.2.

p.s. It seems be similar with Bug 66679 but not identical.