Bug 60870 - [PATCH] in XSSF files getErrorStyle() and setErrorStyle() have mismatching enum values -> #60803
Summary: [PATCH] in XSSF files getErrorStyle() and setErrorStyle() have mismatching en...
Status: RESOLVED DUPLICATE of bug 55713
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.15-dev
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
: 60803 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-15 16:31 UTC by gstrada
Modified: 2018-12-22 19:13 UTC (History)
0 users



Attachments
file containing diffs between patched class and the original one (1.05 KB, application/gzip)
2017-03-15 16:31 UTC, gstrada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gstrada 2017-03-15 16:31:15 UTC
Created attachment 34834 [details]
file containing diffs between patched class and the original one

the problem is explained in the bug report 60803.

the solution i promote is to use a map into XSSFDataValidation to convert the Enums, which come from STDataValidation (range 1-3), into the ints exposed in DataValidation (range 0-2) so getErrorStyle returns values between 0-2.
This adjustment is required when we want to copy the errorstyle of a cell, or a group of cells, into another one : 

(working example with patch)
    newDataValidation.setErrorStyle(anotherDataValidation.getErrorStyle());


(working example without patch)
    newDataValidation.setErrorStyle(anotherDataValidation.getErrorStyle() - 1);
Comment 1 Dominik Stadler 2017-03-18 19:07:59 UTC
*** Bug 60803 has been marked as a duplicate of this bug. ***
Comment 2 Dominik Stadler 2018-12-22 19:13:09 UTC
This was actually already fixed in bug 55713

*** This bug has been marked as a duplicate of bug 55713 ***