Bug 149824 - Wrong multi-level numbering in RTL mode
Summary: Wrong multi-level numbering in RTL mode
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 158099 (view as bug list)
Depends on:
Blocks: RTL-Arabic-and-Farsi
  Show dependency treegraph
 
Reported: 2022-07-03 06:41 UTC by Amin
Modified: 2023-11-09 05:49 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Current and expected situation (36.59 KB, image/png)
2022-07-03 06:56 UTC, Amin
Details
The ODT file of reproduced situation (12.01 KB, application/vnd.oasis.opendocument.text)
2022-07-10 08:08 UTC, Amin
Details
The ODT file of reproduced situation (12.04 KB, application/vnd.oasis.opendocument.text)
2022-07-10 08:13 UTC, Amin
Details
Wrong VS right situation (45.40 KB, image/png)
2022-08-13 05:11 UTC, Amin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amin 2022-07-03 06:41:42 UTC
Description:
A multi-level numbering list in LTR mode is like this:

1. Parent item
    1.1. Sub item 1
    1.2. Sub item 2
    1.3. Sub item 3

It is obvious that "Sub item 2" is under "Parent item" so its numbering starts with 1 and end with 2.

But when we are in RTL mode (RTL languages like Farsi and Arabic) numbering for sub items will be wrong and be displayed 2.1. You can see this in attached file for better understanding.

Steps to Reproduce:
1. Make a multilevel numbered list in RTL mode

Actual Results:
۱. آیتم اصلی
    ۱.۱. آیتم زیرین اول
    ۲.۱. آیتم زیرین دوم
    ۳.۱. آیتم زیرین سوم

Expected Results:
۱. آیتم اصلی
    ۱.۱. آیتم زیرین اول
    ۱.۲. آیتم زیرین دوم
    ۱.۳. آیتم زیرین سوم


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.3.4.2
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.18; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Amin 2022-07-03 06:56:47 UTC
Created attachment 181098 [details]
Current and expected situation
Comment 2 raal 2022-07-10 04:20:57 UTC
Please can you attach test file? Thank you.
Comment 3 Amin 2022-07-10 05:08:45 UTC
A screenshot is attached. Isn't it possible to open it? 

(In reply to raal from comment #2)
> Please can you attach test file? Thank you.
Comment 4 Ming Hua 2022-07-10 06:26:51 UTC
I believe raal is asking for a .odt document so that people not familiar with CTL text can try to reproduce this bug.

Or you can elaborate on your steps to reproduce:
(In reply to Amin from comment #0)
> 1. Make a multilevel numbered list in RTL mode
...starting from enabling RTL mode (Tools > Options > Language Settings > Language, enable "Default Languages for Documents > Complex text layout", etc.), then how to switch to RTL mode, how to add a multi-level numbered list, how to make the numbering Arabic/Persian numbers, and so on.
 
(In reply to Amin from comment #3)
> A screenshot is attached. Isn't it possible to open it? 
> 
> (In reply to raal from comment #2)
> > Please can you attach test file? Thank you.
Comment 5 Amin 2022-07-10 08:08:46 UTC
Created attachment 181201 [details]
The ODT file of reproduced situation

Please note that this file is produced for Farsi (Persian) language which is RTL same as Arabic
Comment 6 Amin 2022-07-10 08:13:26 UTC
Created attachment 181202 [details]
The ODT file of reproduced situation
Comment 7 Amin 2022-07-10 08:15:30 UTC
Also note that it is better to have a feature to change the "/" sign of multi-level numbering in Persian language. The "." character is more suitable but there is no option to change from "/" to "."
Comment 8 Eyal Rozenberg 2022-08-10 21:09:46 UTC
Hello Amin,

Unfortunately, your opening comment and your attachment "current and expected situation" - contradict.

In your opening comment, you've listed the "expected results" to the ordering of numbers that in your attachment is described as inappropriate/undesirable. You've also stated that's not what you get in LO.

Well, I'll assume that you mixed up "expected" and "actual" in the first comment.

Assuming that is the case, then - this is NOTABUG.

Numbers, in both Arabic and Hebrew (and most probably Farsi) are written from left-to-write, starting with the most significant decimal digit. They are _mostly_ read that way - with the exception that, in Arabic, the last two digits are read in reverse order. Anyway, 502 would be written, in Arabic with hindi digits as ٥٠٢ - both in an RTL and an LTR paragraph. Also, when writing a fractional number, the integral part is to the left of the fractional part.

It thus makes sense for Number-Dot-Number paragraph numbering, in Arabic as well as in English, to have the first number on the left, and the second number on the right. Hundreds of Thousands of Arabic speakers use LibreOffice, and - to my knowledge - have not complained about this being the order.

As for your ODT attachment #181202 [details] - when I open it, I see Arabic, not Hindi,  numerals in both sequences of paragraphs (i.e. 123, not ١٢٣). You should probably choose an explicit number sequence rather than sticking to the default.

So, please clarify and update the attachments if necessary.
Comment 9 ⁨خالد حسني⁩ 2022-08-12 16:57:46 UTC
(In reply to Eyal Rozenberg from comment #8)
> Hello Amin,
> 
> Unfortunately, your opening comment and your attachment "current and
> expected situation" - contradict.
> 
> In your opening comment, you've listed the "expected results" to the
> ordering of numbers that in your attachment is described as
> inappropriate/undesirable. You've also stated that's not what you get in LO.
> 
> Well, I'll assume that you mixed up "expected" and "actual" in the first
> comment.
> 
> Assuming that is the case, then - this is NOTABUG.
> 
> Numbers, in both Arabic and Hebrew (and most probably Farsi) are written
> from left-to-write, starting with the most significant decimal digit. They
> are _mostly_ read that way - with the exception that, in Arabic, the last
> two digits are read in reverse order. Anyway, 502 would be written, in
> Arabic with hindi digits as ٥٠٢ - both in an RTL and an LTR paragraph. Also,
> when writing a fractional number, the integral part is to the left of the
> fractional part.
> 
> It thus makes sense for Number-Dot-Number paragraph numbering, in Arabic as
> well as in English, to have the first number on the left, and the second
> number on the right. Hundreds of Thousands of Arabic speakers use
> LibreOffice, and - to my knowledge - have not complained about this being
> the order.
> 
> As for your ODT attachment #181202 [details] - when I open it, I see Arabic,
> not Hindi,  numerals in both sequences of paragraphs (i.e. 123, not ١٢٣).
> You should probably choose an explicit number sequence rather than sticking
> to the default.
> 
> So, please clarify and update the attachments if necessary.

Numbered lists (in Arabic at least) follow the hierarchical order not the LTR direction of the numbers, so 1 must precede 2 (i.e. be at the right of it).

One possible solution is to surround each level number with FSI (U+2068) / PDI (U+2069) so they becomes isolated from each other and follow the paragraph direction.
Comment 10 Amin 2022-08-13 05:11:45 UTC
Created attachment 181746 [details]
Wrong VS right situation
Comment 11 Amin 2022-08-13 05:19:00 UTC
(In reply to Eyal Rozenberg from comment #8)
> Hello Amin,
> 
> Unfortunately, your opening comment and your attachment "current and
> expected situation" - contradict.
> 
> In your opening comment, you've listed the "expected results" to the
> ordering of numbers that in your attachment is described as
> inappropriate/undesirable. You've also stated that's not what you get in LO.
> 
> Well, I'll assume that you mixed up "expected" and "actual" in the first
> comment.
> 
> Assuming that is the case, then - this is NOTABUG.
> 
> Numbers, in both Arabic and Hebrew (and most probably Farsi) are written
> from left-to-write, starting with the most significant decimal digit. They
> are _mostly_ read that way - with the exception that, in Arabic, the last
> two digits are read in reverse order. Anyway, 502 would be written, in
> Arabic with hindi digits as ٥٠٢ - both in an RTL and an LTR paragraph. Also,
> when writing a fractional number, the integral part is to the left of the
> fractional part.
> 
> It thus makes sense for Number-Dot-Number paragraph numbering, in Arabic as
> well as in English, to have the first number on the left, and the second
> number on the right. Hundreds of Thousands of Arabic speakers use
> LibreOffice, and - to my knowledge - have not complained about this being
> the order.
> 
> As for your ODT attachment #181202 [details] - when I open it, I see Arabic,
> not Hindi,  numerals in both sequences of paragraphs (i.e. 123, not ١٢٣).
> You should probably choose an explicit number sequence rather than sticking
> to the default.
> 
> So, please clarify and update the attachments if necessary.


Hi Eyal,

About writing a simple number in Arabic or Farsi, yes, you are right; We write numbers from left to right BUT we are talking about numbered-list not integer number ;)

When we are writing a multi-level numbered list, we are not talking about decimal place or integer number, instead we are talking about a series of integer numbers which show the hierarchy in a list. We want to show that which item is children of which parent. So this is not a Number to follow the mathematics rules. this is a numbered list.

Please have a look at the attachment named "Wrong VS right situation" (https://bugs.documentfoundation.org/attachment.cgi?id=181746)

This problem is solved in Microsoft Word; In MS Word we can change the order of numbers.

Please note that this is the exact rule which is used in English ordered list and in Farsi (and I think in Arabic too) this rule is the same.

Also I agree with comment 9 (https://bugs.documentfoundation.org/show_bug.cgi?id=149824#c9) by "Khaled Hosny"
Comment 12 Amin 2022-08-13 05:19:37 UTC
(In reply to Khaled Hosny from comment #9)
> (In reply to Eyal Rozenberg from comment #8)
> > Hello Amin,
> > 
> > Unfortunately, your opening comment and your attachment "current and
> > expected situation" - contradict.
> > 
> > In your opening comment, you've listed the "expected results" to the
> > ordering of numbers that in your attachment is described as
> > inappropriate/undesirable. You've also stated that's not what you get in LO.
> > 
> > Well, I'll assume that you mixed up "expected" and "actual" in the first
> > comment.
> > 
> > Assuming that is the case, then - this is NOTABUG.
> > 
> > Numbers, in both Arabic and Hebrew (and most probably Farsi) are written
> > from left-to-write, starting with the most significant decimal digit. They
> > are _mostly_ read that way - with the exception that, in Arabic, the last
> > two digits are read in reverse order. Anyway, 502 would be written, in
> > Arabic with hindi digits as ٥٠٢ - both in an RTL and an LTR paragraph. Also,
> > when writing a fractional number, the integral part is to the left of the
> > fractional part.
> > 
> > It thus makes sense for Number-Dot-Number paragraph numbering, in Arabic as
> > well as in English, to have the first number on the left, and the second
> > number on the right. Hundreds of Thousands of Arabic speakers use
> > LibreOffice, and - to my knowledge - have not complained about this being
> > the order.
> > 
> > As for your ODT attachment #181202 [details] - when I open it, I see Arabic,
> > not Hindi,  numerals in both sequences of paragraphs (i.e. 123, not ١٢٣).
> > You should probably choose an explicit number sequence rather than sticking
> > to the default.
> > 
> > So, please clarify and update the attachments if necessary.
> 
> Numbered lists (in Arabic at least) follow the hierarchical order not the
> LTR direction of the numbers, so 1 must precede 2 (i.e. be at the right of
> it).
> 
> One possible solution is to surround each level number with FSI (U+2068) /
> PDI (U+2069) so they becomes isolated from each other and follow the
> paragraph direction.

Yes. I agree.
Comment 13 ⁨خالد حسني⁩ 2023-11-08 21:40:20 UTC
*** Bug 158099 has been marked as a duplicate of this bug. ***
Comment 14 M.Mahdi 2023-11-09 05:49:22 UTC
(In reply to ⁨خالد حسني⁩ from comment #13)
> *** Bug 158099 has been marked as a duplicate of this bug. ***

Thanks for your attention. I searched but found nothing. My bad.
Anyway... I submitted a feature request to handle this situation and with guidance of @ajlittoz in Bug 158099 we found that if we could change intermediate characters in multilevel ordering numbers then we would put U+2013 EN DASH as intermediate character and the problem can be solved because this character or any similar characters hasn't neutral direction (as dot '.' is).

Is there any bug issue that requests this feature (change intermediate character in multilevel ordered lists)? I searched but found nothing. Shall I open one?