Bug 158132 - RTF paragraph attributes after sprms not applied
Summary: RTF paragraph attributes after sprms not applied
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:rtf
Depends on:
Blocks: RTF-Paragraph
  Show dependency treegraph
 
Reported: 2023-11-09 10:51 UTC by Oliver Specht (CIB)
Modified: 2023-12-13 04:51 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Bugdoc showing wrong attributes at text end (16.58 KB, application/msword)
2023-11-09 10:51 UTC, Oliver Specht (CIB)
Details
new bugdoc (46.89 KB, application/msword)
2023-11-27 07:17 UTC, Oliver Specht (CIB)
Details

Note You need to log in before you can comment on or make changes to this bug.
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