Bug 153759 - EDITING: Mark column -> Ctrl+C -> right-click -> Insert Columns Before -> Ctrl+V -> wrong reference despite $
Summary: EDITING: Mark column -> Ctrl+C -> right-click -> Insert Columns Before -> Ctr...
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.5.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-20 13:20 UTC by milchreis
Modified: 2023-02-20 15:17 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description milchreis 2023-02-20 13:20:31 UTC
Description:
When done the steps stated in Summary, cell reference gets moved, even though cell reference is protected by $

Steps to Reproduce:
1. Open new Calc file.
2. Enter the number '1' into cell E1. Cell E1 now has the value '1'.
3. Enter the formula '=E$1' into cell D1. Cell D1 now has the value '1' same as cell E1.
4. Left-click on column D to mark column D. Enter key-combination Ctrl+C to copy marked column D.
5. Left-click on column B and select "Insert Columns Before".
6. Enter key-combination Ctrl+V to insert copied column D into column B. Cell B1 now has the value '0' instead of '1', because it is now reference Cell C1 instead of D1.

Actual Results:
Cell B1 is referencing C1.

Expected Results:
Cell B1 should reference D1.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.4.5.1 (x86) / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_GB); UI: en-US
Calc: threaded
Comment 1 Eike Rathke 2023-02-20 13:45:25 UTC
E$1 is a reference pointing from column D relative to column E (+1 column). Of course, if you paste that into column B it will reference column C (still +1 column).
Not a bug.
Comment 2 milchreis 2023-02-20 15:14:24 UTC
Not solved. My description has mistakes. Look again into the following, please:

Steps to Reproduce claimed bug:
1. Open new Calc file.
2. Enter the number '1' into cell G1. Cell G1 now has the value '1'.
3. Enter the formula '=$G1' into cell D1. Cell D1 now has the value '1' same as cell G1.
4. Mark column D and enter key-combination Ctrl+C to copy marked column D.
5. Left-click on column B and select "Insert Columns Before".
7. Note how value '1' has shifted from cell D1 to cell E1 as it should. However, column D is still the copied cell as indicated with vertically moving interrupted lines around the column D.
8. Note that column B is still marked. 
6. Enter key-combination Ctrl+V to insert copied column D into column B. Cell B1 now has the value '0' instead of '1', because it is still referencing Cell G1 instead of H1.

Same steps bring correct reference and value '1' in Microsoft Excel.

My explanation:
When a column is added on the left side of marked/copied column D, the marked/copied column D's content shifts to the right and its reference shifts also +1 column, which is ok of course. However, the "marking of copy" doesn't shift to the right. It stays on column D, which I find wrong already. But let's say that is ok, we can at least agree that at this moment, column D has no value anymore since it was shifted +1 column. So at this state, if I press Ctrl+V, then it should at least paste no value because column D has no value. Instead, it pastes column D's old reference value, which is definitely wrong.

My fix proposal:
I believe the problem is fixed if the "marking of copy" also shifts when everything else shifts.
Or, take off the "marking of copy" when everthing shifts, so I am forced to recopy the correct column again.

Comparison to Microsoft Excel:
Microsoft Excel gives two options to add a new column while another has "marking of copy".
1. Add new column with a copy of marked column. Then, it takes off the "marking of copy", so that the user has to mark and copy it again if he needs it.
2. Add new column without a copy of marked column. Then also, it takes off the "marking of copy".

Conclusion:
Simplest solution in my eyes is to take away the "marking of copy" evertime new cells are added, so that the user is forced to start a new copy procedure. This is what Microsoft Excel does.

Sorry for the long text, I hope this makes sense.
Comment 3 milchreis 2023-02-20 15:17:00 UTC
The numeration of the steps are wrong this time xD .. Sorry. The steps are correct in order from top to bottom.