ODF import of a document containing these automatic styles: <style:style style:family="text" style:name="A25" style:parent-style-name=""> <style:text-properties fo:background-color="#d3d3d3"/> </style:style> <style:style style:family="text" style:name="A26" style:parent-style-name=""> <style:text-properties fo:background-color="inherit" fo:color="inherit"/> </style:style> applied like this: <text:p>foo <text:span text:style-name="A25"><text:span text:style-name="A26">bar</text:span></text:span> baz</text:p> first, the value "inherit" is invalid and doesn't exist in ODF, but if we use a real color it would be the same problem. on ODF import, the 2 nested applied automatic styles are handled properly in xmloff as XMLStyleHint_Impl, but inserting into Writer may order them in any order depending on random chance, so the color that's visible may be from any applied style. this is due to an optimization in SwpHints::TryInsertHint(). LO doesn't write files like this, but probably it should be able to import them deterministically. weirdly, i can never reproduce the bug the 1st time i load the bugdoc, but from the 2nd time the problem happens randomly. reproduced in OOo 3.3 so ancient bug.
Created attachment 181254 [details] minimized reproducer document
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d7827f712ddd21a6c1e151f54dc6eba5c12690da tdf#149978 sw: ODF import: fix nondeterministic automatic styles It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
fixed on master
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/589111d34eb333196490f0bae2e3542a5e6bc13d tdf#149978 sw: ODF import: fix nondeterministic automatic styles It will be available in 7.4.0.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-7-3": https://git.libreoffice.org/core/commit/7a8f2c7e3a16dae6bdc891fb969e673527e45615 tdf#149978 sw: ODF import: fix nondeterministic automatic styles It will be available in 7.3.6. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.