Bug 170489 - FORMATTING Inheritance isn't preserved/restored when setting paragraph style font size to 100% or +0pt
Summary: FORMATTING Inheritance isn't preserved/restored when setting paragraph style ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Size
  Show dependency treegraph
 
Reported: 2026-01-26 21:23 UTC by Paolo Benvenuto
Modified: 2026-02-01 00:08 UTC (History)
13 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 Paolo Benvenuto 2026-01-26 21:23:54 UTC
When a new paragraph styles is created based on another style, it's given a font size equal to the parent. If the parent's font size is changed, the child follows it (inheritance).

If the child style is given a relative font size, either as a percentage (like 120%) or a difference (like +2pt), any modification of the parent font size is reflected in the child according to the child relative value. Inheritance is preserved.💪🏻

If the child style is given a different absolute font size, the inheritance is lost: OK.

The bug: if the child style is given 100% or +0pt font size, the user expects that inheritance is preserved (if coming from a different relative value) or restored (if coming from an absolute value). However, it doesn't happen. What happens precisely?

- Inheritance is lost: differently from when the child style was created without modifying font size, now modifying the parent font size doesn't produce a corresponding change in the child.

- The relative value (100% or +0pt) is converted to the absolute value (this is bug #41360). I have investigated quite a lot about that, and it seems that this behaviour cannot be changed without modifying strongly the way LO stores paragraph style data. According to this current bug, this behaviour could be accepted, provided that inheritance is restored. Lamentably, the user remains confused, but if the behaviour is equivalent to that of 100% of +0pt, he can get over it.

When the child style is given an absolute value equal to the parent one, inheritance shouldn't be preserved; actually, 100% or +0pt are at the user disposal if he wants inheritance. Otherwise, if inheritance were restored in this case, there would not be any way to set the child font size the same value as the parent without inheritance.
Comment 1 Paolo Benvenuto 2026-01-26 21:27:14 UTC
Supposedly a legay OOo bug.

I have a fix for this bug.
Comment 2 Regina Henschel 2026-01-27 00:00:00 UTC
The approach in https://gerrit.libreoffice.org/c/core/+/198156
describes the cases
This fix handles three cases:
- Absolute values matching parent (e.g., 10pt when parent is 10pt)
- Relative 100% (meaning "same as parent")
- Relative +0pt (meaning "no change from parent")

This report described an approach to only reset to inheritance in case of the relative values 100% and +0pt. That is better and I would agree to that.

I hope I have understand you correctly, that you will drop the case "- Absolute values matching parent (e.g., 10pt when parent is 10pt)"?
Comment 3 Paolo Benvenuto 2026-01-27 07:11:15 UTC
@Regina, you understood well, I'm dropping the case of absolute values matching parent
Comment 4 Regina Henschel 2026-02-01 00:08:55 UTC
As long as bug 89826 is not solved, this patch seems to be a suitable solution to reset the font size to inherit from parent.

I have tested the patch and it works as intended. But I'm no expert for Writer and thus cannot judge, whether the chosen solution will conflict with other areas or has side effects. Perhaps ask Michael Stahl for patch review (he is listed on https://wiki.documentfoundation.org/FindTheExpert) or ask on the developers mailing list (after FOSDEM).

@Paolo, in case you continue to work on this issue, please assign the bug to yourself.
I do not find you on https://wiki.documentfoundation.org/Development/Developers. Please follow the guide there for providing a license statement.