Bug 155300 - Wrong positioning of automatic heading numbers for an RTL paragraph
Summary: Wrong positioning of automatic heading numbers for an RTL paragraph
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:docx
Depends on:
Blocks: RTL
  Show dependency treegraph
 
Reported: 2023-05-14 14:43 UTC by Hossein
Modified: 2024-08-19 11:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Document created with MS Word (5.63 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-05-14 14:43 UTC, Hossein
Details
PDF Output created with MS Word (83.80 KB, application/pdf)
2023-05-14 14:44 UTC, Hossein
Details
PDF Output created with LibreOffice 7.6 dev master (48.80 KB, application/pdf)
2023-05-14 14:44 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-05-14 14:43:31 UTC
Created attachment 187273 [details]
Document created with MS Word

Description:
While creating a right to left (RTL) paragraph, the automatic heading numbers are positioned incorrectly. They are positioned from start of the paragraph to the right, which is wrong.

If you press left ctrl+left shift, you will see that the positioning will become correct, assuming that you want a left to right (LTR) paragraph.

The visible symptom is the positioning of the numbers outside the margins, then a big blank space, and then the start of heading text.

This is not limited to DOCX, and is also reproducible when saving the content as ODT files.

Steps to Reproduce:
1. Open the attached .docx file
2. Look at the positioning of the -2-3-1

Actual Results:
The automatic heading numbers fall out of the margins, as the calculation of the horizontal positioning is done incorrectly. It is measured from the right of the margin instead of left, for an RTL paragraph.

Expected Results:
The automatic heading numbers should fall inside the margins, and the calculation of the horizontal positioning should be done by measuring from the left side of the margin, for an RTL paragraph.

Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6f1534940ac12ff8e46f4782e18cfb6cf585da39
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 1 Hossein 2023-05-14 14:44:00 UTC
Created attachment 187274 [details]
PDF Output created with MS Word
Comment 2 Hossein 2023-05-14 14:44:24 UTC
Created attachment 187275 [details]
PDF Output created with LibreOffice 7.6 dev master
Comment 3 Buovjaga 2023-05-17 13:39:29 UTC
Confirmed, already in 3.5. Hossein remembers this from OpenOffice.org days.

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 85a47bbb8340e65a19dc1ceaac768902a771ee77
CPU threads: 8; OS: Linux 6.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 17 May 2023
Comment 4 Eyal Rozenberg 2023-05-25 10:39:16 UTC
So, I have a few comments to make:

1. Hossein, I (we) would really appreciate it if you brought up these bugs on the RTL Telegram channel. If not for any other reason, then for asking whether we remember a possible dupe, or for asking us to confirm.

2. Is this bug only about documents imported from Word, or is it supposed to be more general, as the title and the first paragraph suggest?

3. The numbering style in the attached document, WWNum2, has level 3 aligned left and aligned at 0.0 . Why should it not be laid out in the margin area?

(I am tempted to change this back to UNCONFIRMED, but maybe it's just me misunderstading things.)
Comment 5 Eyal Rozenberg 2024-08-19 11:21:37 UTC
> This is not limited to DOCX, and is also reproducible when saving the content as ODT files.

So, can this be reproduced from scratch without the need for a DOCX at all?