Bug 156321 - FORMATTING: Styles lost on nested <span> elements in content
Summary: FORMATTING: Styles lost on nested <span> elements in content
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.6.2 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.2.0 target:7.6.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Styles
  Show dependency treegraph
 
Reported: 2023-07-17 04:45 UTC by Phillip
Modified: 2024-11-12 21:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case to demonstrate issue (6.23 KB, application/vnd.oasis.opendocument.text)
2023-07-17 04:46 UTC, Phillip
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phillip 2023-07-17 04:45:06 UTC
Description:
I'm working on software that generates odt files, and recently we have been having an issue where some styles aren't coming across correctly in LibreOffice.

In particular, if we have two <text:span> nested elements, the styles in the outer span are not necessarily applied to text inside the inner span. This seems to be happening when *all* the text is inside the inner span, I suspect something is trying to collapse the two spans together into a single element and some of the styles are getting lost in the process.

See the attached sample, which I've minimised as much as I can... in the first paragraph we have a span with bold formatting, and inside that a span with a font set... opening that in LO, the text has the specified font, but is not bold. In the second paragraph there is extra text between the two spans, and in this case the bold formatting is applied appropriately.

Is there something wrong with the document here, that we aren't generating it correctly? Or is this a bug in LO?

It was working correctly in 7.3.7.2, with both paragraphs coming through in bold, but the issue is reproducible in 7.4.7.2 and 7.5.4.2.

Steps to Reproduce:
1. Open the attached odt file

Actual Results:
The first paragraph is not in bold, while the second paragraph is bold.

Expected Results:
Both paragraphs are in bold.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: en-AU (en_AU); UI: en-US
Calc: threaded
Comment 1 Phillip 2023-07-17 04:46:11 UTC
Created attachment 188404 [details]
Test case to demonstrate issue
Comment 2 Phillip 2023-07-18 04:59:55 UTC
On further testing, looks like it was working in 7.4.5.1 but not working in 7.4.6.1 so hopefully that narrows it down...
Comment 3 toi 2023-07-27 07:50:30 UTC
Thank you for reporting the bug. I can confirm that the bug is present in
Version: 7.4.6.1 / LibreOffice Community
Build ID: cf1691909b7b17c5e258d2635cae0072cf471be7
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded


But the bug disappeared in
Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 raal 2023-08-09 17:28:01 UTC
This seems to have begun at the below commit in bibisect repository/OS linux-64-7.5$.
Adding Cc: to Miklos Vajna ; Could you possibly take a look at this one?
Thanks
 d65ec3defebb28be07f5f6fc35fccd9b841536ac is the first bad commit
commit d65ec3defebb28be07f5f6fc35fccd9b841536ac
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Tue Dec 20 16:58:25 2022 +0100

    source 209dce614c43f63f63f5b42a746665c0ec1cbfe3

144602: sw: fix ODT import of paragraph marker formatting | https://gerrit.libreoffice.org/c/core/+/144602
Comment 5 Commit Notification 2023-08-14 07:18:05 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d0f43befdaa1010062b534dffa82adad8c956c8

tdf#156321 ODT import: fix lost char format on outer span elements

It will be available in 24.2.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.
Comment 6 Phillip 2023-08-15 03:28:27 UTC
Have re-tested in the latest daily and it seems to be working! Thank you all!

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 518fa99dd7693d64a53e404a065090aedc0002b1
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-AU (en_AU); UI: en-US
Calc: CL threaded
Comment 7 Dieter 2023-08-15 04:25:13 UTC
(In reply to Phillip from comment #6)
> Have re-tested in the latest daily and it seems to be working! Thank you all!

=> VERIFIED
Comment 8 Commit Notification 2023-08-15 10:10:33 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/17c441d09c98443ac0d209b6aa6caa95fefc033e

tdf#156321 ODT import: fix lost char format on outer span elements

It will be available in 7.6.1.

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.