[Libreoffice-commits] core.git: svl/qa svl/source
DaeHyun Sung (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 25 20:57:01 UTC 2020
svl/qa/unit/svl.cxx | 34 +++++++++++++++++-----------------
svl/source/numbers/zformat.cxx | 8 ++++----
2 files changed, 21 insertions(+), 21 deletions(-)
New commits:
commit 51404171449eadcb69057ff03cbb7bdb0117910b
Author: DaeHyun Sung <sungdh86+git at gmail.com>
AuthorDate: Sun May 24 11:11:04 2020 +0900
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Mon May 25 22:56:21 2020 +0200
Remapping NatNum-DBNum in Korean for compatibility tdf#130193
Remapping NatNum-DBNum in Korean for compatibility tdf#130193
Unlike Japanese and Chinese[Simplified, Traditional] environment on Excel, In Korean Situation, Excel exist DBNum1~4.
I checked DBNum1~4 series on Excel 2016 in Korean Environment.
DBNum1 1234567890 一十二億三千四百五十六万七千八百九十
DBNum2 1234567890 壹拾貳億參阡四百伍拾六萬七阡八百九拾
DBNum3 1234567890 十2億3千4百5十6万7千8百9十
DBNum4 1234567890 일십이억삼천사백오십육만칠천팔백구십
Also, I checked Korean Number to Strings on LibreOffice.
[natnum1] 1234567890 一二三四五六七八九〇
[natnum2] 1234567890 壹貳參四伍六七八九零
[natnum3] 1234567890 1234567890
[natnum4] 1234567890 一十二億三千四百五十六万七千八百九十
[natnum5] 1234567890 壹拾貳億參阡四佰伍拾六萬七阡八佰九拾
[natnum6] 1234567890 1십2억3천4백5십6만7천8백9십
[natnum7] 1234567890 十二億三千四百五十六万七千八百九十
[natnum8] 1234567890 拾貳億參阡四佰伍拾六萬七阡八佰九拾
[natnum9] 1234567890 일이삼사오육칠팔구영
[natnum10] 1234567890 일십이억삼천사백오십육만칠천팔백구십
[natnum11] 1234567890 십이억삼천사백오십육만칠천팔백구십
I also checked Korean billion units test.
[natnum1] 123456789012 一二三四五六七八九〇一二
[natnum2] 123456789012 壹貳參四五六七八九零壹貳
[natnum3] 123456789012 123456789012
[natnum4] 123456789012 一千二百三十四億五千六百七十八万九千一十二
[natnum5] 123456789012 壹仟貳佰參拾四億五仟六佰七拾八萬九仟壹拾貳
[natnum6] 123456789012 1천2백3십4억5천6백7십8만9천1십2
[natnum7] 123456789012 千二百三十四億五千六百七十八万九千十二
[natnum8] 123456789012 仟貳佰參拾四億五仟六佰七拾八萬九仟拾貳
[natnum9] 123456789012 일이삼사오육칠팔구영일이
[natnum10] 123456789012 일천이백삼십사억오천육백칠십팔만구천일십이
[natnum11] 123456789012 천이백삼십사억오천육백칠십팔만구천십이
As a result,
1. from DBNum to NatNum (import):
- DBNum1 -> NatNum4 (Korean Hanja text 한자숫자)
- DBNum2 -> NatNum5 (Korean Upper Hanja text 갖은자)
- DBNum3 -> NatNum6 (fullwidth Arabic digits with Korean hanja unit of Numbering)
- DBNum4 -> NatNum10 (Korean Hangul text)
I found the Bug for NatNum6 (I'll change Korean Hangul to Hanja for compatibility)
2. From NatNum to DBNum
- NatNum1 -> DBNum1
- NatNum2 -> DBNum2
- NatNum3 -> DBNum3
- NatNum4 -> DBNum1
- NatNum5 -> DBNum2
- NatNum6 -> DBNum3
- NatNum7 -> DBNum1
- NatNum8 -> DBNum2
- NatNum9 -> DBNum4
- NatNum10 -> DBNum4
- NatNum11 -> DBNum4
By the way, I change test cases for Korean.
It is included in svl/qa/unit/svl.cxx
It solves the issue tdf#130140
Also, It related the issue tdf#130077
Change-Id: Idb7f3defc5f19e3edc4c179b0a081d2abe8ee3a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94747
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 80be2b2af79a..5d045a8d00ca 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1510,36 +1510,36 @@ void Test::testUserDefinedNumberFormats()
sCode = "[DBNum3][$-0411]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
- // -- Korean: DBNum1 -> NatNum1, DBNum2 -> NatNum2, DBNum3 -> NatNum4, DBNum4 -> NatNum9
+ // -- Korean: DBNum1 -> NatNum4, DBNum2 -> NatNum5, DBNum3 -> NatNum6, DBNum4 -> NatNum10
- // DBNum1 -> NatNum1: Korean lower case characters
- // 一二三四五六七八九
- sExpected = u"\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d ";
- sCode = "[NatNum1][$-0412]General\\ ";
+ // DBNum1 -> NatNum4: Korean lower case characters
+ // 一億二千三百四十五万六千七百八十九
+ sExpected = u"\u4e00\u5104\u4e8c\u5343\u4e09\u767e\u56db\u5341\u4e94\u4e07\u516d\u5343\u4e03\u767e\u516b\u5341\u4e5d ";
+ sCode = "[NatNum4][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
sCode = "[DBNum1][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
- // DBNum2 -> NatNum2: Korean upper case characters
- // 壹貳參四伍六七八九
- sExpected = u"\u58f9\u8cb3\u53c3\u56db\u4f0d\u516d\u4e03\u516b\u4e5d ";
- sCode = "[NatNum2][$-0412]General\\ ";
+ // DBNum2 -> NatNum5: Korean upper case characters
+ // 壹億貳阡參佰四拾伍萬六阡七佰八拾九
+ sExpected = u"\u58f9\u5104\u8cb3\u9621\u53c3\u4f70\u56db\u62fe\u4f0d\u842c\u516d\u9621\u4e03\u4f70\u516b\u62fe\u4e5d ";
+ sCode = "[NatNum5][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
sCode = "[DBNum2][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
- // DBNum3 -> NatNum3: fullwidth Arabic digits
- // 123456789
- sExpected = u"\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 ";
- sCode = "[NatNum3][$-0412]General\\ ";
+ // DBNum3 -> NatNum6: fullwidth Arabic digits
+ // 1억2천3백4십5만6천7백8십9
+ sExpected = u"\uff11\uc5b5\uff12\ucc9c\uff13\ubc31\uff14\uc2ed\uff15\ub9cc\uff16\ucc9c\uff17\ubc31\uff18\uc2ed\uff19 ";
+ sCode = "[NatNum6][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
sCode = "[DBNum3][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
- // DBNum4 -> NatNum9: Hangul characters
- // 일이삼사오육칠팔구
- sExpected = u"\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c ";
- sCode = "[NatNum9][$-0412]General\\ ";
+ // DBNum4 -> NatNum10: Hangul characters
+ // 일억이천삼백사십오만육천칠백팔십구
+ sExpected = u"\uc77c\uc5b5\uc774\ucc9c\uc0bc\ubc31\uc0ac\uc2ed\uc624\ub9cc\uc721\ucc9c\uce60\ubc31\ud314\uc2ed\uad6c ";
+ sCode = "[NatNum10][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
sCode = "[DBNum4][$-0412]General\\ ";
checkPreviewString(aFormatter, sCode, 123456789, eLang, sExpected);
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index af68a340f3d0..774b8fdd0d42 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -141,7 +141,7 @@ void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt
static const std::map<LanguageType, std::array<sal_uInt8, 4>> tblDBNumToNatNum
= { { primary(LANGUAGE_CHINESE), { 4, 5, 3, 0 } },
{ primary(LANGUAGE_JAPANESE), { 4, 5, 3, 0 } },
- { primary(LANGUAGE_KOREAN), { 1, 2, 3, 9 } } };
+ { primary(LANGUAGE_KOREAN), { 4, 5, 6, 10 } } };
// static
sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, bool bDate )
@@ -153,7 +153,7 @@ sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang
{
if ( nDBNum == 4 && eLang == primary(LANGUAGE_KOREAN) )
{
- nNatNum = 9;
+ nNatNum = 10;
}
else if ( nDBNum <= 3 )
{
@@ -176,7 +176,7 @@ sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang
static const std::map<LanguageType, std::array<sal_uInt8, 9>> tblNatNumToDBNum
= { { primary(LANGUAGE_CHINESE), { 1, 0, 0, 1, 2, 3, 0, 0, 0 } },
{ primary(LANGUAGE_JAPANESE), { 1, 2, 3, 1, 2, 3, 1, 2, 0 } },
- { primary(LANGUAGE_KOREAN), { 0, 2, 3, 1, 0, 0, 0, 0, 0 } } };
+ { primary(LANGUAGE_KOREAN), { 1, 2, 3, 1, 2, 3, 1, 2, 4 } } };
// static
sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLang, bool bDate )
@@ -186,7 +186,7 @@ sal_uInt8 SvNumberNatNum::MapNatNumToDBNum( sal_uInt8 nNatNum, LanguageType eLan
eLang = primary(eLang); // 10 bit primary language
if ( bDate )
{
- if ( nNatNum == 9 && eLang == primary(LANGUAGE_KOREAN) )
+ if ( nNatNum == 10 && eLang == primary(LANGUAGE_KOREAN) )
{
nDBNum = 4;
}
More information about the Libreoffice-commits
mailing list