Bug 135482 - EDITING: Data validity fails after copying sheet and deleting original sheet
Summary: EDITING: Data validity fails after copying sheet and deleting original sheet
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.6.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cell-Validity
  Show dependency treegraph
 
Reported: 2020-08-06 04:15 UTC by Richard Kelly
Modified: 2023-04-24 06:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet with data validity already defined (8.88 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-06 04:19 UTC, Richard Kelly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kelly 2020-08-06 04:15:57 UTC
Description:
After defining a "cell range" data validity in a sheet and then copying that sheet, the data validity is RIGHT in the new sheet.  If you then delete the original sheet, the data validity is WRONG in the new sheet.  Instead of containing valid entries, the selection list contains only "#REF!".

Steps to Reproduce:
1. Load the attached spreadsheet.
2. On Sheet2, observe that D1’s selection list works correctly.
3. Delete Sheet1.
4. On Sheet2, observe that D1’s selection list now works incorrectly.

Actual Results:
After deleting Sheet1, Sheet2.D1's selection list contains only "#REF!".

Expected Results:
After deleting Sheet1, Sheet2.D1's selection list should still contain "aaa", "bbb", and "ccc".


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
From "Help / About LibreOffice":
Version: 6.3.6.2 (x64)
Build ID: 2196df99b074d8a661f4036fca8fa0cbfa33a497
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded

OS: Microsoft Windows 10 Home, Version 10.0.19041 Build 19041
Comment 1 Richard Kelly 2020-08-06 04:19:52 UTC
Created attachment 163992 [details]
Spreadsheet with data validity already defined

This spreadsheet was created as follows:
1. Create a new spreadsheet.
2. In cells A1, B1, and C1, enter “aaa”, “bbb”, and “ccc”, respectively.
3. In cell D1, select “Data / Validity…”  On the Criteria tab of the Validity dialog, allow a “Cell range”, and choose “Show selection list”.  Specify a source of A1:C1.
4. On the original sheet’s tab, choose “Move or Copy Sheet…”.  Copy the original sheet to a new sheet.
5. Save this spreadsheet.
Comment 2 BogdanB 2020-08-06 05:29:13 UTC
There should not be a problem because copying the sheet the relations betweens cells break up.

I can not reproduce your bug on linux.
Tested on
Version: 6.4.5.2
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 3 m_a_riosv 2020-08-08 01:02:52 UTC
Reproduced.
Versión: 6.4.6.1 (x64)
Id. de compilación: 985dd72ca280d5c6da2e9f90f7ff9286cafe7ff8
Subprocs. CPU: 4; SO: Windows 10.0 Build 20180; Repres. IU: predet.; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES Calc: threaded

But after see the @REF, going to Menu/Data/Validity [Ok] works fine again.
Comment 4 BogdanB 2020-09-06 08:22:45 UTC
Miguel, what should Richard to do in this case?... It is a bug, or it is something Richard could do?...
Comment 5 QA Administrators 2022-09-07 03:58:59 UTC Comment hidden (obsolete)
Comment 6 Richard Kelly 2022-09-07 20:48:19 UTC
The bug is still present with the latest version of LibreOffice.

I created a new, test spreadsheet by following the steps listed in comment 1.  Then I reproduced the problem by following the steps listed in the original description.  I got the same result as before, i.e. Sheet2.D1's selection list contains only "#REF!".

From my Help/About LibreOffice dialog:
Version: 7.3.5.2 (x64) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 8; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Any suggestions for fixes or workarounds would be greatly appreciated.  Thank you!
Comment 7 m_a_riosv 2022-09-07 22:36:26 UTC
Reproducible with:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 540a312af2f02108ea90f5d2a9f3bf573db622e5
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded

But after see the @REF, going to Menu/Data/Validity [Ok] works fine again.
Comment 8 Richard Kelly 2022-09-09 17:19:02 UTC
The "Menu/Data/Validity [Ok]" thing is a decent workaround; thank you.

Might it also be a clue to the root cause?  After the error is introduced, the behavior seems consistent with the spreadsheet holding two versions of the Data Validity attributes, i.e. the human-readable version we see in the dialog and an encoded version cached internally.  Does selecting the dialog's [Ok] button cause the software to re-interpret the human-readable version and store the result internally?  If so, would re-interpreting it earlier (e.g. when deleting Sheet1) fix the bug?

The above is just speculation.  I haven't seen the relevant code.  I'm just basing my speculation on the behavior I've observed.
Comment 9 ady 2023-04-24 06:01:44 UTC
Still repro

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cd9de202765e243e41416802f3e4486b8a96f16
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (es_AR); UI: en-US
Calc: CL threaded
Built: 2023-04-21