Bug 129578 - FILESAVE: RTF: CJK Character properties are lost after RT
Summary: FILESAVE: RTF: CJK Character properties are lost after RT
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2019-12-23 12:11 UTC by Xisco Faulí
Modified: 2022-02-02 14:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
sample document (16.90 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-12-23 12:11 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2019-12-23 12:11:35 UTC
Created attachment 156750 [details]
sample document

Steps to reproduce:
1. Open attached document
2. Save it as .RTF
3. Open the new created document

-> Font size and bold is no longer preserved

Reproduced in

Version: 6.5.0.0.alpha0+
Build ID: dee81fb2e1df5091702b3c8b0e4a3f2b58e89291
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2019-12-23 12:12:48 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=fd95fb975b754d71d3750e85431a4e596a40e659

author	Serge Krot <Serge.Krot@cib.de>	2019-05-30 15:33:29 +0200
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2019-06-06 14:20:44 +0200
commit fd95fb975b754d71d3750e85431a4e596a40e659 (patch)
tree ae0e9afd2016a6e95c8a6190403f6cee7592a647
parent 50696615fa8698ba18f9afc05202acd0a5a24cf8 (diff)
tdf#125719 sw: rtf: refactor associated character properties

Bisected with: bibisect-linux64-6.4

Adding Cc: to Serge Krot
Comment 2 QA Administrators 2021-12-23 04:29:01 UTC Comment hidden (obsolete, spam)
Comment 3 Xisco Faulí 2021-12-23 10:45:35 UTC
Still reproducible in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 57ad86fec9e5b4981332392bdb5c5a1f5e468bfe
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Xisco Faulí 2021-12-23 10:46:21 UTC
@Justin, I thought you might be interested in this issue
Comment 5 Justin L 2022-01-07 06:29:41 UTC
Font size seems to be preserved. It is 24 in both original and in the RTF.

Bold is lost (for Latin/Asian). However, it is there in MS Word 2016, so this should be FILEOPEN?
Comment 6 Justin L 2022-01-07 07:09:52 UTC
@Mark recently made alterations in this area.  This looks like it is related to \dbch. The document is Asian.
Comment 7 Justin L 2022-01-07 07:33:11 UTC
Almost certainly the same thing that Mark changed earlier for _sz,
where DBCH was considered to be a CS.

-  nSprm = (m_aStates.top().getIsRightToLeft()
-           || m_aStates.top().getRunType() == RTFParserState::RunType::HICH)
-     ? NS_ooxml::LN_EG_RPrBase_iCs
-     : NS_ooxml::LN_EG_RPrBase_i;

So in this case DBCH would have been _i but now it is _iCs.
Comment 8 Justin L 2022-01-07 11:37:30 UTC
(In reply to Justin L from comment #5)
> Font size seems to be preserved. It is 24 in both original and in the RTF.

This was fixed in 7.2 (backport to 7.1.0) by the code change I saw earlier.
author	Mark Hung on 2020-11-25
commit f97af19460fbd7483a0e1c1d0137e814f5390e69
    tdf#137894 separate associated character properties

In all cases, the export code seems pretty much unrelated to the import(writerfilter) changes, so this just looks like a simple regression to me, and I'll go ahead and make a fix.
Comment 9 Commit Notification 2022-02-02 04:04:13 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9d50307b2e1fd26d415539d3ed8624c7a449e45b

tdf#129578 rtfimport: CJK char properties are not CS

It will be available in 7.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 10 Commit Notification 2022-02-02 14:08:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/0d3d6e1eba9b10bc334a769c275312a828b82a00

tdf#129578 rtfimport: CJK char properties are not CS

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