[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
libreoffice (Ubuntu)

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

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:

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 do not see substantial disadvantages of disabling "Paste Special" after cutting cells because formula links are not shifted as expected after cutting and inserting with "Paste Special". I reported this unexpected behaviour with bug 71058 "EDITING: Cut and paste special does not shift formula links as expected". If cells are cut and then pasted normally (i.e. with "Paste" instead of "Paste Special"), all formula links to these cells point to the new cell positions after pasting the cells. This expected shift of formula links does not occur with the command "Paste Special". Formula links still point to the old positions of the moved cells. Therefore, "Cut" and "Paste Special" leads to the same result as "Copy" and "Paste Special" with subsequent deletion of the old cells. Thus disabling "Paste Special" after cutting cells does not lead to a loss of functionality. It can be replaced in the workflow by "Copy" and "Paste Special" with subsequent deletion of the old cells. A loss of functionality occurs only if bug 71058 can be fixed by aligning the behaviour of "Paste Special" with "Paste" after cutting cells. MS Excel 2007 does not offer the full set of "Paste Special" options after cutting cells either. I do not have access to later Excel versions.

(In reply to comment #2)

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.

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 :)


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

4) Click on A1 and paste

3 4 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

and leaves the formula in B3 alone.

Hi Peter,

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

Best regards. JBF

Koichi Akabe (vbkaisetsu) wrote :
description: updated
summary: - calc: "Cut" and "Paste special" -> "Transport" effects other cells
+ calc: "Cut" and "Paste special" -> "Transpose" effects other cells
description: updated

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
Changed in df-libreoffice:
importance: Unknown → High
status: Unknown → Confirmed
tags: added: trusty
Adolfo Jayme (fitojb) on 2014-12-16
summary: - [upstream] calc: "Cut" and "Paste special" -> "Transpose" effects other
+ [upstream] calc: "Cut" and "Paste special" -> "Transpose" affects other
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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