Bug 124274 - FILEOPEN: RTF: Shapes horizontal alignment incorrect
Summary: FILEOPEN: RTF: Shapes horizontal alignment incorrect
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:rtf
Depends on:
Blocks: RTF-Shapes
  Show dependency treegraph
 
Reported: 2019-03-22 14:22 UTC by Irakli Lomidze
Modified: 2023-12-22 11:06 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX FILE (50.50 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-22 14:23 UTC, Irakli Lomidze
Details
Same file in RTF Format (312.39 KB, application/msword)
2019-03-22 14:23 UTC, Irakli Lomidze
Details
comparison MSO 2010 and LibreOffice 6.3 Master (57.39 KB, image/png)
2019-03-22 15:04 UTC, Xisco Faulí
Details
The example RTF file in Word and Writer master (142.20 KB, image/png)
2022-01-27 11:43 UTC, Gabor Kelemen (allotropia)
Details
The RTF example in Word and Writer master (90.02 KB, image/png)
2023-04-27 09:51 UTC, Gabor Kelemen (allotropia)
Details
reduced RTF example file for the blue squares (263.50 KB, application/msword)
2023-11-01 19:34 UTC, Gabor Kelemen (allotropia)
Details
The reduced example in Word 2016 and Writer (78.12 KB, image/png)
2023-11-01 19:35 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Irakli Lomidze 2019-03-22 14:22:43 UTC
Description:
Description:
I have a DOCX file Generated by Microsoft Word 365, and smae file saved from same Word 365 to RTF Format.

DOCX looks fine when I open it in LO 6.2. But layout is broken when I open same file saved in RTF format it in LibreOffice 6.2.2.


Steps to Reproduce:
Steps to Reproduce:
1. You need My File Test.DOCX and Test.RTF
2. Open it in Word it Both works Fine
3. Open RTF and DOCX in LO (RTF version is broken).

Actual Results:
Layout broken

Expected Results:
Retain Layout



Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Comment 1 Irakli Lomidze 2019-03-22 14:23:16 UTC
Created attachment 150186 [details]
DOCX FILE
Comment 2 Irakli Lomidze 2019-03-22 14:23:46 UTC
Created attachment 150187 [details]
Same file in RTF Format
Comment 3 m_a_riosv 2019-03-22 15:01:55 UTC
Repro
Version: 6.3.0.0.alpha0+ (x64)
Build ID: 5a907fe76bc628629fddb5501727642468d38dae
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-03-22_00:18:04
Locale: es-ES (es_ES); UI-Language: en-US
Calc: CL
Comment 4 Xisco Faulí 2019-03-22 15:04:40 UTC
Created attachment 150194 [details]
comparison MSO 2010 and LibreOffice 6.3 Master
Comment 5 Xisco Faulí 2019-03-22 15:06:58 UTC
Also reproduced in

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e
Comment 6 QA Administrators 2021-03-23 04:21:17 UTC Comment hidden (obsolete)
Comment 7 Gabor Kelemen (allotropia) 2022-01-27 11:43:11 UTC
Created attachment 177830 [details]
The example RTF file in Word and Writer master

Still a problem in

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: eb69767d7c1bb8e6e780fd9503f08c9d7f5ecb45
CPU threads: 13; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

The middle table is floating in Word and since Writer has no similar feature, its positioning is not imported at all (it's size is however).
Other independent issue is the vertical positioning of the teal textboxes at the bottom being incorrect.
Comment 8 Gabor Kelemen (allotropia) 2023-04-27 09:51:34 UTC
Created attachment 186957 [details]
The RTF example in Word and Writer master

This got a lot better in 7.6 master, after

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

author	Miklos Vajna <vmiklos@collabora.com>	2023-04-21 07:05:26 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2023-04-21 08:21:45 +0200
commit 05425f73bfa41d3f7591461e2ad0beb4fafc39b4 (patch)

sw floatable: teach the RTF import about SwFormatFlySplit

There are still many smaller issues with the various objects, mostly the blue shapes having incorrect horizontal position.
Comment 9 Gabor Kelemen (allotropia) 2023-11-01 19:34:27 UTC
Created attachment 190590 [details]
reduced RTF example file for the blue squares

Looking at the floating tables, I think those are now reasonably good looking.
Let's focus on the light blue rectangles at the bottom of the first page.

Here their horizontal positioning setting of the left one is Absolute position (1.67 cm) to the right of Margin.
This is imported incorrectly as "From Left" (1.67 cm) to "Entire paragraph area".
If I convert the attachment 150186 [details] example to Transitional docx in Word, then it is imported with correct looking position and the setting is "From left" by 1.67 cm to "Page text area".

The horizontal position of the right one is Alignment: "Right" relative to "Margin" in Word. This is imported as "Right" to "Entire paragraph area" which puts it to the very right edge of the sheet.
From the docx version it is imported as "Right" to "Page text area" which is much closer to the original look.
Comment 10 Gabor Kelemen (allotropia) 2023-11-01 19:35:12 UTC
Created attachment 190591 [details]
The reduced example in Word 2016 and Writer

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d8326f1f54b2f4644b52fbfa7106eeeae6e5bb7b
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded