Bug 95494 - Calc can not sort Chinese word by stroke and radical
Summary: Calc can not sort Chinese word by stroke and radical
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.0.beta1
Hardware: All All
: medium normal
Assignee: yanjingtao
URL:
Whiteboard: target:5.2.0 target:5.1.0.2 target:5...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-11-01 15:06 UTC by jmxhyz
Modified: 2016-10-25 19:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jmxhyz 2015-11-01 15:06:49 UTC
patch is here. tested in 5.0.3.1 and OK.

source file: /libreoffice-5.0.3.1/i18npool/source/collator/collator_unicode.cxx

=======

--- /libreoffice-5.0.3.1/i18npool/source/collator/collator_unicode.cxx.old
+++ /libreoffice-5.0.3.1/i18npool/source/collator/collator_unicode.cxx
@@ -156,20 +156,20 @@
                 aBuf.appendAscii("get_").append(rLocale.Language).appendAscii("_");
                 if ( rLocale.Language == "zh" ) {
                     OUString func_base = aBuf.makeStringAndClear();
-                    OUString funclen_base = func_base + "_length";
+                    OUString funclen_base = func_base;// + "_length";
                     if (OUString("TW HK MO").indexOf(rLocale.Country) >= 0)
                     {
                         func = reinterpret_cast<const sal_uInt8* (*)()>(osl_getFunctionSymbol(hModule,
                                     OUString(func_base + "TW_" + rAlgorithm).pData));
                         funclen = reinterpret_cast<size_t (*)()>(osl_getFunctionSymbol(hModule,
-                                    OUString(funclen_base + "TW_" + rAlgorithm).pData));
+                                    OUString(funclen_base + "TW_" + rAlgorithm + "_length").pData));
                     }
                     if (!func)
                     {
                         func = reinterpret_cast<const sal_uInt8* (*)()>(osl_getFunctionSymbol(
                                 hModule, OUString(func_base + rAlgorithm).pData));
                         funclen = reinterpret_cast<size_t (*)()>(osl_getFunctionSymbol(
-                                hModule, OUString(funclen_base + rAlgorithm).pData));
+                                hModule, OUString(funclen_base + rAlgorithm + "_length").pData));
                     }
                 } else {
                     if ( rLocale.Language == "ja" ) {
Comment 1 jmxhyz 2015-11-02 08:21:51 UTC
affect all versions.

Can someone please push the patch for me.
Comment 2 Kevin Suo 2016-01-07 08:57:45 UTC
Just for for your information, this bug was initially reported in the Chinese LibreOffice Community Forum by jmxhyz, and was confirmed by several other people:
http://www.libreofficechina.org/thread-931-1-1.html

--------

Steps to Reproduce:
1. Input a list of Chinese words in column A;
2. Select column A, then go to Data -> Sort -> Options tab, Language: Chinese (Simplified); Option: "strokes 笔画" or “radical 部首".
3. Click OK.

Result:
The data are still sorted by Pinyin. We expect the data to be sorted by strokes or radical.

---------
The Patch

jmxhyz submitted a patch in this bug. He stated that the issue is an error when generating the file name, "_length" should be put at the end, but was wrongly put at the middle.
jmxhyz says that he has built the the LibreOffice with his patch and the bug disappeared.
Comment 3 Kevin Suo 2016-01-08 01:07:34 UTC
Tom has submitted the patch which is now pending review:
https://gerrit.libreoffice.org/21213
Comment 4 Commit Notification 2016-01-11 17:25:47 UTC
Jingtao Yan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1b683de366f4caf82225c632f02cf0f58ae76490

tdf#95494 Calc can not sort Chinese word by stroke and radical,

It will be available in 5.2.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 5 Commit Notification 2016-01-11 17:31:09 UTC
Jingtao Yan committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=545400aa5fce1c8aba1c02f96b3052ad447de5cc&h=libreoffice-5-1

tdf#95494 Calc can not sort Chinese word by stroke and radical,

It will be available in 5.1.0.2.

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 6 Commit Notification 2016-01-11 17:41:03 UTC
Jingtao Yan committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

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

tdf#95494 Calc can not sort Chinese word by stroke and radical,

It will be available in 5.0.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.