Bug 88290 - Numbering toolbar icon not working for certain locales
Summary: Numbering toolbar icon not working for certain locales
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.2 rc
Hardware: All All
: medium normal
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:5.1.0 target:5.0.0.1 target:4...
Keywords: bisected, patch
Depends on:
Blocks:
 
Reported: 2015-01-11 13:08 UTC by Kevin Suo
Modified: 2016-10-25 19:24 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (404.77 KB, image/png)
2015-01-12 07:17 UTC, Kevin Suo
Details
screenshot for Thai locale (388.25 KB, image/png)
2015-01-12 07:21 UTC, Kevin Suo
Details
quick patch (4.55 KB, patch)
2015-03-13 08:06 UTC, Maxim Monastirsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2015-01-11 13:08:46 UTC
Steps to reproduce:

1. Make sure you are using version 4.4.0.2 above.

2. Install Simplified Chinese (zh_CN) langpack.

3. In Writer, go to "Iools - Options - Language Settings - Language - Locale", set the locale to Simplified Chinese. (You don't have to change the UI, only the locale is needed).

4. Type in some text, then try to apply the following numbering style using the Bullets and Numbering toolbar icon:
一、二、三
(一)(二)(三)
甲、乙、丙
...

---> Does not working. Paragraph shows "1. 2. 3." rather than the above numbering styles.

The above numbering types all start with non-latin chars.

It works OK when you apply those numbering styles using the "Format - Bullets and Numbering" menu, or the right-click context menu, thus it seems nothing is wrong with the locale data:
http://cgit.freedesktop.org/libreoffice/core/tree/i18npool/source/localedata/data/zh_CN.xml

The same bug behaviour exists in Thai (th_TH) locale. Thai locale also has more than 8 LC_NumberingLevel settings, some of which are non-latin chars.
Comment 1 Kevin Suo 2015-01-11 13:11:45 UTC
Adding bug 87626 as see also. In bug 87626 I changed the zh_CN locale data (added some LC_NumberingLevel)
Comment 2 Kevin Suo 2015-01-11 13:18:32 UTC
Adding Jay Philipz in cc, I assume he worked on the toobar icons improvements and may know sth about this.
Comment 3 Kevin Suo 2015-01-12 05:33:46 UTC
Also reproducible in Win 7 X86, set OS to ALL.
Comment 4 Kevin Suo 2015-01-12 07:17:58 UTC
Created attachment 112110 [details]
screenshot
Comment 5 Kevin Suo 2015-01-12 07:21:36 UTC
Created attachment 112111 [details]
screenshot for Thai locale
Comment 6 Yousuf Philips (jay) (retired) 2015-01-12 12:06:12 UTC
Yes there is some problem with the entries displayed in the drop down. It seems when you open it the first time, it shows one set and when you open it again, it shows a different set.

@Maxim: Can you have a look at this. :D
Comment 7 Yousuf Philips (jay) (retired) 2015-01-12 12:41:19 UTC
Seems i was initially mistaken. When in the chinese local, the drop down has 15 entries in it, while in english it has only 8 entries. Entries 9 to 15 all act as if a user was pressing entry number 1. Then you also have Entry 10 which is preselected when no numbering is enabled and pressing it has no affect other than removing numbering if another numbering style is already set.

This problem doesnt happen in master with chinese locale as there are only 8 entries and when you click on them it works just fine.
Comment 8 Kevin Suo 2015-01-12 13:38:24 UTC
(In reply to Jay Philips from comment #7)

@Jay Philipz: Thanks for your reply.

> When in the chinese local, the drop down has 15 entries in it
Yes, the Simplified Chinese dropdown has more than 8 entries because of my fix to bug 87626 not long time ago.

> the drop down has 15 entries in it, while in english it has only 8 entries
Some devs told me that the locale file (i18npool/source/localedata/data/*.xml) allows more than 8 entries, so we can add as many entries within LC_NumberingLevel as we want.
Not only Simplified Chinese, but also many other locales have more than 8 numbering type entries, Thai for example. And it works perfect when using the "Formatting - Bullets and Numbering", but not with the toolbar icon.

> This problem doesnt happen in master with chinese locale 
> as there are only 8 entries and when you click on them it works just fine.
I don't think so. This commit was initially for master, and then backported to 4.4 branch. Version 4.4.0.2 is the first version the fix for bug 87626 takes effect.
Master: https://gerrit.libreoffice.org/#/c/13646/
4.4 branch: https://gerrit.libreoffice.org/#/c/13647/
Comment 9 Yousuf Philips (jay) (retired) 2015-01-12 16:44:44 UTC
I'm running master 2015-01-04, which doesnt have your patch. :D
Comment 10 Kevin Suo 2015-03-12 03:59:16 UTC
Hi all, any update on this? The problem here is:
* On the numbering dialog (Format -> Bullets and Numebering), more than 8 entries are allowed, and when there are more than 8 it works perfectly.
* On the toolbar icon, if there are more than 8 entries, it does not work start from the 9th one.

Seems that for now we have to revise the following commit to bring it back to 8 entries for now:
https://gerrit.libreoffice.org/#/c/13646/
(ACTom is trying to making a patch on this)
Comment 11 Eike Rathke 2015-03-12 11:28:32 UTC
I don't like the approach to remove the entries from the locale data file. They are working from the dialog, just not from the tool bar. Rather fix the real cause. Furthermore this affects all locales with more than 8 NumberingLevel entries, I really don't want we end up removing entries from all those locales, even if it's just a few (apparently 3, bg_BG, th_TH, zh_CN). This would actually hide the bug so someone wanting to fix it would have extra work.
Comment 12 Maxim Monastirsky 2015-03-13 08:06:25 UTC
Created attachment 114068 [details]
quick patch

I believe that the attached patch, or a similar one, should solve that bug. But it's not tested at all, and unfortunately I'm unable to do any further investigation on this, or any other LO related stuff these days, due to personal reasons. So someone else would need to take care of testing/fixing/pushing that patch. Sorry.

Some explanation:
The nbdtmg.cxx part is the most important here, that's where the 8 items limit was set (DEFAULT_NUM_VALUSET_COUNT define is 8).
Other parts are trying to deal with the behavior of the 10th item (as mentioned in comment 7). The old Sidebar popup had a "None" item which id was set to 10, that's where it came from.
Comment 13 Commit Notification 2015-06-10 13:14:15 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=71b35212265bb93b10ca35ab964a36e6b6cc552b

tdf#88290 Adapt the numbering popup to more than 8 items

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2015-06-16 13:24:27 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d8b1b4b085088487837ef6ffd0dc4580b2acbb12&h=libreoffice-5-0

tdf#88290 Adapt the numbering popup to more than 8 items

It will be available in 5.0.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2015-06-20 19:18:59 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=be0f5f5b66c55081849250ffad9f600cd61a00a1&h=libreoffice-4-4

tdf#88290 Adapt the numbering popup to more than 8 items

It will be available in 4.4.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Kevin Suo 2015-07-10 05:14:44 UTC
Confirm fixed in
Version: 4.4.5.1
Build ID: 1b6df295803ea040dab1b48b5424da8d78d94cf0
Locale: zh_CN