I have two spreadsheets, Source and Target. Both have identical sets of named ranges (all global) and formulas. The only difference is Source has some data in the relevant sheet to drive the formulas. Target is basically an empty version of Source. To the bug: Open both. Go to sheet "Character" in both. In Source, copy the entire sheet with Ctrl-A/Ctrl-C. In Target, paste (on cell R1C1) with Ctrl-V. Watch the fireworks. What you see copied to Target is a corrupt version of what's in Source. Named ranges in formulas are mysteriously replaced with other named ranges, with predictably bizarre and bad results. Specifically: R2C1:R19C1 - NameStats is replaced by PD R21C1:R32C1 - NameMove is replaced by NamePrivate R13C6 - PERSkill is replaced by PRESkill R2C7 - PD is replaced by PERBonus Column 11 - TableSkills is replaced by TotalMove Column 13 - TableSkills is replaced by TotalMove, RollStats is replaced by RollSkills Column 18 - PowerAdders is replaced by PowerAdvantages, TableAdders is replaced by TableAdvantages Column 20 - PowerAdvantages is replaced by PowerLimitations, TableAdvantages is replaced by TableEncumbrance Column 21 - PowerLimitations is replaced by RollSkills, TableLimitations is replaced by TablePowers Column 24 - TablePowers is replaced by TableSkills, TableAdvantages is replaced by TableEncumbrance Column 27 - TablePowers is replaced by TableSkills, PowerLimitations is replaced by PowerAdvantages Were you to take these formulas and enter them in the formula entry box they would be accepted without error, so somehow pasting a formula is different than manually entering it. Sometimes manual entry is the only way to get a formula copied when this bug appears. Sometimes this bug also corrupts Data Validation formulas; I've seen the named range that was supposed to appear in the Validity popup get replaced with something else, though this particular test case doesn't cause that. I wonder if this bug may in some way be related to bug #39820, even though this test case has no sheet-local named ranges.
Created attachment 49942 [details] Source to copy data from
Created attachment 49943 [details] Target to paste data to
Win7 Libeoffice 3.4.2 If you first show all columns and rows in Source then copy well. The problem is you have the column "W" hide in the Source, then this column is not copied, and the ranges change properly.
Are you saying this is all about hidden columns? Because if so, there's still a bug, at least in the Mac version. I unhid all the columns and rows and it still bombs out. It couldn't be a hidden column problem because hidden columns are copied by LO. If you copy a row across a hidden column, and then paste it atop some virgin cells, you will see that your copied range includes the hidden column. If you copy a row of cells, and then paste them across a hidden column, the paste alters the hidden cells, not just the visible ones. Deleting cell contents across hidden cells deletes the contents of the hidden cells as well. This is arguably bad behavior, but it's probably what Excel does so we're stuck with it.
These two bugs are related. The problem is our handling of named ranges in formulas. We don't use the name to identify the named range in the formula but an index that may diver between both documents. At the moment I have no idea how to adjust our copy/paste code so that it will handle named ranges in new documents correctly. I don't think this is something for the 3-4 release cycle since this will need some rework in the copy/paste formula handling.
might have a patch that is acceptable for 3-4, have send it to the ML for review
fixed in master + a unit test I don't ask for 3-4 now, the changes were too complex will be in 3-5