Bug 90221 - Formatting not saving after "clear direct formatting"
Summary: Formatting not saving after "clear direct formatting"
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2015-03-25 08:13 UTC by tomaskeb
Modified: 2018-12-28 08:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

formatting.odt: select all, make red font color, clear direct attributes, make red again and save. (13.46 KB, application/vnd.oasis.opendocument.text)
2015-03-25 08:13 UTC, tomaskeb

Note You need to log in before you can comment on or make changes to this bug.
Description tomaskeb 2015-03-25 08:13:32 UTC
Created attachment 114326 [details]
formatting.odt: select all, make red font color, clear direct attributes, make red again and save.

1) Open a new document, insert some "Heading 1" and some "Body Text" under it.
2) Select it all and color it red.
3) Clear direct formatting.
4) Color it red again and save the document.
5) After reopening the document, the "Heading 1" lacks the red color.
Comment 1 A (Andy) 2015-03-25 22:13:58 UTC
Reproducible with LO, Win 8.1
Comment 2 Matthew Francis 2015-04-07 01:36:37 UTC
Occurs all the way back to OOo / LO 3.3.0

-> Version: Inherited from OOo
Comment 3 tommy27 2016-04-16 07:27:07 UTC Comment hidden (obsolete)
Comment 4 tomaskeb 2016-04-17 10:17:43 UTC
Still there in LO 5.1.2 on Windows 10 x64.
Comment 5 QA Administrators 2018-09-19 02:51:57 UTC Comment hidden (obsolete)
Comment 6 Octavio Alvarez 2018-09-19 02:57:17 UTC
Seen in:

Build ID: 1:6.1.1~rc1-2
CPU threads: 4; OS: Linux 4.2; UI render: default; VCL: x11; 
Locale: en-US (en_US.utf8); Calc: group threaded
Comment 7 tomaskeb 2018-12-25 08:42:19 UTC
Still in
Comment 8 Timur 2018-12-25 16:31:25 UTC
After 2):
<text:h text:style-name="P3" text:outline-level="1">h1</text:h>
<text:p text:style-name="P2">tb1</text:p>

<style:style style:name="P3" style:family="paragraph" style:parent-style-name="Heading_20_1">
<style:text-properties fo:color="#c9211e"/>

<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:text-properties fo:color="#c9211e" officeooo:rsid="0002cb8e" officeooo:paragraph-rsid="0002cb8e"/>

After 3):
<text:h text:style-name="Heading_20_1" text:outline-level="1">h1</text:h>
<text:p text:style-name="Text_20_body">tb1</text:p>

After 4):
<text:h text:outline-level="1">h1</text:h>
<text:p text:style-name="P1">tb1</text:p>

<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:text-properties fo:color="#c9211e"/>
Comment 9 Timur 2018-12-27 11:17:22 UTC
Justin, since you're already on Bug 47471, can you please check whether this is a duplicate?
Comment 10 Justin L 2018-12-27 11:48:42 UTC
No, it is not a duplicate, but highly related.
0.) round-trip file. Paragraph 1 saved with style Heading 1
1.) apply red color and save: Paragraph 1 saved with autostyle P2.
2.) clear direct formatting and save. Paragraph 1 saved with style Heading 1.
3.) re-apply red color and save: Paragraph 1 has an empty autostyle. In fact, I'm kinda surprised that the Heading 1 style isn't lost altogether and that it didn't revert to default style.

It seems like this is a missing notification / missing cache flush scenario? Probably a fix for this would also fix bug 47471.
Comment 11 Justin L 2018-12-27 12:03:51 UTC
I should also have mentioned, if you hit <enter> after Heading 1 in the text, that is enough to "re-generate" the new P# autostyle.