References are not transposed when paste-transposed is used
Submitted by Phil Endecott
Please describe the problem: Normally I copy and paste a group of cells, references within the group are preserved. However, when I paste-special transposed, the references are broken: it looks like they point to the cell that they would have pointed to if it had not been a transposed paste.
Steps to reproduce: Create this sheet, starting at A1:
=1 =A1+1 =A1/2
Select those four cells. Copy. Click in C1. Paste special. Transpose. OK. Observe results.
Actual results: The results in cells C1 to D2 are
=1 =#REF!/2 =B2+1
Expected results: Cells C1 to D2 should contain:
=1 =C1/2 =C1+1
Does this happen every time? Yes
Other information: I have never looked at the Gnumeric internals, but I presume that the paste code has some reference fixup stuff that does
for each cell in selection if cell contains a formula for each reference in forumla if target of reference is in copied region (dx,dy) = displacement from this cell before copy to target before copy new target = this cell after paste + (dx,dy)
To make this work correctly with transposition, it's only necessary to add
if transposing (dx,dy) = (dy,dx)
after computing (dx,dy) above.
Version: git master