Bug 125719 - RTF: fix busted \rtlch and \ltrch handling
Summary: RTF: fix busted \rtlch and \ltrch handling
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Serge Krot (CIB)
URL:
Whiteboard: target:6.4.0 target:6.3.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-05 16:34 UTC by Serge Krot (CIB)
Modified: 2021-01-13 11:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
First test case (20.33 KB, application/msword)
2019-06-05 16:34 UTC, Serge Krot (CIB)
Details
Second test case (28.34 KB, application/msword)
2019-06-05 16:34 UTC, Serge Krot (CIB)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Krot (CIB) 2019-06-05 16:34:09 UTC
Created attachment 151944 [details]
First test case

Attached documents are loaded and exported with wrong bold properties.
Comment 1 Serge Krot (CIB) 2019-06-05 16:34:28 UTC
Created attachment 151945 [details]
Second test case
Comment 2 Thorsten Behrens (allotropia) 2019-06-06 12:17:40 UTC
LO mixes properties from different Associated Character Properties sets on save.
* original document has: \rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\fs36\cf17\lang1033\f43
* saved document has: \rtlch\cf17\b\dbch\ab\af14\afs36 \ltrch\loch\fs36\lang1033\loch\f6\hich\af6
* bold properties are written for the \rtlch section but not inside \ltrch section
Comment 3 Thorsten Behrens (allotropia) 2019-06-06 12:20:22 UTC
Fixed now:
* properly handling \rtlch and \ltrch as other runs in RTF import
* ouput of the \rtlch\ltrch and \ltrch\rtlch with correct order of <aprops> which should follow first master keyword (\ltrch or \rtlch)
* associated font/character properties will be always outputed in the first part of the \ltrch\rtlch run

Output before fix: \af5\ltrch \rtlch - output with patch: \ltrch\af5 \rtlch

Further background details on the fix:
* \rtlch, \ltrch should be placed before their properties
* do not mix associated and normal character properties in output
* do not output empty "\rtlch \ltrch", "\ltrch \rtlch" pairs.
* handle associated character properties runs instead of handling separately their parts without order of them
Comment 4 Commit Notification 2019-06-06 12:22:19 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/fd95fb975b754d71d3750e85431a4e596a40e659%5E%21

tdf#125719 sw: rtf: refactor associated character properties

It will be available in 6.4.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 5 Commit Notification 2019-06-18 09:40:25 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/3c1f6fc029ab8ff9129f2316a3d7c81bc7b69125%5E%21

tdf#125719 sw: rtf: refactor associated character properties

It will be available in 6.3.0.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.