In Calc, moving named range on sheet level does not update the name reference to the new location in a Cut+Paste. To reproduce, open a new sheet. Click any cell, name it using the Manage Names, from the menu Insert/Names/Define. Close the Manage Names window. Click the named cell, do a Cut+Paste. The Cell name did not follow. Rational: The use of named cell in formula make equation very easy to read. At time it is normal to rearrange the cells and move things around. However if moving a cell does not move its reference makes Named Cells difficult to maintain.
Hi @Michel, thanks for reporting. Reproducible with: Win7x64Ultimate Version: 4.2.0.4 Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71 This is a regression from Version: 4.1.6.0.0+ Build ID: 2d0b2cb6b7ca48663d09118acfb01a1dd194a1e I think it is a MAB.
The problem is not limited to named ranges, it also affects normal formula cells. I think we miss a call to ScDocument::UpdateReference but need to check that this does not break the new shared formulas.
This is related to Bug 75386 which I'm looking into. I'll keep this one.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3edc49d11765372fa54c52b71b49bf52675f4dda fdo#74322: Write unit test for this first. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=003a27a14d5cf65fe0b528b6d6015e37a64dbb8e fdo#74322: Handle moving of named ranges correctly. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
4.2 backport request: https://gerrit.libreoffice.org/8756
Kohei Yoshida committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0568f9f55b0054629e86561e96e78ecf13a8df5f&h=libreoffice-4-2 fdo#74322: Handle moving of named ranges correctly. It will be available in LibreOffice 4.2.4. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Kohei, cut & paste or move works with: Win7x64 Ultimated Version: 4.2.4.1 Build ID: d4c441391e20647b3d2e8dde4d20aa868e77e515 Version: 4.2.5.0.0+ Build ID: cc45204a7a286cef32fc7faf266dc2da235c1ae2 TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-04-17_02:46:49 although undo needs two steps to do it, one for name range and a second for the cell's content. But doesn't work for me with: Win7x64 Ultimate Version: 4.3.0.0.alpha0+ Build ID: 0ce6d9bcea7c37a7cb2c42e8393e2e20780bd171 TinderBox: Win-x86@39, Branch:master, Time: 2014-04-17_00:11:33 Steps: - new spreadsheet - enter 1 in B3 - give a name to B3 in the address box. - Cut & copy or move B3, the range name remains related to B3. - Also two steps here for undo. Please can you review, before reopen. Maybe a new bug for two steps for undo?.
(In reply to comment #8) > Steps: > - new spreadsheet > - enter 1 in B3 > - give a name to B3 in the address box. > - Cut & copy or move B3, the range name remains related to B3. > - Also two steps here for undo. It's likely unrelated to my change since I didn't touch that part. So, it's a pre-existing condition. > Maybe a new bug for two steps for undo?. Yes. Filing a new bug for this would be appropriate in my opinion. Thanks!
(In reply to comment #9) > (In reply to comment #8) > It's likely unrelated to my change since I didn't touch that part. So, it's > a pre-existing condition. ? > > Maybe a new bug for two steps for undo?. > Yes. Filing a new bug for this would be appropriate in my opinion. > Thanks! My misinterpretation, it's fine, one to undo paste and another to undo cut. Drag&drop works with only one undo.
I'll reopen this to handle the remaining issue mentioned in Comment 8. Looks like the relocation only happens with range references.
(In reply to comment #11) > I'll reopen this to handle the remaining issue mentioned in Comment 8. > Looks like the relocation only happens with range references. Actually no, the reference update happens only when the moved block is more than just a single cell. And this doesn't just affect named ranges, but it affects normal references as well.
And the good news is that this appears to be a master only problem. 4.2 doesn't exhibit it.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd65b90934d0c521de1f3b04214e364fd540f080 fdo#74322: Additional test for the followup issue. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Kohei Yoshida committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea0ac020160207a08de3168142abc2a74f17afd6 fdo#74322: Let's not handle cut mode here. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
It should be good now on the master branch.
Thanks Kohei, Verified with: Win7x64 Version: 4.3.0.0.alpha1+ Build ID: 20778b037c688759a4dc46acb8aeb66c9d1290cc TinderBox: Win-x86@39, Branch:master, Time: 2014-05-03_23:16:12