Bug 82111 - FILEOPEN: RTF - Incorrect alignment of '2014' on the left rather than center
Summary: FILEOPEN: RTF - Incorrect alignment of '2014' on the left rather than center
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.3.0
Keywords: filter:rtf, preBibisect, regression
: 112413 (view as bug list)
Depends on:
Blocks: RTF-New-Import RTF-Paragraph
  Show dependency treegraph
 
Reported: 2014-08-04 02:47 UTC by Yousuf Philips (jay) (retired)
Modified: 2022-01-27 10:57 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Word 2013 VS Libo 4.3.1 (64.54 KB, image/png)
2014-08-04 02:47 UTC, Yousuf Philips (jay) (retired)
Details
smaller sample (89.98 KB, text/rtf)
2017-10-31 05:02 UTC, Yousuf Philips (jay) (retired)
Details
test_rtf - small sample_msword2003.pdf: As seen in MS Word 2003. (11.16 KB, application/pdf)
2021-07-12 19:11 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-08-04 02:47:56 UTC
Created attachment 103969 [details]
Word 2013 VS Libo 4.3.1

When testing the RTF file in attachment 103764 [details] for bug 81978, if its loaded into LibO, the number 2014 should be centered but instead in on the left and that it only shows as 201 in master.

Tested in 3.6.7, 4.1.6, 4.2.7, 4.3.1 and master on Linux. Regression as it worked correctly in 3.3.0 (old RTF importer).
Comment 1 Marina Latini (SUSE) 2014-08-04 08:51:15 UTC
Confirmed on Ubuntu 14.04 x86_64:
* Version: 4.4.0.0.alpha0+
* Build ID: 8cb75e905cef50a2d8a423443d3dcef5f1899027
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-07-30_04:47:13

status -> new
block -> bug 81234 (meta bug for rtf filter)
Comment 2 Xisco Faulí 2014-08-06 16:27:47 UTC Comment hidden (obsolete)
Comment 3 Robinson Tryon (qubit) 2015-12-17 12:49:48 UTC Comment hidden (obsolete)
Comment 4 Yousuf Philips (jay) (retired) 2017-10-31 04:58:55 UTC
(In reply to Xisco Faulí from comment #2)
> This issue is fixed after commit d4b96b45727314585d02394bb5a084393b647729

I tested 4.3.7.2, 4.4.7.2, and master and this issue hasnt been resolved.

Version: 6.0.0.0.alpha1+
Build ID: 60a03d97bc35c02cb1eff0e4a02b6f37fd1a6a34
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 5 Yousuf Philips (jay) (retired) 2017-10-31 05:02:51 UTC
Created attachment 137390 [details]
smaller sample
Comment 6 Xisco Faulí 2017-10-31 06:43:29 UTC
Yes, you're right. I've just tested with d4b96b45727314585d02394bb5a084393b647729 and the problem is not fixed in that commit.
Honestly, I dunno why i wrote that comment. Sorry for that. I was young and foolish
Comment 7 QA Administrators 2018-11-01 03:52:30 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2019-01-04 19:39:34 UTC
2014 is now centered in the original rtf attachment 103764 [details], but not in the minimised attachment 137390 [details]. Not sure what to do or believe.

Original problem seen already in 3.5.0.

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: 2c7b0030b40de00e8c9ab997bdfe83631861968a
CPU threads: 8; OS: Linux 4.20; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 1 January 2019
Comment 9 Buovjaga 2020-10-01 10:14:48 UTC
(In reply to Buovjaga from comment #8)
> 2014 is now centered in the original rtf attachment 103764 [details], but
> not in the minimised attachment 137390 [details]. Not sure what to do or
> believe.

Well, in MSO, "2014" is centered in the minimised example, so let's keep this open. In LibO it is justified.
Comment 10 Justin L 2021-07-12 19:11:38 UTC
Created attachment 173517 [details]
test_rtf - small sample_msword2003.pdf: As seen in MS Word 2003.

\qc is the code for centred, and \qj is the code for justify.
\s26 and \s28 8 designate the paragraph styles

The RTF contains "2014" in:
\pard\plain \ltrpar\s26\qc \li0\ri0\sb2760\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12470261 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \f1\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid16197105 20}
{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid6190013 14}

but it seems to be affect by the last paragraph (defined after the header)
\pard\plain \ltrpar\s28\qj

Yup - 2014 is on the wrong paragraph and has the wrong paragraph style. It should be style _Титул_Год создания. There should be a page break AFTER 2014, not before it. There should be an empty, justified paragraph using paragraph style _Содержание as the last item in the document.

It seems to be confused because there is no \par adding a Carriage Return after 2014. It immediately jumps to the \sect page break.  Adding a CR before the page break fixes this document.
Comment 11 Justin L 2021-07-13 08:22:54 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/118819
Comment 12 Commit Notification 2021-07-16 06:58:11 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fce76110e02409b67ad977ae0077adf55ca58065

tdf#82111 rtf import: ensure CR before section break

It will be available in 7.3.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 13 Gabor Kelemen (allotropia) 2022-01-27 10:57:59 UTC
*** Bug 112413 has been marked as a duplicate of this bug. ***