Bug 152985 - Page number field formats displayed wrong
Summary: Page number field formats displayed wrong
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks: RTL-CTL Fields-Page-Number
  Show dependency treegraph
 
Reported: 2023-01-12 05:15 UTC by افشین
Modified: 2023-03-17 08:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Bug Field Page Number (50.72 KB, image/png)
2023-01-12 05:15 UTC, افشین
Details
Bug Field Page Number (41.59 KB, image/png)
2023-01-12 05:16 UTC, افشین
Details
Bug Field Page Number (49.98 KB, image/png)
2023-01-12 05:16 UTC, افشین
Details
Bug Field Page Number (36.99 KB, image/png)
2023-01-12 06:10 UTC, افشین
Details
Bug Field Page Number (33.55 KB, image/png)
2023-01-12 06:11 UTC, افشین
Details
test ODT created in LO 7.4.3.2 (11.95 KB, application/vnd.oasis.opendocument.text)
2023-01-12 08:40 UTC, Stéphane Guillou (stragu)
Details
RTL Paragraph Page Number Bug (11.56 KB, application/vnd.oasis.opendocument.text)
2023-01-12 14:08 UTC, افشین
Details
RTL Paragraph Page Number Bug (21.70 KB, image/png)
2023-01-12 14:14 UTC, افشین
Details

Note You need to log in before you can comment on or make changes to this bug.
Description افشین 2023-01-12 05:15:14 UTC
Created attachment 184601 [details]
Bug Field Page Number

Hello.

When I insert the page number (using Insert >> Field >> Page Number) and double click on the page number field, the edit fields window opens and I can select one of those formats.
But there is a bug:

When I select the format "one, two, three,...", the number "1" is inserted instead of "one"!

And when I select the "1st, 2nd, 3rd" format, the word "Ordinal-number1" is inserted!

And when I select "a ..aa ..aaa" format, the word "1" is inserted!

And when I selct "First,Second,Third", the word "Ordinal 1" is inserted! 

I attached the screenshots.
Comment 1 افشین 2023-01-12 05:16:01 UTC
Created attachment 184602 [details]
Bug Field Page Number
Comment 2 افشین 2023-01-12 05:16:19 UTC
Created attachment 184603 [details]
Bug Field Page Number
Comment 3 Stéphane Guillou (stragu) 2023-01-12 05:54:36 UTC
Thank you for your report!

Could not reproduce in:

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

nor in:

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Could you please:
- paste here the information from Help > About LibreOffice
- test in safe mode (Help > Safe mode > Continue in safe mode) to see if it still happens

Thank you!
Comment 4 افشین 2023-01-12 06:02:12 UTC
Version: 7.4.3.2 / LibreOffice Community
Build ID: 40(Build:2)
CPU threads: 2; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Ubuntu package version: 1:7.4.3~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded
Comment 5 افشین 2023-01-12 06:10:31 UTC
I tested this bug in Safe Mode and except for two formats (a..aa..aaa & A..AA..AAA) the rest of other formats were correct!

I attached 2 screenshot.
Comment 6 افشین 2023-01-12 06:10:55 UTC
Created attachment 184604 [details]
Bug Field Page Number
Comment 7 افشین 2023-01-12 06:11:13 UTC
Created attachment 184605 [details]
Bug Field Page Number
Comment 8 افشین 2023-01-12 06:15:17 UTC
@hossein
Would you please also test?
Comment 9 Stéphane Guillou (stragu) 2023-01-12 08:39:35 UTC
OK, I can now reproduce for a.aa..aaa and A..AA..AAA: they are both equivalent to "a b c" and "A B C".

Steps to reproduce:
1. Open Writer
2. Ctrl + Return for a page break
3. Insert > Page Number
4. Doube-click on the field
5. Change format to "a..aa..aaa", OK
6. On the next like, do steps 3-5 again but for format "A..AA..AAA"

Reproduced in:

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

And a master build from today:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 92deea6301a02f5530f17263f58402344f82013c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Same on Win 10 (tested with LO 7.5)
Comment 10 Stéphane Guillou (stragu) 2023-01-12 08:40:01 UTC
Created attachment 184606 [details]
test ODT created in LO 7.4.3.2
Comment 11 Julien Nabet 2023-01-12 13:47:34 UTC
On pc Debian x86-64 with master sources updated today + Stephane's example file, if I add some page break, I got:
Insert > Page Number > a..aa..aaa: a
Insert > Page Number > A..AA..AAA: A
Insert > Page Number > a b c: a
Insert > Page Number > A B C: A

Insert > Page Number > a..aa..aaa: b
Insert > Page Number > A..AA..AAA: B
Insert > Page Number > a b c: b
Insert > Page Number > A B C: B
...

Insert > Page Number > a..aa..aaa: z
Insert > Page Number > A..AA..AAA: Z
Insert > Page Number > a b c: z
Insert > Page Number > A B C: Z

...
Insert > Page Number > a..aa..aaa: aa
Insert > Page Number > A..AA..AAA: AA
Insert > Page Number > a b c: aa
Insert > Page Number > A B C: AA

so identical for the moment, but after this:
Insert > Page Number > a..aa..aaa: bb
Insert > Page Number > A..AA..AAA: BB
Insert > Page Number > a b c: ab
Insert > Page Number > A B C: AB

now it's different.

So IMHO, no bug here, what do you think?
Comment 12 افشین 2023-01-12 14:08:13 UTC
Dear Stéphane

If the paragraph direction is right to left, the bug I mentioned is reproducible.

I attached test file.
Comment 13 افشین 2023-01-12 14:08:49 UTC
Created attachment 184613 [details]
RTL Paragraph Page Number Bug
Comment 14 افشین 2023-01-12 14:14:10 UTC
Created attachment 184614 [details]
RTL Paragraph Page Number Bug
Comment 15 افشین 2023-01-12 14:19:09 UTC
Dear  Stéphane
In RTL paragrapg direction, this bug is reproducible even in safe mode!
Comment 16 Stéphane Guillou (stragu) 2023-01-12 14:33:40 UTC
(In reply to Julien Nabet from comment #11)
> [...]
> so identical for the moment, but after this:
> Insert > Page Number > a..aa..aaa: bb
> Insert > Page Number > A..AA..AAA: BB
> Insert > Page Number > a b c: ab
> Insert > Page Number > A B C: AB
> 
> now it's different.
> 
> So IMHO, no bug here, what do you think?

Ah, thank you for going further! Definitely a numbering system I am not familiar with. Looks like no bug there, but maybe extra documentation will help.

(In reply to افشین from comment #12)
> Dear Stéphane
> 
> If the paragraph direction is right to left, the bug I mentioned is
> reproducible.
> 
> I attached test file.

Thank you for testing some more! I could not reproduce with:

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

But I could reproduce with:

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
(Also on Windows 10.)

And at least since LO 6.1:

Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group threaded

So it has been fixed in version 7.5, probably because of all the work Khaled and others have done on RTL (see the release notes:
https://wiki.documentfoundation.org/ReleaseNotes/7.5

Copying Khaled just in case the fix can be identified.
Thank you all!
Comment 17 ⁨خالد حسني⁩ 2023-01-12 15:36:31 UTC
It seems to depend on the language set on the number fields, so possibly related to 6064b3382102bcbc153156f5874fbc8dfde97b98 which updated libnumbertext and added Persian support (among other things).
Comment 18 ⁨خالد حسني⁩ 2023-01-12 15:41:00 UTC
But I think there is still a bug to fix here, I think if the current language is  not supported, the fallback should be the regular number (1, 2, etc), instead of things like “Ordinal-number 1”.
Comment 19 Stéphane Guillou (stragu) 2023-01-13 17:41:51 UTC
Thanks Khaled!

Marking this specific case here as fixed by László Németh with core commit 6064b3382102bcbc153156f5874fbc8dfde97b98.

I opened bug 153010 for tracking improvements to when the format is not available for the selected language (fallback string + inconsistency depending on the field).