Bug 158132

Summary: RTF paragraph attributes after sprms not applied
Product: LibreOffice Reporter: Oliver Specht (CIB) <oliver.specht>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: aron.budea, buzea.bogdan, kelemeng, stephane.guillou, vmiklos
Priority: medium Keywords: filter:rtf
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=155662
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 113340    
Attachments: Bugdoc showing wrong attributes at text end
new bugdoc

Description Oliver Specht (CIB) 2023-11-09 10:51:16 UTC
Created attachment 190743 [details]
Bugdoc showing wrong attributes at text end

The last paragraph in the header and within the body should have font 11pt.
But it has 8pt in the header.
In the body the 'x' ist 11pt as expected but if you put the cursor in front of the 'x' you can start writing in 8pt
Comment 1 Oliver Specht (CIB) 2023-11-09 12:36:44 UTC
It might not be possible to persist the word's handling in writer.

The body paragraph is saved as:
<text:p text:style-name="P1">
<text:span text:style-name="T1">
<text:line-break/>
</text:span>x
</text:p>

So the cursor in front of the 'x' should not have the attributes of the span but that is not how it is working. It expands the attributes left of the cursor.

In Writer you can put the cursor in front of the 'x' an apply "Format/Clear direct formatting". That resets the 8pt attribute - but this state can not be persisted in the document so it does not make sense to try to load an RTF that way.

Word does it the same way except when you insert a line break.
As long as you don't save/reload the attributes are expanded.
Once you save an reload the attribute in the new line are not expanded anymore.
Comment 2 Stéphane Guillou (stragu) 2023-11-23 14:54:59 UTC
(In reply to Oliver Specht (CIB) from comment #0)
> The last paragraph in the header and within the body should have font 11pt.
> But it has 8pt in the header.
I can't put my cursor in the header.
> In the body the 'x' ist 11pt as expected but if you put the cursor in front
> of the 'x' you can start writing in 8pt
Typing at the beginning of the paragraph does not add any character, until direct formatting is removed: then everything appears.

The doc is definitely problematic, but how was it created?

Maybe Miklos has an idea?

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7d357628d6e8ce3f9e3c3a567ada21f02bce8d42
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.6.3.1 (X86_64) / LibreOffice Community
Build ID: c4af5b1259bceea6e979e6fe2435dbee7a5a87c2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 3 Miklos Vajna 2023-11-23 15:51:31 UTC
I assume Oliver knows what he's doing here, so let me just confirm this bug, this is not a random bugreport but is filed by a developer to publicly track a bug, I guess. :-)
Comment 4 Stéphane Guillou (stragu) 2023-11-23 16:02:21 UTC
(In reply to Miklos Vajna from comment #3)
> I assume Oliver knows what he's doing here, so let me just confirm this bug,
> this is not a random bugreport but is filed by a developer to publicly track
> a bug, I guess. :-)
Sure thing, I was just keen to understand the whole problem better – and always good to have your experienced set of eyes on it too :)
Thanks!
Comment 5 Oliver Specht (CIB) 2023-11-27 07:17:21 UTC
Created attachment 191053 [details]
new bugdoc

bugdoc replaced
Comment 6 Stéphane Guillou (stragu) 2023-11-27 10:37:48 UTC
(In reply to Oliver Specht (CIB) from comment #0)
> The last paragraph in the header and within the body should have font 11pt.
> But it has 8pt in the header.
Thanks Oliver, I reproduce with new bugdoc: the cursor denotes the 11 pt size but typing uses 8 pt size, and header border jumps up.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7d357628d6e8ce3f9e3c3a567ada21f02bce8d42
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded