Bug 43434

Summary: shiftRows method does not update cell references in Named ranges
Product: POI Reporter: Alexey Kuznetsov <kuaw26>
Component: HSSFAssignee: 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
shiftRows method does not update cell references in Named ranges
Comment 1 Nick Burch 2007-09-20 04:10:54 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
Comment 2 Alexey Kuznetsov 2007-09-20 04:16:49 UTC
this bug is similar to bug 34023 but deals with HSSFName
Comment 3 Alexey Kuznetsov 2007-09-20 04:24:52 UTC
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? 
Comment 4 Nick Burch 2007-09-20 04:39:38 UTC
Use junit. You should find lots of other examples under
src/testcases/org/apache/poi/hssf/
Comment 5 Nick Burch 2008-01-08 09:23:08 UTC
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)
Comment 6 David Fisher 2008-01-08 09:52:29 UTC
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