# [upstream] calc: "Cut" and "Paste special" -> "Transpose" affects other cells

Bug #1388491 reported by Koichi Akabe on 2014-11-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Confirmed
High
High
Unassigned

### Bug Description

Step to reproduce:
1. Open the attached ods file.
2. Select I12 to L16 and cut this region (Ctrl+X). (This bug doesn't occur with copy)
3. Select I5 and open Paste Special dialog (Shift+Ctrl+V).
4. Enable "Transpose" option and Click "OK"

Then, values of some cells in C9 to E10, which are not related to blank cells are changed:

C9: =C3/SUM(C\$3:C\$6) -> K7/SUM(C\$3:C\$6)
D9: =D3/SUM(D\$3:D\$6) -> L7/SUM(D\$3:D6)
E9: =E3/SUM(E\$3:E\$6) -> M7/SUM(E\$3:E\$6)
C10: =C4/SUM(C\$3:C\$6) -> K8/SUM(C\$3:C\$6)
D10: =D4/SUM(D\$3:D\$6) -> L8/SUM(D\$3:D6)
E10: =E4/SUM(E\$3:E\$6) -> M8/SUM(E\$3:E\$6)

My environment is Ubuntu 14.04 LibreOffice 4.2.6.3

Tags: Edit Tag help
 In freedesktop.org Bugzilla #68976, Leshiy (alexjironkin) wrote on 2013-09-05: #3

I was working with the spreadsheets and noticed this little gem. The value in the formula with the anchored cells (e.g. \$A\$1) are updated when i cut and paste in unrelated rows.

Steps to reproduce:
Enter value 1234 in cell A1
Enter values 5,2,3 in cells A3, A4 and A5 respectively
Enter formula (\$A\$1-ABS(A3))*-1 in cell B3
Drag the formula to fill other 2 cells

Now you have values -1229, -1232 and -1231 in cells B3, B4 and B5

Enter values 2, 3, 4 in cells A7, B7 and C7
Select these cells and cut them.
Click on A7 cell
Paste special: Number and Transpose checked, Operations: None, Shift Cells: Don't shift
Values in cells B3, B4 and B5 change to 2, 0 and 1 respectively
Formulas are updated to (\$A\$7-ABS(A9))*-1, (\$A\$7-ABS(A4))*-1, (\$A\$7-ABS(A5))*-1 in those cells.

I am running opensuse 12.1 and official repository and Build ID: 350m1(Build:413)

This also happens on Windows OS

Thank you for reporting this issue! I have been able to confirm the issue on:
Version 4.0.4
Platform: Bodhi Linux 2.2 x64
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
As I've been able to confirm this problem on an earlier release I am changing the version number as version is the earliest version that we can confirm the bug, we use comments to say that the bug exists in newer versions as well.

Marking as:

New (confirmed)
Major - loss (change) of data
High - default seems appropriate

Indeed - quite the gem ;) Thanks for catching this

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
https://wiki.documentfoundation.org/QA/BugTriage

There are also other ways to get involved including with marketing, UX, documentation, and of course developing - http://www.libreoffice.org/get-help/mailing-lists/.

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material

I suggest the interim solution to disable "Paste Special" after cutting cells.

The advantage is obvious: Loss or change of data are avoided. I experienced the consequences of this bug in a complex spreadsheet. The changes of links can be difficult to detect and to fix again.

I received a comment to bug 71058. The comment implies that my suggested interim solution has disadvantages, because "Cut" and "Paste Special" behaves as expected unless "Transpose" is selected. Therefore, disabling "Paste Special" completely after cutting cells would disable expected behaviour as well. Alternatively, only the "Transpose" option in "Paste Special" could be disabled as interim solution. However, such a quick fix lacks charm admittedly. Maybe there is no convincing interim solution.

 In freedesktop.org Bugzilla #68976, Cno (cno) wrote on 2013-10-30: #7

This is a bug.
and an old one...

I clarified the summary - quite essential to mention Paste special and Transpose to help people seeing the issue :)

thanks,
Cor

 In freedesktop.org Bugzilla #68976, peterthevicar (peterbcs) wrote on 2014-09-25: #8

Tell me if I should open a separate bug for this, but it looks to me that formulae are changed when you simply do Cut / Paste (recorded in the undo history as Cut / Move) so this is a more serious problem than it may seem on first sight of the title.

I fell foul of this when moving some data around in a simple 'row total' sheet with a protected column of formulae. "Imagine my surprise" when cut / pasting some of the data changed the formulae in unpredictable (by me) ways!

Here's how counter-intuitive it is (no need to protect the formulae for this)

1) create a simple 'row sum' table as follows

1 2 =A1+B1
3 4 =A2+B2

2) This displays as expected:

1 2 3
3 4 7

3) Select cells A2 and B2 and cut, gives what you'd expect:

1 2 3
0

4) Click on A1 and paste

3 4 7
7

And C2 now has =A1+A2 - NOT what I expected!

I guess this sort of spreadsheet is fairly common and it really had me confused. I can only move my input values around using select, copy, paste, select, delete instead of the obvious select, cut, paste.

This seems to be a problem arising from assuming that every cut and paste is a move whereas it is often, and more obviously, just a cut and paste! Surely to get a move you should ask for it via Paste Special?

Note that exactly the same table in Writer gives the expected result:

3 4 7
0

and leaves the formula in B3 alone.

 In freedesktop.org Bugzilla #68976, JBF (jbf-faure) wrote on 2014-10-04: #9

Hi Peter,

Please, open a new bug report. What you describe is another problem.

Best regards. JBF

 Koichi Akabe (vbkaisetsu) wrote on 2014-11-02: #1
 description: updated
 summary: - calc: "Cut" and "Paste special" -> "Transport" effects other cells+ calc: "Cut" and "Paste special" -> "Transpose" effects other cells description: updated
 Bryan Quigley (bryanquigley) wrote on 2014-12-04: Re: calc: "Cut" and "Paste special" -> "Transpose" effects other cells #2

Thank you for reporting this bug and helping to make Ubuntu better. This bug has already been reported to the LibreOffice developers - https://bugs.freedesktop.org/show_bug.cgi?id=68976

Reproducible via your spreadsheet and one in the upstream bug as well.

 Changed in libreoffice (Ubuntu): status: New → Triaged summary: - calc: "Cut" and "Paste special" -> "Transpose" effects other cells+ [upstream] calc: "Cut" and "Paste special" -> "Transpose" effects other+ cells Changed in libreoffice (Ubuntu): importance: Undecided → High
 In freedesktop.org Bugzilla #68976, Gquigs+bugs (gquigs+bugs) wrote on 2014-12-04: #10
 Changed in df-libreoffice: importance: Unknown → High status: Unknown → Confirmed
 summary: - [upstream] calc: "Cut" and "Paste special" -> "Transpose" effects other+ [upstream] calc: "Cut" and "Paste special" -> "Transpose" affects other cells
This report contains Public information  Edit
Everyone can see this information.
Subscribing...

## Remote bug watches

Bug watches keep track of this bug in other bug trackers.