Summary: | shiftRows method does not update cell references in Named ranges | ||
---|---|---|---|
Product: | POI | Reporter: | Alexey Kuznetsov <kuaw26> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 3.0-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Alexey Kuznetsov
2007-09-20 04:08:13 UTC
Any chance you could do a failing unit test for this? Something that: * loads a file * checks the named ranges are correct * does your shiftrows action * checks that the named ranges have been updated (which they won't have) That'll give us something to work/test against this bug is similar to bug 34023 but deals with HSSFName ok. I will try to make failing unit test do you have a template for such units? or I can write anything by my own? Use junit. You should find lots of other examples under src/testcases/org/apache/poi/hssf/ I don't think we will implement this Named ranges can be fantastically complicated, and for a case like: Sheet1!A1:A5,Sheet1!B2,B3,Sheet2!A1,A5 If you shift the third row of sheet 1 down, you'll have to split the named ranges up even further (since A3 and B3 have moved elsewhere, and your range is even less contiguous). I think this is a case where the person doing the shifting will know much more about their named ranges than we ever could, so they should be deciding what (if anything) ought to be updated. (eg in this example, perhaps you want the named range to still point to the new empty third row that you're about to fill, not to where the data went, and how are we to know that) I'm sure it would be very complicated to support. Perhaps an industrious person would be helped by the code in the patch for http://issues.apache.org/bugzilla/show_bug.cgi?id=44167 |