Bug 133134 - Inconsistency between paragraph style/character style overwritting direct formatting when applying
Summary: Inconsistency between paragraph style/character style overwritting direct for...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks:
 
Reported: 2020-05-17 20:43 UTC by Telesto
Modified: 2020-05-18 08:52 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (9.01 KB, application/vnd.oasis.opendocument.text)
2020-05-17 20:44 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-05-17 20:43:57 UTC
Description:
Inconsistency between paragraph style/character style overwritting direct formatting when applying

Steps to Reproduce:
1. Open the attached file
2. CTRL+A
3. Apply Paragraph style Text Body -> Formatting gone
4. Undo
5. With text still selected
6. Go to character style
7. Choose Example -> Nothing happens

Actual Results:
Selecting Paragraph style overwrites direct formatting
Character style doesn't

Expected Results:
Pick something.. I don't get the logic doing two different things


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.0.0.alpha1+ (x64)
Build ID: f9790da286f2d2fa47f1748f8cfa6172c6622ca3
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: de-CH (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-05-17 20:44:09 UTC
Created attachment 160953 [details]
Example file
Comment 2 BogdanB 2020-05-17 20:55:42 UTC
In this case default is Liberation Serif and Example is Liberation Mono. So, you can not see the difference. Try with another character style. It will work.
Comment 3 Telesto 2020-05-17 21:31:40 UTC
(In reply to BogdanB from comment #2)
> In this case default is Liberation Serif and Example is Liberation Mono. So,
> you can not see the difference. Try with another character style. It will
> work.

True.. but Paragraph style is removing all direct formatting: bold, underline Italic, strike through, font color, highlighting... and character style doesn't
Comment 4 BogdanB 2020-05-17 21:38:03 UTC
I confirm it.
But I tested with other styles.
Comment 5 BogdanB 2020-05-17 21:39:22 UTC
In fact I noticed this bug a year ago, but I thought this was so by design.
Comment 6 Telesto 2020-05-17 22:04:12 UTC
(In reply to BogdanB from comment #5)
> In fact I noticed this bug a year ago, but I thought this was so by design.

I report it as a bug, when I assume it's bug.... it could still be by design :-).
Comment 7 Heiko Tietze 2020-05-18 07:42:15 UTC
Insert formatted dummy text [1] and apply PS to the paragraph with DF. Nothing changes. And applying CS to the DF-formatted text adds those attributes to the DF.

My first thought was that "Default PS" means no style has been applied and setting a PS forces an override. Workaround would be to set Text Body by default (bug 47295). See also bug 89826.

But if you add a second word to your example and remove the formatting it works as expected (CS and DF remains). Meaning PS changes the formatting only when the whole paragraph has the same formatting. Hard to understand for users.

Michael S, any insights?

[1] https://extensions.libreoffice.org/extensions/formatted-dummy-text
Comment 8 Mike Kaganski 2020-05-18 08:09:55 UTC
There is no bug here.

You have some settings defined on *paragraph* level: text background, strike-out, underline, character style. They define character look and feel, but - again - are defined on the *paragraph* level.

Applying any style only clears DF *on its level*; and *only that formatting that is defined in the style*.

Applying a paragraph style clears all DF *on paragraph level* - because PS always defines *all* paragraph formatting.

Applying a character style clears the DF *for settings defined in the CF*; and only that *defined on the character level*. (The visual result would be as if paragraph-level setting is replaced - but not because paragraph-level DF was cleared, but because it was overridden.)

Since CS *only* defined some settings, and not all, that relate to character appearance and behaviour, it's normal to see that all settings not defined in "Example" SC are still taken from paragraph level. Even if they were defined on character level, they wouldn't be cleared either, because - well, as I said, only properties defined in style are cleared from DF for the affected text run.
Comment 9 Heiko Tietze 2020-05-18 08:24:03 UTC
(In reply to Mike Kaganski from comment #8)
> You have some settings defined on *paragraph* level..

Could you please go in detail with "defining on paragraph level" vs. "defining on character (or selection?) level"? 
It doesn't fit my model of PS > CS > DF. I assume some code, cleaning DF when all PS is formatted similarly rather than putting the attribute on different levels depending on... what?
Comment 10 Mike Kaganski 2020-05-18 08:36:31 UTC
(In reply to Heiko Tietze from comment #9)
> ... my model of PS > CS > DF

Heh, your model is wrong. In the simplified case of only considering two kinds of formatting (paragraph vs character), the model is like "PS > paragraph-level DF > CS > character-level DF".

Paragraph-level settings include all properties specific to paragraph (like line spacing or indents), but *also* all character properties as some default for the paragraph content. And if your DF applies to *characters* or to *paragraph* depends on the selection at the moment of applying the DF. Of course, when you select a couple of characters in the middle of a paragraph, and modify left indent, that setting naturally goes to the paragraph level - just because that setting can't be on character level. But when you define underlining, *if you selected a couple characters in the middle*, it's a character-level DF; and *if you selected the whole paragraph*, it's defined on paragraph level. It's just a decision (I suppose, some UX-based), and it could be defined differently (like always defining DF for character properties on character level) - but I don't know what is broken by that.

However, that is irrelevant to this issue. Be the color and character style defined on paragraph level, or on character level, would not change the observed result of comment 0. Because what matters is that applying any style only resets DF fro properties *defined in the style*, and the CS in question ("Example") defines only a single "font name" property, thus any other property would not be modified (or overridden).
Comment 11 Heiko Tietze 2020-05-18 08:52:10 UTC
Thanks for the clarification, Mike.