Summary: | [RFE] shiftRows method does not update cell references in formula contained in shifted cells | ||
---|---|---|---|
Product: | POI | Reporter: | R A Sequeira <tcat.seq> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 2.5-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
Test.xls is the input to the HSSFCreateSheet program
Adds shiftFormulas method into shiftRows functionality |
Description
R A Sequeira
2005-03-15 21:26:16 UTC
Created attachment 14493 [details]
Test.xls is the input to the HSSFCreateSheet program
This is more of a feature request. I can confirm the functionality that you are seeing as when I wrote the shiftRows method, I didn't want to spend the time required to parse the forumula and move anything along with it. I would get the most recent source and start looking at how to shift a formula (a shiftFormula function?). Thanks Shawn. Atleast I wasn't hallucinating. I'll take a look at the source and see what I can do. RAS Created attachment 19550 [details]
Adds shiftFormulas method into shiftRows functionality
Please review and apply this patch. It uses regex matching to update row
references in formulas referencing rows being shifted. It matches relative and
absolute references (i.e. "A5:D7" or "$A$5:$D$7". It does not match
references to entire rows (i.e. "5:7" or "$5:$7").
Thanks,
Brian
The patch submitted by Brian works well. However, in order for the behaviour to be similar to "shiftRows", the following should be added to the beginning of the "shiftFormulas" method: startRow++; endRow++; Thanks. Fixed in svn (Didn't use the supplied patch, instead processes the formulas properly, and updates the reference parts it spots as required) |