https://issues.apache.org/bugzilla/show_bug.cgi?id=55050
Bug ID: 55050
Summary: Creating a new AreaPtg from an existing instance on
same row/column inverts the "absolute" row/column
attribute
Product: POI
Version: unspecified
Hardware: Macintosh
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Hello,
I have a formula in an xlsx worksheet, opened as SUM($D$2:D2), which during
processing the logic of my program "stretches" it to a column further to the
right (depending on what data I'm adding to the worksheet). I'm expecting it
to be (for example) "stretched" to SUM($D$2:Q2).
What I'm observing is different, I get SUM($D2:Q$2). In other words, the
"absolute" row reference has "moved" from the first column to the last column,
when I specifically constructed the replacement AreaPtg instance to retain the
absolute markers. I've tracked this down to the constructor in:
org.apache.poi.ss.formula.ptg.AreaPtg
protected AreaPtgBase(int firstRow, int lastRow, int firstColumn, int
lastColumn, boolean firstRowRelative, boolean lastRowRelative, boolean
firstColRelative, boolean lastColRelative)
...which inverts the attributes of lastRow and firstRow if the lastRow isn't
after the first row. I understand that this is trying to "sanitize" bad
parameters, however it appears to incorrectly handle the case of firstRow and
lastRow being equal, and inverts the "absolute" attribute incorrectly.
Here's my sample code:
_ptgs[i] = new AreaPtg(
aptg.getFirstRow(), aptg.getLastRow(), firstColumn, lastColumn,
aptg.isFirstRowRelative(), aptg.isLastRowRelative(),
aptg.isFirstColRelative(), aptg.isLastColRelative()
);
Thanks
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]