Bug 158254 - Can not apply any cell styles to the right of area with content
Summary: Can not apply any cell styles to the right of area with content
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:24.8.0 target:24.2.0.2 target:...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Calc-Styles regressions-InitialColCount-to-1
  Show dependency treegraph
 
Reported: 2023-11-17 15:18 UTC by Andreas Säger
Modified: 2024-01-10 14:22 UTC (History)
5 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 Andreas Säger 2023-11-17 15:18:51 UTC
Description:
Cell styles are not applied to range selections right of current area.

Steps to Reproduce:
1.Open new Calc document.
2.Enter some data in column A (formula, text, number, anything)
3.Select some cells right of column A
4. Apply some cell style.

Actual Results:
The cell style remains "Default"

Expected Results:
Cell style changes.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Happens most of the time but not always. 
See https://ask.libreoffice.org/t/how-can-this-be-an-unknown-issue/98343
Comment 1 Andreas Säger 2023-11-17 15:20:33 UTC
Selections below the current area are formatted in the same columns but not farther to the right-
Comment 2 m_a_riosv 2023-11-17 15:54:27 UTC
Looks like a duplicate of tdf#153527


Please reopen it if you do not agree.

*** This bug has been marked as a duplicate of bug 153527 ***
Comment 3 Andreas Säger 2023-11-17 15:59:31 UTC
The user who filed issue #153527 expects hard formatting attributes expanding automatically without insertion of columns and rows. IMHO, this is a wrong expectation.

My issue does not affect hard formatting. A double-click in the stylist window does nothing when the selected range (not single cell) is right of the used area.
Comment 4 Werner Tietz 2023-11-17 16:01:40 UTC
ok

The behaviour is really funny:

new Sheet with no data no Style will be applied to any Selection

___

enter some data into cell A3; select Cellrange A3:D7 
try to apply some CellStyle →→ 
**the Style is applied only to CellRange A3:A7**

__

enter additional Data for Example into D4
select A3:D7
apply some Cellstyle
the Style correctly applies to the whole Cellrange A3:D7 
but also only to A3:D7 if the Selection was **A3:F7** 

__
so I can confirm with **both**:
Version: 7.6.2.1 (AARCH64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: en-US
Flatpak
Calc: threaded

Version: 7.4.7.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 4:7.4.7-1
Calc: threaded
Comment 5 Vladimir Sokolinskiy 2023-11-17 16:17:39 UTC
In my experiments, the range of sheet cells to which the style is successfully applied is determined as follows.
1. Determine the used area of the entire sheet as described in XUsedAreaCursor Interface:
"The used area is the smallest cell range that contains all cells of the spreadsheet with any contents (values, text, formulas) or visible formatting (borders and background color)" (keyboard Ctrl+Shift+End).
2. Expand the area from point 1 to entire columns.

LO 7.5.7.1 Win 10.
Comment 6 Andreas Säger 2023-11-18 11:07:10 UTC
(In reply to Vladimir Sokolinskiy from comment #5)
> In my experiments, the range of sheet cells to which the style is
> successfully applied is determined as follows.
> 1. Determine the used area of the entire sheet as described in
> XUsedAreaCursor Interface:
> "The used area is the smallest cell range that contains all cells of the
> spreadsheet with any contents (values, text, formulas) or visible formatting
> (borders and background color)" (keyboard Ctrl+Shift+End).
> 2. Expand the area from point 1 to entire columns.
> 

2. Expand from cell A1 to the entire columns of the used area. 
If the area is M10:N20, A1:N1048576 accepts cell styles.
Comment 7 Buovjaga 2023-11-29 14:39:13 UTC
Bibisected with linux-64-7.4 to 9e2d48b9e04f7ea895fb095699c32ed8a44eb129
reduce Calc's INITIALCOLCOUNT to 1
Comment 8 Mike Kaganski 2023-12-30 12:18:56 UTC
https://gerrit.libreoffice.org/c/core/+/161441
Comment 9 Commit Notification 2023-12-30 13:44:20 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7e5a345897e633083ce0194a34c4faac54d28371

tdf#158254: generalize and use algorithm to apply with allocation

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 10 Commit Notification 2023-12-30 16:45:37 UTC Comment hidden (off-topic)
Comment 11 Mike Kaganski 2023-12-30 16:46:26 UTC Comment hidden (off-topic)
Comment 12 ady 2023-12-30 19:16:57 UTC Comment hidden (off-topic)
Comment 13 Mike Kaganski 2023-12-31 03:05:45 UTC
(In reply to ady from comment #12)
> Reverting the fields that were wrongly modified.

Fine then, if fix from comment 9 doesn't count for any, let me revert it.
Comment 14 ady 2023-12-31 04:18:35 UTC
(In reply to Mike Kaganski from comment #13)
> (In reply to ady from comment #12)
> > Reverting the fields that were wrongly modified.
> 
> Fine then, if fix from comment 9 doesn't count for any, let me revert it.

@Mike, there must be some misunderstanding from my part. You posted that the commit was related to a different report, so I reverted the fields in this report in order to match their prior status. I was not talking about the code.
Comment 15 Mike Kaganski 2023-12-31 04:41:36 UTC
(In reply to ady from comment #14)

I mentioned a very specific message to reply to. The commit in comment 10 was indeed for a different bug. But I would appreciate if you assume some intelligence in me, and expect that I would reset fields myself if necessary.
Comment 16 Buovjaga 2023-12-31 09:18:00 UTC
Verified fix.

Arch Linux 64-bit, X11
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 025a49a40a3c0c1be5bf4383e87a1cc60014b7f4
CPU threads: 8; OS: Linux 6.6; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 31 December 2023
Comment 17 Commit Notification 2024-01-03 09:24:04 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/9826f6175bda0d5812ac1cdf22431973524ec0f6

tdf#158254: generalize and use algorithm to apply with allocation

It will be available in 24.2.0.2.

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-01-08 08:51:50 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#158254: don't shrink to data area when applying to entire sheet

It will be available in 24.2.0.2.

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 19 Commit Notification 2024-01-09 22:40:29 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#158254: sc_uicalc2: Add unittest

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

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

tdf#158254: sc_uicalc2: Add unittest

It will be available in 24.2.0.2.

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 21 Commit Notification 2024-01-10 13:18:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#158254: generalize and use algorithm to apply with allocation

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 22 Commit Notification 2024-01-10 13:18:12 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#158254: don't shrink to data area when applying to entire sheet

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 23 Commit Notification 2024-01-10 14:22:29 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/227836ab20278ba7232d61ec14abe18b9132fdbe

tdf#158254: sc_uicalc2: Add unittest

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.