Bug 158223 - Charts: Data range will be deleted when deleting following sheet
Summary: Charts: Data range will be deleted when deleting following sheet
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.1.2 release
Hardware: All All
: high normal
Assignee: Eike Rathke
URL:
Whiteboard: target:24.2.0 target:7.6.5
Keywords: bibisected, bisected, regression
: 158054 158670 158833 159608 (view as bug list)
Depends on:
Blocks: Chart Sheet
  Show dependency treegraph
 
Reported: 2023-11-15 14:21 UTC by Robert Großkopf
Modified: 2024-02-22 16:04 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
Open the Calc file. Have a look at the sheets. Delete last (empty) sheet… (26.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-11-15 14:21 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2023-11-15 14:21:31 UTC
Created attachment 190840 [details]
Open the Calc file. Have a look at the sheets. Delete last (empty) sheet…

Open The attached Calc file.
Have a look at the 3 sheets.
"Tabelle 1" and "Tabelle 2" will show the same content, some data and a chart, which shows this data.
"Tabelle 3" is empty.
Now delete "Tabelle 3".
Have a look at "Tabelle 2".
Chart has been changed.
Mark chart → Edit → Data Ranges.
Data Ranges will be empty.

This bug will appear if there is more than one sheet.
Bug happens here with
Version: 7.6.3.1 (X86_64) / LibreOffice Community
Build ID: c4af5b1259bceea6e979e6fe2435dbee7a5a87c2
CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
Comment 1 Robert Großkopf 2023-11-15 14:31:05 UTC
Bug doesn't appear in LO 7.5.5.2, also doesn't appear in LO 7.6.0.3. First appears here in LO 7.6.1.2. So a regression
Comment 2 Eike Rathke 2023-11-15 15:50:38 UTC
Further odd thing: while Data Range is empty for second sheet (Tabelle 2), Data Series contains ranges across both remaining sheets and even in wrong order:

Name:     $Tabelle2.$B$1:$Tabelle1.$B$1
X-Values: $Tabelle2.$A$2:$Tabelle1.$A$11
Y-Values: $Tabelle2.$B$2:$Tabelle1.$B$11
labels:   $Tabelle2.$A$2:$Tabelle1.$A$11

Some references update going wonky..
Comment 3 Stéphane Guillou (stragu) 2023-11-15 17:07:41 UTC
Bibisected with linux-64-7.6 repo to first bad build commit [880b3d5c4c648d350e8bb95b5bfbd0382efb5331] which points to core commit 04098a535bf25494379678b9539c4987cb33431f which is a cherrypick of:

commit 94ca402cd1fe2fd9776d08448f7216b7f638e69a
author	Tünde Tóth 	Tue Jul 18 15:20:47 2023 +0200
committer	László Németh 	Tue Jul 25 15:04:01 2023 +0200
tdf#156174 sc DBData: fix regression of database ranges
Regression from commit 0c0444c44107f1a18f23dd0833d462d8dbf56569
"tdf#126926 sc DBData: delete the database range".
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154582

Tünde, can you please have a look?
Comment 4 Stéphane Guillou (stragu) 2023-11-23 08:12:31 UTC
Reproduced on macOS as well:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 2; OS: Mac OS X 13.2.1; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 Stéphane Guillou (stragu) 2023-11-27 14:50:07 UTC
Deleted sheet does not need to be empty to reproduce.
Comment 6 Xisco Faulí 2023-12-05 10:13:33 UTC
My take on it: https://gerrit.libreoffice.org/c/core/+/160333
Comment 7 Eike Rathke 2023-12-05 12:28:08 UTC
I'll investigate the real cause.
Comment 8 Xisco Faulí 2023-12-05 12:29:02 UTC
*** Bug 158054 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2023-12-05 21:41:41 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f35b540279b00575ff79eda1c65fb0f8caad86bf

Resolves: tdf#158223 Revert "fix" for tdf#156174 and follow-up

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Eike Rathke 2023-12-05 21:42:33 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/160354 for 7-6
Comment 11 Commit Notification 2023-12-06 08:28:38 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/c0b46a8270507dc59b731e9c996960374b0db472

Resolves: tdf#158223 Revert "fix" for tdf#156174 and follow-up

It will be available in 7.6.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2023-12-07 17:56:07 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f47ad18cbac928d3ee2511fe4fb25ed61240feb0

tdf#158223: chart2_uichart: Add unittest

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Stéphane Guillou (stragu) 2023-12-08 12:18:02 UTC
Fix verified in:

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0ddd9f7e055a0c1ecb120de3e40c3fdb8373e9dc
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Xisco and Eike!
Comment 14 Stéphane Guillou (stragu) 2023-12-14 07:03:06 UTC
*** Bug 158670 has been marked as a duplicate of this bug. ***
Comment 15 Stéphane Guillou (stragu) 2023-12-22 13:56:11 UTC
*** Bug 158833 has been marked as a duplicate of this bug. ***
Comment 16 Stéphane Guillou (stragu) 2024-02-22 16:04:50 UTC
*** Bug 159608 has been marked as a duplicate of this bug. ***