Bug 63264 - Conditional Format rule evaluation calculates relative references incorrectly
Summary: Conditional Format rule evaluation calculates relative references incorrectly
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 4.0.x-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Blocks: 61652
  Show dependency tree
Reported: 2019-03-16 00:26 UTC by Greg Woolsey
Modified: 2019-03-16 08:09 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Greg Woolsey 2019-03-16 00:26:34 UTC
I apparently missed this when I implemented conditional format evaluation.  One of the test files even showed the problem, I just wasn't checking the right cells.

Issue 1, when adjusting formulas for relative references, the calculation is using the full target row/column rather than calculating an offset from the region top-left corner.

Issue 2, Excel appears to specify that if a rule applies to multiple regions, relative references are calculated from the top-left-most cell in any region, not the one containing the current target cell, as is being passed currently from the rule.
Comment 1 Greg Woolsey 2019-03-16 00:27:35 UTC
Fixing the offset calculation and passing the top-left-most region rather than the region matching the current cell fixed these cases.  I've augmented unit tests to check for them to avoid future regressions.
Comment 2 Dominik Stadler 2019-03-16 08:09:34 UTC