Bug 128883 - FORMATTING A custom character style with regular text, applied to a word in a custom paragraph style with bold text: the word remains bold.
Summary: FORMATTING A custom character style with regular text, applied to a word in a...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Styles-Character
  Show dependency treegraph
 
Reported: 2019-11-19 00:35 UTC by ro
Modified: 2023-08-08 21:49 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 ro 2019-11-19 00:35:33 UTC
Description:
A custom character style with font-style regular, applied to a word in a custom paragraph style with font-style bold, does not change the font-style of the word to regular like it should.

Steps to Reproduce:
1. In the Styles and Formatting sidebar, create a custom paragraph style with a font style of bold (name it Par_Bold).

2. In the Styles and Formatting sidebar, create a custom character style with a font style of regular (name it Char_Regular).

3. Create a line of text in the document that has the custom paragraph style "Par_Bold" applied (the words will be in bold font).

4. Now select a word in that line and apply the custom character style
"Char_Regular".

5. The word, where the custom character style was applied, should now be in a regular font, but it stays bold which is incorrect.

Actual Results:
Bold Bold Bold Bold

Expected Results:
Regular Bold Bold Bold


Reproducible: Always


User Profile Reset: No



Additional Info:
Custom character styles like font color do behave correctly and will change the color of the word in the above scenario. It's just when the custom paragraph style is set for a bold font, that a custom character style set for a regular font, won't override the bold font of the custom paragraph style!
Comment 1 V Stuart Foote 2019-11-19 01:36:54 UTC
IIUC ODF allows, and you can nest the style from the Character styles with a <Shift>+'double mouse click' pick-- with the target word(s) selected in paragraph, and then pick from the Character styles.

The see also bug 115311 is open to provide GUI for this function.

So, => WFM but not well documented.

@Heiko?
Comment 2 Heiko Tietze 2019-11-19 07:24:26 UTC
When you create a new CS based on content with bold weight it works to set regular. It doesn't when regular is not explicitly selected such as for Emphasis (Italic but though not bold it keeps what PS defines). So the issue is a bug to me. We store only changed attributes (see the organizer) and do not apply unmodified attributes, here related to Default CS/PS.

Possible solution is to introduce radioboxes for font weight "(x) Regular" "( ) Bold" "( ) Italic" "( ) Bold, Italic" but we run into trouble with 4 or more variants (see also bug 35538). Perhaps we just have to consider Regular as on by default - and put all non-changed values into the document.
Comment 3 Mike Kaganski 2019-11-19 07:49:04 UTC
I cannot reproduce creating a correct "not bold" character style.

1. Create a new CS (right-clicking in a whitespace in the style manager and choosing New)
2. Make sure that on Organizer tab, it has no parent, and that nothing is shown under "Contains" initially: the originally created style has nothing in it
3. Switch to Font tab; select Bold in Style selector
4. Switch back to Organizer tab, and see that "Contains" now has "Western text: bold", because we had that control changed from the original default value
5. Switch to Font tab; select Regular in Style selector
6. Switch back to Organizer tab, and see that "Contains" now has "Western text: normal", because we had that control changed from the original default value, and setting it back to old value still considers its value changed

Now save the style and use normally.

The bug here is not that we save or not save something, but lack of indication of changed state of any control, and also lack of ability to revert a selected control (not the whole tab) into "unset" state.
Comment 4 Mike Kaganski 2019-11-19 08:10:07 UTC
We should better introduce a special kind of container control for style dialog tabs, that would contain a checkbox meaning "set here", and that would activate the actual control (e.g. the "Regular/Bold/Italic/..." selector) when checked. That way it needs more space, bit every control's state is clear immediately, and manageable (inchecking it clears it). Or each control could have its label becoming bold when explicitly set here, and a context menu item to clear it (unset).
Comment 5 Heiko Tietze 2019-11-19 09:07:04 UTC
(In reply to Mike Kaganski from comment #3)
> I cannot reproduce creating a correct "not bold" character style.
> 3. Switch to Font tab...
> 5. Switch to Font tab...

Without switching on/off you don't get an entry in the organizer and thus nothing is set. That's why a bold PS is not changed into regular with a CS that has a regular font but not explicitly set.

(In reply to Mike Kaganski from comment #4)
> We should better introduce a special kind of container control...

Yes, something like "[ ] Include in style definition", perhaps set per context menu.
Comment 6 QA Administrators 2021-11-19 05:18:42 UTC Comment hidden (obsolete)
Comment 7 João Paulo 2023-08-08 21:49:48 UTC
I can confirm that this bug is still present on:

Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: ca8fe7424262805f223b9a2334bc7181abbcbf5e
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: pt-BR (pt_BR); UI: pt-BR
Calc: threaded

The steps I did to reproduce it:

1. Download and install Merriweather Sans font family from "https://www.fontsquirrel.com/fonts/merriweather-sans";
2. Create a new text document and change the Default Paragraph Style to Merriweather Sans Bold, Book, Extra Bold or anything that is not Regular;
3. Type something as "1) This text is shown in bold, 2) this text will be shown as Regular";
4. Create a new character style "Regular character style" and set the typeface to be Merriweather Sans Regular;
5. Apply the newly created "Regular character style" to the "2) this text will be shown as Regular" already typed;
6. It should show the text with the Regular character style instead of the Bold/Book/Extra Bold or anything that was set in Step 2.