Description: Some style changes (such as "bold") are not applied to specific cells when multiple cells are selected, but the same changes work correctly if only one cell is selected. Steps to Reproduce: 1. Load the attached "style-test.ods" file; 2. Select all row 1 cells; 3. Press the "Bold" button in the toolbar. Actual Results: Text in A1 and C1 cells becomes bold, but there is no visible change in B1. Expected Results: Text in B1 should become bold as it happens with the remaining cells. Reproducible: Always User Profile Reset: Yes Additional Info: Version: 7.1.5.2 (x64) / LibreOffice Community Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5 CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: en-GB (en_GB); UI: en-GB Calc: threaded - The same issue is reproducible with multple style changes (e.g. bold, italic, underline, font face) but not with all of them (font size is correctly applied). - Selecting only the B1 cell, the "Bold" button works as expected. - Inspecting the "content.xml" from the ODS file shows that the problematic cell uses two non-default styles for its text, while the other cells do not, which may be relevant to the issue.
Created attachment 174158 [details] File containing a cell that suffers from the described problem
(In reply to fabio from comment #0) > - Selecting only the B1 cell, the "Bold" button works as expected. In fact, no. It only works "as expected" when the cell is *focused* (i.e., when you click on it, and it receives the bold border showing focus, but not filling showing selection). But *selecting* this single cell (e.g., starting selection from this cell, extending to a neighbor, and then moving the mouse back to B1 to only have a single cell selected) shows the same behavior (Bold not applied to the contents of the cell). And the reason for the difference is that applying a property to *cells selection* only applies it to cell level; while applying it to a focused cell in the absence of selection *additionally* goes inside the cell, and for each span inside the cell, also resets the direct formatting related to this property. This is similar to Writer's relations between Paragraph-level and Character-level direct formatting, with character-level one taking precedence. Not a bug IMO.
(In reply to Mike Kaganski from comment #2) > In fact, no. It only works "as expected" when the cell is *focused* (...) Thanks for clarifying my description. While I know that there is a difference between selection and focus, I failed to describe the behaviour difference in those terms as you did for me. > And the reason for the difference is that applying a property to *cells > selection* only applies it to cell level; while applying it to a focused > cell in the absence of selection *additionally* goes inside the cell (...) From a technical standpoint I can understand why it may make sense that style changes are applied "recursively" or not depending on the context, but from an end-user user perspective I still find it misleading that selecting cells that only contain non-bold text and pressing "Bold" results in cells in "bold" state but no visual difference. But surely something being unexpected for a single user does not mean it is a bug. :) > This is similar to Writer's relations between Paragraph-level > and Character-level direct formatting, (...) Taking your analogy with Writer, that I find useful, I still have a couple of questions: (1) In Writer, if we do "Select All" and "Bold" in a document with diverse mixed paragraph and character level formatting, the result is that all the text becomes bold. In Calc, if I do the same steps I may end up with some cells that are effectively bold and others that still display non-bold text. Does this difference make sense? (2) If it's a question of formatting not being applied "recursively" to text spans inside the cell in some cases, why is font size always applied and respected (either using focus or selection) while, for example, font face is not? Apologise me in case these questions may have trivial questions that I could not antecipate or if they dodn't make much sense in the context of a bug report but I'm just trying to undertand the situation better. Thanks for your comments and your time.
(In reply to fabio from comment #3) First of all, please don't apologize - it's great that you file it; and indeed it looks unexpected. It seems to be a usability issue here (even though technically it "works as designed", the design is subject to change) :-) Adding UX team to discussion - something I needed to do from the start.
Sorry, I don't get it. I select A1:A3 and make it bold, which results in B1 remaining normal. But the cell property is bold. Cannot see any difference to the other cells and cannot reproduce in a new line.
Created attachment 174754 [details] How to create anew
(In reply to Mike Kaganski from comment #6) > Created attachment 174754 [details] > How to create anew Are we really talking about different formatting within a single cell like "[A1] Hello [B1] brave <b>new</b> [C1] world" where the actual user expectation is to keep the format. In the original example the complete cell stays formatted and I still fail to create an example. When I modify the formatted text so the whole cell is either bold or not, the format will not be kept subsequently.
(In reply to Heiko Tietze from comment #7) Heiko: just open the file's XML, and see. It has two text spans, having slightly different formatting (I didn't check further than spotting a difference in East Asian fonts). This prevents the formatting that is common to both spans (no bold) to merge. But I fail to see what you are trying to achieve when insist on reproducing from scratch. Th problem is in the span formatting that has a higher precedence over cell formatting (the same way as character formatting has precedence over paragraph formatting in Writer); this may come from some *conforming, valid* ODF generators (even if LO UI makes it difficult to create such a markup from scratch); and the question is - do we want to keep such behavior in Calc for such runs, or do we want to change it. Regardless of the "repro from scratch" steps. From UX perspective.
(In reply to Mike Kaganski from comment #8) > ...do we want to keep such behavior in Calc for such runs That's what I try to figure by reproducing the result. The behavior is definitely wanted and I assume the issue to be a very rare corner case.
Changing the behavior means to overwrite character attributes on cell formatting. Something like A1="Lorem <b>ipsum</b> dolor" would be deleted on A1=bold/regular. Sounds reasonably for this simple use case, also because these attributes are hard to impossible to detect. However, the format is applied as complex style and we cannot just clear the font weight without significant effort. The solution is to simply clear direct formatting. => NAB.