Bug 155662 - FILEOPEN RTF/DOCX/DOC Direct formatting leaks through line break
Summary: FILEOPEN RTF/DOCX/DOC Direct formatting leaks through line break
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: RTF-Paragraph
  Show dependency treegraph
 
Reported: 2023-06-03 10:56 UTC by Gabor Kelemen (allotropia)
Modified: 2023-12-12 16:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2016 (deleted)
2023-06-03 10:56 UTC, Gabor Kelemen (allotropia)
Details
The example file in Word and Writer before typing a character (93.94 KB, image/png)
2023-06-03 10:58 UTC, Gabor Kelemen (allotropia)
Details
The example file in Word and Writer after typing a character (98.74 KB, image/png)
2023-06-03 10:58 UTC, Gabor Kelemen (allotropia)
Details
Updated example file (49.62 KB, application/rtf)
2023-11-28 14:15 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-06-03 10:56:36 UTC
Created attachment 187690 [details]
Example file from Word 2016

Attached file contains a paragraph in the header: first line is line break character direct formatted with hidden 20 pt font, the second line contains a letter with only default paragraph style.

When opened in Writer, the first lines formatting leaks to the beginning of the second: typing a character in the second line gets the hidden 20pt formatting, unlike in Word.

1. Open attached file
2. Make sure the Options - Writer - Formatting Aids - Hidden characters is enabled.
3. Go to the header, type a letter before the a
-> new letter is hidden, 20 pt

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 70fd835b4cf75e386ee115c705241a4059fb68a8
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded

Seems to have started in 7.4:

https://git.libreoffice.org/core/+/3afe4f66f7266ede9922ce0682db38c9369349b7

author	Miklos Vajna <vmiklos@collabora.com>	Mon Mar 21 10:20:34 2022 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	Mon Mar 21 11:23:32 2022 +0100
tree e29c66fb0abe74b2d3ff709dcc494891f79f669b
parent a13faccd7e8c6503e96e9342a8615b4542b0601f [diff]

sw clearing breaks: add RTF filter

Interestingly before this the hidden 20pt formatting was not applied at all to the line break character. Can't say this was good before, just differently bad.
Comment 1 Gabor Kelemen (allotropia) 2023-06-03 10:58:25 UTC
Created attachment 187691 [details]
The example file in Word and Writer before typing a character

This also changes the layout: when the formatting marks are hidden, the line height is still defined by the 20 pt formatting, making it taller in Writer than in Word.
Comment 2 Gabor Kelemen (allotropia) 2023-06-03 10:58:59 UTC
Created attachment 187692 [details]
The example file in Word and Writer after typing a character

Formatting has leaked through.
Comment 3 Dieter 2023-06-17 11:42:58 UTC
I confirm it with

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 069c7dc4e9706b40ca12d83d83f90f41cec948f8
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

Miklos, could you have a look at it?
Comment 4 Gabor Kelemen (allotropia) 2023-11-28 14:15:08 UTC
Created attachment 191097 [details]
Updated example file
Comment 5 Xisco Faulí 2023-11-29 13:20:46 UTC
The content of attachment 187690 [details] has been deleted for the following reason:

User's request
Comment 6 Justin L 2023-12-04 20:08:08 UTC
resetting the "assigned" flag since no activity in the past 6 months.

Indeed, there seems to be a difference in Word whether the hidden "character" is something normal (like alphanumeric) or a linefeed. "Normal" characters "keep" the character property at their end, so anything new retains the preceding properties. LF must be an exception to the rule. Yuck. (In MSO, if you change the LF to be an X, then typing anything before the "a" (i.e after the hidden X) appears to do nothing [when show paragraph marks is off].)