Bug 142093 - EDITING: Paste Special Date&Time inconsistent for no option, transpose and as link
Summary: EDITING: Paste Special Date&Time inconsistent for no option, transpose and as...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Number-Format Paste-Special
  Show dependency treegraph
 
Reported: 2021-05-05 09:26 UTC by Roland Kurmann
Modified: 2023-05-11 09:17 UTC (History)
2 users (show)

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 Roland Kurmann 2021-05-05 09:26:16 UTC
Description:
The Paste Special Date&Time is inconsistent for no option, transpose and as link. The options change the behavior of date pasting, 1. no option, 2. paste as link, 3. transpose and 4. paste as link and transposed

From a user perspective,
- if I paste date&time, I expect to get a date again, not just a number. I should not additionally select format to get a formatted date. Moreover, I do not expect to get numbers pasted as well.
- if I paste only numbers, I do not expect to get dates.
- and I expect a consistent behavior regardless the selected options

Background:
In LibreOffice, Dates are numbers/values with "Date formatting".
When pasting, the pasted things are chosen by the type flag from the dialog, e.g. VALUE, DATETIME, STRING, FORMULA, ATTRIB, and/or NOTE.
This means the DATETIME flag has to be treated specially, since it affects numbers/values and formatting. Unlike the other flags. (except the ALL flag)

The reason for these inconsistencies is that these options are processed in different code path. The implementation is duplicated.

Steps to Reproduce:
1. Start with an empty spreadsheet.
2. Insert
    A1: 1
    B1: a date in your date format, e.g. 01.01.2020

---

i. Case paste All, no options
11. Go to A2
12. Paste Special > Paste Special Dialog > Enable All; disable options > press OK

ii. Case paste only values, no options
21. Go to A3
22. Paste Special > Paste Special Dialog > enable numbers, disable other paste types; disable options > press OK

iii. Case paste only date&time, no options
31. Go to A4
32. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; disable options > press OK

iv. Case paste date&time with format, no options
31. Go to A5
32. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; disable options > press OK

v. Case paste values with format, no options
21. Go to A6
22. Paste Special > Paste Special Dialog > enable numbers and format, disable other paste types; disable options > press OK

---

vi. Case paste all, option as link
51. Go to A7
52. Paste Special > Paste Special Dialog > enable all; enable option as link
 > press OK

vii. Case paste only values, option as link
61. Go to A8
62. Paste Special > Paste Special Dialog > enable numbers, disable other paste types; enable option as link > press OK

viii. Case paste only date&time, option as link
71. Go to A9
72. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable option as link > press OK

ix. Case paste date&time with format, option as link
81. Go to A10
82. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable option as link > press OK

x. Case paste values with format, option as link
91. Go to A11
92. Paste Special > Paste Special Dialog > enable values, disable other paste types; enable option as link > press OK

---

xi. Case paste all, option transpose
101. Go to C1
102. Paste Special > Paste Special Dialog > enable all; enable option as link
 > press OK

xii. Case paste only values, option transpose
111. Go to D1
112. Paste Special > Paste Special Dialog > enable numbers, disable other paste types; enable option transpose > press OK

xiii. Case paste only date&time, option transpose
121. Go to E1
122. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable option transpose > press OK

xiv. Case paste date&time with format, option transpose
131. Go to F1
132. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable option transpose > press OK

xv. Case paste values with format, option transpose
141. Go to G1
142. Paste Special > Paste Special Dialog > enable values, disable other paste types; enable option transpose > press OK

--

xvi. Case paste all, options transpose and as link
151. Go to H1
152. Paste Special > Paste Special Dialog > enable all; enable options transpose and as link
 > press OK

xvii. Case paste only values, options transpose and as link
161. Go to I1
162. Paste Special > Paste Special Dialog > enable numbers, disable other paste types; enable options transpose and as link > press OK

xviii. Case paste only date&time, options transpose and as link
171. Go to J1
172. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable options transpose and as link > press OK

xix. Case paste date&time with format, options transpose and as link
181. Go to K1
182. Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable options transpose and as link > press OK

xx. Case paste values with format, options transpose and as link
191. Go to L1
192. Paste Special > Paste Special Dialog > enable values, disable other paste types; enable options transpose and as link > press OK

Actual Results:
i. Case paste All, no options
12.
    A2: 1
    B2: 01.01.2020
-> OK

ii. Case paste only values, no options
22.
    A3: 1
    B3: (empty)
-> OK

iii. Case paste date&time, no options
22.
    A4: (empty)
    B4: 43831
-> NOK (date expected)

iv. Case paste date&time with format, no options
32.
    A5: (empty)
    B5: 01.01.2020
-> OK

v. Case paste values with, no options
42.
    A3: 1
    B3: (empty)
-> OK

---

vi. Case paste all, option as link
52.
    A7: =$Sheet1.$A$1   displayed: 1
    B7: =$Sheet1.$B$1   displayed: 01.01.2020
-> OK

vii. Case paste only values, option as link
62.
    A8: =$Sheet1.$A$1   displayed: 1
    B8: =$Sheet1.$B$1   displayed: 43831
-> NOK (link to date not expected)

viii. Case paste only date&time, option as link
72.
    A9: =$Sheet1.$A$1   displayed: 1
    B9: =$Sheet1.$B$1   displayed: 43831
-> NOK (link to number not expected, date expected)

ix. Case paste date&time with format, option as link
82.
    A10: =$Sheet1.$A$1   displayed: 1
    B10: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to number not expected)

x. Case paste values with format, option as link
92.
    A10: =$Sheet1.$A$1   displayed: 1
    B10: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to date not expected)

---

xi. Case paste all, option transpose
102.
    C1: 1
    C2: 01.01.2020
-> OK

xii. Case paste only values, option transpose
112.
    D1: 1
    D2: (empty)
-> OK

xiii. Case paste only date&time, option transpose
122.
    E1: (empty)
    E2: 43831
-> NOK (date expected)

xiv. Case paste date&time with format, option transpose
132.
    F1: (empty)
    F2: 01.01.2020
-> OK

xv. Case paste values with format, option transpose
142.
    G1: 1
    G2: (empty)
-> OK

---

xvi. Case paste all, options transpose and as link
152.
    H1: =$Sheet1.$A$1   displayed: 1
    H2: =$Sheet1.$B$1   displayed: 01.01.2020
-> OK

xvii. Case paste only values, options transpose and as link
162.
    I1: =$Sheet1.$A$1   displayed: 1
    I2: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to date not expected)

xviii. Case paste only date&time, options transpose and as link
172.
    J1: =$Sheet1.$A$1   displayed: 1
    J2: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to number not expected)

xix. Case paste date&time with format, options transpose and as link
182.
    K1: =$Sheet1.$A$1   displayed: 1
    K2: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to number not expected)

xx. Case paste values with format, options transpose and as link
192.
    L1: =$Sheet1.$A$1   displayed: 1
    L2: =$Sheet1.$B$1   displayed: 01.01.2020
-> NOK (link to date not expected)

Expected Results:
i. Case paste All, no options
12.
    A2: 1
    B2: 01.01.2020

ii. Case paste only values, no options
22.
    A3: 1
    B3: (empty)

iii. Case paste only date&time, no options
22.
    A4: (empty)
    B4: 01.01.2020

iv. Case paste date&time with format, no options
32.
    A5: (empty)
    B5: 01.01.2020

v. Case paste values with, no options
42.
    A6: 1
    B6: (empty)

---

vi. Case paste all, option as link
52.
    A7: =$Sheet1.$A$1   displayed: 1
    B7: =$Sheet1.$B$1   displayed: 01.01.2020

vii. Case paste only values, option as link
62.
    A8: =$Sheet1.$A$1   displayed: 1
    B8: (empty)

viii. Case paste only date&time, option as link
72.
    A9: (empty)
    B9: =$Sheet1.$B$1   displayed: 01.01.2020

ix. Case paste date&time with format, option as link
82.
    A10: (empty)
    B10: =$Sheet1.$B$1   displayed: 01.01.2020

x. Case paste values with format, option as link
92.
    A10: =$Sheet1.$A$1   displayed: 1
    B10: (empty)

---

xi. Case paste all, option transpose
102.
    C1: 1
    C2: 01.01.2020

xii. Case paste only values, option transpose
112.
    D1: 1
    D2: (empty)

xiii. Case paste only date&time, option transpose
122.
    E1: (empty)
    E2: 01.01.2020

xiv. Case paste date&time with format, option transpose
132.
    F1: (empty)
    F2: 01.01.2020

xv. Case paste values with format, option transpose
142.
    G1: 1
    G2: (empty)

---

xvi. Case paste all, options transpose and as link
152.
    H1: =$Sheet1.$A$1   displayed: 1
    H2: =$Sheet1.$B$1   displayed: 01.01.2020

xvii. Case paste only values, options transpose and as link
162.
    I1: =$Sheet1.$A$1   displayed: 1
    I2: (empty)

xviii. Case paste only date&time, options transpose and as link
172.
    J1: (empty)
    J2: =$Sheet1.$B$1   displayed: 01.01.2020

xix. Case paste date&time with format, options transpose and as link
182.
    K1: (empty)
    K2: =$Sheet1.$B$1   displayed: 01.01.2020

xx. Case paste values with format, options transpose and as link
192.
    L1: =$Sheet1.$A$1   displayed: 1
    L2: (empty)


Reproducible: Always


User Profile Reset: No



Additional Info:
I've discovered this inconsistent behavior while implementing and testing bug 90101.

Version: 7.1.1.2 / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.3; UI render: GL; VCL: kf5
Locale: de-CH (en_US.UTF-8); UI: de-DE
Calc: threaded

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: ef78c7d93e4f170ac7a7f0307a8305052524eb53
CPU threads: 4; OS: Linux 5.3; UI render: default; VCL: x11
Locale: de-CH (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Sophie Sipasseuth 2023-05-11 08:46:22 UTC
0) Repro, when I write 11/05/2023 in a cell, calc changes it to 11/05/23

1) No repro when: Paste Special > Paste Special Dialog > Enable All; disable options > press OK
- result: no past at all

2) No repro when: Paste Special > Paste Special Dialog > enable numbers, disable other paste types; disable options > press OK - result: just a1 is past

3) Repro when: Paste Special > Paste Special Dialog > enable date&time, disable other paste types; disable options > press OK - result: just a2 is past but with another a number and not a date, here 11/05/2023 become 45057

4) No repro when: Paste Special > Paste Special Dialog > enable date&time, disable other paste types; disable options > press OK - result: the date format is past with the date

5) No repro when: Paste Special > Paste Special Dialog > enable numbers and format, disable other paste types; disable options > press OK - result: only a1 is past

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: daf30c29be67b8b8fa361b0efd1a6cdbe087b6f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 2 Sophie Sipasseuth 2023-05-11 08:59:41 UTC
6) Repro when: Paste Special > Paste Special Dialog > enable all; enable option as link > press OK - result: nothing happens

7) Repro when: Paste Special > Paste Special Dialog > enable numbers, disable other paste types; enable option as link > press OK - result: link on a1 and b1 and date become a number

8) Repro when: Paste Special > Paste Special Dialog > enable date&time, disable other paste types; enable option as link > press OK - result: no link

9) Repro no bug

10) Repro bug

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: daf30c29be67b8b8fa361b0efd1a6cdbe087b6f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 3 Sophie Sipasseuth 2023-05-11 09:11:26 UTC
11) Repro no bug

12) No repro: bug - 11/05/23 become 45057

13) Repro bug - date empty

14) Repro no bug

15) Repro no bug

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: daf30c29be67b8b8fa361b0efd1a6cdbe087b6f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 4 Sophie Sipasseuth 2023-05-11 09:17:05 UTC
16) Repro no bug

17) Repro bug

18) Repro bug

19) Repro bug

20) Repro bug

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: daf30c29be67b8b8fa361b0efd1a6cdbe087b6f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded