Bug 156689 - Deleting empty column(s) removes styling / formatting of adjacent column
Summary: Deleting empty column(s) removes styling / formatting of adjacent column
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.5.2 release
Hardware: All All
: high major
Assignee: Xisco Faulí
URL:
Whiteboard: target:25.2.0 target:24.8.0.3 target:...
Keywords: bibisected, bisected, regression
: 157188 157525 162040 (view as bug list)
Depends on:
Blocks: Calc-Styles Cell-Management
  Show dependency treegraph
 
Reported: 2023-08-09 03:52 UTC by Saburo
Modified: 2024-08-08 22:00 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Condition Format test file (9.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-09-19 07:22 UTC, Saburo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Saburo 2023-08-09 03:52:54 UTC
Description:
Deleting columns to the right of the rightmost column in a used cell range can revert the style of the rightmost column.

Steps to Reproduce:
1.Enter "aaa" in cell A1
2.Set a style to cell A1 (e.g. Heading 1)
3.delete column B

Actual Results:
Column A has been unstyled

Expected Results:
Don't undo the style of the irrelevant column A .


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
Sometimes it doesn't happen when you insert a column

Deleting multiple columns may remove styles for columns other than the rightmost column


Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: ca8fe7424262805f223b9a2334bc7181abbcbf5e
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded
Comment 1 ady 2023-08-09 04:34:01 UTC
I can confirm.

Additionally, after the STR from comment 0, I add some steps to show how this is some quirk:

1. Enter "aaa" in cell A1
2. Set a style to cell/column A1 (e.g. Heading 1)
3. Delete column B (note: this is to the right side of the right-most column)

As pointed, the style in A1 is no longer there.

4. Undo all the 3 actions ([CTRL]+[Z] times 3)
5. Redo all the 3 actions ([CTRL]+[Y] times 3)

Now the style _is_ still applied.

Please also note that the following slightly different steps do not show the problem:

1. Enter "aaa" in cell A1
2. Set a style to cell/column A1 (e.g. Heading 1)

3. Cell C1: 1

4. Delete column B (note: this is to the _left_ side of the right-most column; i.e. some middle column).
Comment 2 Saburo 2023-08-13 02:00:12 UTC
I confirmed that not only styles but also conditional formatting disappear

Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded
Comment 3 m_a_riosv 2023-09-11 14:54:09 UTC
*** Bug 157188 has been marked as a duplicate of this bug. ***
Comment 4 Kira Tubo 2023-09-19 04:59:50 UTC
Able to reproduce original report with styles using daily master build. Unable to reproduce with conditional formatting from Comment 2. 

Not reproducible using v. 3.3, therefore it is a regression. 

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 36163d269bd8f77a86605e4c5ff5adce17b4c66c
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 5 Kira Tubo 2023-09-19 05:31:40 UTC
Bibisected win64-7.5. Added Czeber László Ádám to cc. 

Regression occurring at:
https://git.libreoffice.org/core/+/93c6fdc58d577d059968a71ae08b80096f73ef1a


commit 93c6fdc58d577d059968a71ae08b80096f73ef1a	[log]
author	Czeber László Ádám <czeber.laszloadam@nisz.hu>	Thu Jun 08 14:55:34 2023 +0200
committer	Xisco Fauli <xiscofauli@libreoffice.org>	Tue Jun 27 22:36:53 2023 +0200
tree 9f3c8663de60cfc4f9a84221db3be69a7b1f581c
parent 8ad80d1f07cd2f8c483ef2f8678eee0b147e5b43 [diff]


commit 9432d97af3772794a63f9c4a28a04ea0b6668d7e
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Tue Jun 27 14:16:17 2023 -0700

    source 93c6fdc58d577d059968a71ae08b80096f73ef1a
Comment 6 Saburo 2023-09-19 07:22:22 UTC
Created attachment 189692 [details]
Condition Format test file

1.Test file Open
2.Delete culumns("B")

The conditional formatting settings remain, but the background color and text decorations are removed.
The background and text decorations will not be restored unless you reopen the file or edit the conditional formatting.

I think this is a different issue than the original bug.
Comment 7 Kira Tubo 2023-10-06 20:10:21 UTC
(In reply to Saburo from comment #6)
> Created attachment 189692 [details]
> Condition Format test file
> 
> 1.Test file Open
> 2.Delete culumns("B")
> 
> The conditional formatting settings remain, but the background color and
> text decorations are removed.
> The background and text decorations will not be restored unless you reopen
> the file or edit the conditional formatting.
> 
> I think this is a different issue than the original bug.

Thanks for the sample document @Saburo. Actually, it seems I am able to reproduce this, but only if I scroll down after step 2. So steps for me are:

1. Open test file attachment 189692 [details]
2. Delete columns("B")
3. Scroll down until cells containing data are no longer visible
4. Scroll back up to cells containing data

It looks like this issue also starts at the same commit from the bibisect I did on Comment 5, so I am inclined to think that it is actually part of the same issue. Let's keep it as part of the same bug report for now.
Comment 8 BogdanB 2023-10-07 08:44:29 UTC
I use at work 7.6.2 and this bug it's annoying. I have many formatted cells from documents I receive, and when I delete some columns after that formatted columns, the formatted is lost. So I need to undo, and delete what I need more carefully.
Comment 9 Stéphane Guillou (stragu) 2023-10-16 14:38:50 UTC
*** Bug 157525 has been marked as a duplicate of this bug. ***
Comment 10 Xisco Faulí 2024-07-30 10:47:26 UTC
*** Bug 162040 has been marked as a duplicate of this bug. ***
Comment 11 ady 2024-07-30 11:51:50 UTC
Regression from the series of commits from tdf#153437.

From dupe bug 162040:

STR:
1. New Calc.
2. Cell A1: 100% [TAB]
3. Cell B1: [CTRL]+[SPACE BAR]
4. [CTRL]+[-] (that's the minus sign key; to delete the column)
5. [PgDn], [PgUp] (to scroll the main area so the view of the cell is refreshed).

Actual result:
Cell A1 shows the value 1 with cell format as General/Standard (instead of the equivalent 100%).

Expected result:
Cell A1 unmodified, showing 100% (cell format 0.00%).


Problem: step 4 (see above) deletes the cell format of column A; it shouldn't.

Please note that there are several minor variations of this problem. For example, with attachment 195303 [details], deleting column D only (instead of columns C:D), will delete the format of column B, whereas column A remains with its original format.
Comment 12 Xisco Faulí 2024-07-30 12:08:15 UTC
This patch seems to fix the issue for me: https://gerrit.libreoffice.org/c/core/+/171242
Comment 13 BogdanB 2024-07-30 19:01:01 UTC
Xisco, if this commit is the right one, please backport it. It's a very annoying bug affecting 24.2.
Comment 14 Commit Notification 2024-07-30 19:03:24 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#156689: don't initialize the last columns from the default attributes

It will be available in 25.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 15 BogdanB 2024-07-30 20:08:52 UTC
Good in
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9bf97034601af0fd679a2d4349b6ac31be5e315d
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Bad in (for reference)
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Xisco, thanks for this fix!
Comment 16 Commit Notification 2024-08-08 20:46:45 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-0":

https://git.libreoffice.org/core/commit/2114e198e931ba33a6be6acf7aeecb1f5cb8309f

tdf#156689: don't initialize the last columns from the default attributes

It will be available in 24.8.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 17 Commit Notification 2024-08-08 21:57:57 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/3c0a7538269e0f03174d0cd54189f384c1717c80

tdf#156689: don't initialize the last columns from the default attributes

It will be available in 24.8.1.

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 18 Commit Notification 2024-08-08 21:59:01 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#156689: don't initialize the last columns from the default attributes

It will be available in 24.2.6.

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.