[Libreoffice-commits] core.git: i18npool/source offapi/com sw/qa sw/source writerfilter/source
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 55 ++ offapi/com/sun/star/style/NumberingType.idl | 22 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 sw/source/filter/ww8/docxattributeoutput.cxx |6 - sw/source/filter/ww8/rtfattributeoutput.cxx | 12 +- sw/source/filter/ww8/ww8atr.cxx |6 - writerfilter/source/dmapper/ConversionHelper.cxx |8 + writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 + 8 files changed, 108 insertions(+), 9 deletions(-) New commits: commit 4598a385ffaaf8fdc124962d347fead994450bea Author: DaeHyun Sung AuthorDate: Mon Jul 26 23:36:50 2021 +0900 Commit: Miklos Vajna CommitDate: Thu Jul 29 08:43:18 2021 +0200 tdf#143526 fix and add Korean numbering fix Korean NumberFormat, compare with MS Word change mapping of style::NumberingType::NUMBER_HANGUL_KO, from "koreanLegal" to "koreanCounting" "koreanDigital" add new reserved words "일, 일영, 일영영, etc" - style::NumberingType::NUMBER_DIGITAL_KO "koreanLegal" is new reserved words "하나, 둘, 셋, 넷, 다섯, 여섯, 일곱, 여덟, 아홉, 열" - style::NumberingType::NUMBER_LEGAL_KO "koreanDigital2" is new reserved words "一, 一零, 一零零, etc" - style::NumberingType::NUMBER_DIGITAL2_KO Reference: 1: "[MS-OE376]: Office Implementation Information for ECMA-376 Standards Support" https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/a5deef83-bb01-410f-bde0-9c35abe4ca52 2.1.350 Part 4 Section 2.13.5.30, numberingChange (Previous Paragraph Numbering Properties) 2: "[MS-DOCX]: Word Extensions to the Office Open XML (.docx) File Format" shows example of not only Korean Numbering also others Numbering examples. https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/b839fe1f-e1ca-4fa6-8c26-5954d0abbccd 2.4 numFmt Extensions https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx/a1bb5809-e361-4e49-8e16-7f1a67da4121 Change-Id: I535b2aa3cf4111d86b9b7b788afe4aa64e8e4545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119518 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index dadfc13b86a0..b7ee64cac5eb 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -288,6 +288,29 @@ const sal_Unicode table_PersianWord_decadeX[][8]={ {0x0645, 0x06cc, 0x0644, 0x06cc, 0x0627, 0x0631, 0x062f, 0} // 10 }; +const sal_Unicode table_KoreanLegalWord_decade1[][3] = { +{0xd558, 0xb098, 0}, // 1 +{0xb458, 0}, // 2 +{0xc14b, 0}, // 3 +{0xb137, 0}, // 4 +{0xb2e4, 0xc12f, 0}, // 5 +{0xc5ec, 0xc12f, 0}, // 6 +{0xc77c, 0xacf1, 0}, // 7 +{0xc5ec, 0xb35f, 0}, // 8 +{0xc544, 0xd649, 0} // 9 +}; + +const sal_Unicode table_KoreanLegalWord_decade2[][3] = { +{0xc5f4, 0}, // 10 +{0xc2a4, 0xbb3c, 0}, // 20 +{0xc11c, 0xb978, 0}, // 30 +{0xb9c8, 0xd754, 0}, // 40 +{0xc270, 0}, // 50 +{0xc608, 0xc21c, 0}, // 60 +{0xc77c, 0xd754, 0}, // 70 +{0xc5ec, 0xb4e0, 0}, // 80 +{0xc544, 0xd754, 0} // 90 +}; DefaultNumberingProvider::DefaultNumberingProvider( const Reference < XComponentContext >& rxContext ) : m_xContext(rxContext) { @@ -468,6 +491,16 @@ void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult ) rsResult += aTemp; } +static void lcl_formatKoreanLegalWord(sal_Int32 nNumber, OUString& rsResult) { +OUStringBuffer aTemp(64); +int digit1 = nNumber % 10; +int digit2 = nNumber / 10; +if (digit1 > 0) +aTemp.insert(0, (table_KoreanLegalWord_decade1[digit1 - 1])); +if (digit2 > 0) +aTemp.insert(0, (table_KoreanLegalWord_decade2[digit2 - 1])); +rsResult += aTemp.makeStringAndClear(); +} // Greek Letter Numbering @@ -743,6 +776,25 @@ DefaultNumberingProvider::makeNumberingString( const Sequence= 100) + { + natNum = NativeNumberMode::NATNUM11; + locale.Language = "ko"; + } + else + { + lcl_formatKoreanLegalWord(number, result); + } + break; case CIRCLE_NUMBER: table = table_CircledNumber; @@ -1016,6 +1068,9 @@ const Supported_NumberingType aSupportedTypes[] = {style::NumberingType::HANGUL_SYLLABLE_KO, nullptr, LANG_CJK}, {style::NumberingType::HANGUL_CIRCLED_JAMO_KO, nullptr, LANG_CJK}, {style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO, nullptr,
[Libreoffice-commits] core.git: i18npool/source offapi/com
i18npool/source/transliteration/transliterationImpl.cxx |2 +- offapi/com/sun/star/i18n/TransliterationModulesExtra.idl |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 9e5ed5c3ef64934c410ad561c3862dc03e757cc7 Author: Mike Kaganski AuthorDate: Fri May 14 10:07:29 2021 +0200 Commit: Mike Kaganski CommitDate: Fri May 14 11:16:06 2021 +0200 Typos in comments Change-Id: I6d421f007f6a4b1550e0c8c907feea2472216502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115517 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index 88fc122e4eca..46368d88e167 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -202,7 +202,7 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r bodyCascade[numCascade], rLocale)) numCascade++; } -// additional transliterations from TranslationModuleExtra (we cannot extend TransliterationModule) +// additional transliterations from TransliterationModulesExtra (we cannot extend TransliterationModules) if (bool(modType & TransliterationModules(TransliterationModulesExtra::IGNORE_DIACRITICS_CTL))) { if (loadModuleByName("ignoreDiacritics_CTL", bodyCascade[numCascade], rLocale)) diff --git a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl index 5a67714ba640..baaa14c13a5e 100644 --- a/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl +++ b/offapi/com/sun/star/i18n/TransliterationModulesExtra.idl @@ -56,7 +56,7 @@ constants TransliterationModulesExtra diacritic from characters. Because we cannot extend the TransliterationModules enum we use -TranslationModuleExtra and it will act the same way. +TransliterationModulesExtra and it will act the same way. */ const long IGNORE_DIACRITICS_CTL = 0x4000; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: i18npool/source offapi/com sw/qa
i18npool/source/characterclassification/cclass_unicode_parser.cxx | 13 + offapi/com/sun/star/i18n/KParseTokens.idl | 22 ++ sw/qa/extras/rtfexport/rtfexport.cxx |2 3 files changed, 34 insertions(+), 3 deletions(-) New commits: commit 776f7e7463de3e97f3056712ee567f49a314829d Author: Eike Rathke AuthorDate: Fri Nov 30 14:20:49 2018 +0100 Commit: Eike Rathke CommitDate: Fri Nov 30 20:01:20 2018 +0100 [API CHANGE] Resolves: tdf#42518 new KParseTokens::GROUP_SEPARATOR_IN_NUMBER Default unset bit now does not accept/skip group separators in numbers. See .idl description comment for why this is incompatible and how. This actually uncovered a "bug" (or at least unexpected) in the Math parser that parsed "0," as one entity instead of "0" followed by ",". As obtaining the text form appends a blank after each entity the sw/qa/extras/rtfexport/rtfexport.cxx testMathEqarray() testcase had to be adapted. Change-Id: I2b605742ab3d8a9bb81ad6880faf050535dc80fa Reviewed-on: https://gerrit.libreoffice.org/64270 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 8cca988607fd..3c040a5a0085 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -441,8 +441,15 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar cDecimalSepAlt = aItem.decimalSeparatorAlternative.toChar(); } -if ( cGroupSep < nDefCnt ) -pTable[cGroupSep] |= ParserFlags::VALUE; +if (nContTypes & KParseTokens::GROUP_SEPARATOR_IN_NUMBER) +{ +if ( cGroupSep < nDefCnt ) +pTable[cGroupSep] |= ParserFlags::VALUE; +} +else +{ +cGroupSep = 0; +} if ( cDecimalSep < nDefCnt ) pTable[cDecimalSep] |= ParserFlags::CHAR_VALUE | ParserFlags::VALUE; if ( cDecimalSepAlt && cDecimalSepAlt < nDefCnt ) @@ -814,6 +821,8 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 } if ( nMask & ParserFlags::VALUE ) { +if (current == cGroupSep) +nParseTokensType |= KParseTokens::GROUP_SEPARATOR_IN_NUMBER; if ((current == cDecimalSep || (bDecSepAltUsed = (cDecimalSepAlt && current == cDecimalSepAlt))) && ++nDecSeps > 1) { diff --git a/offapi/com/sun/star/i18n/KParseTokens.idl b/offapi/com/sun/star/i18n/KParseTokens.idl index ce5d355f0430..bc0f92c42c83 100644 --- a/offapi/com/sun/star/i18n/KParseTokens.idl +++ b/offapi/com/sun/star/i18n/KParseTokens.idl @@ -95,6 +95,28 @@ published constants KParseTokens /// Unicode (above 127) other number const long UNI_OTHER_NUMBER = 0x0008; +/** If this bit is set in nContCharFlags parameters, the +locale's group separator characters in numbers are accepted and +ignored/skipped. Else a group separator in a number ends the +current token. A leading group separator is never accepted. If +an accepted group separator was encountered in a number +(ParseResult::TokenType is KParseType::ASC_NUMBER or +KParseType::UNI_NUMBER) this bit is also set in +ParseResult::ContFlags. + + NOTE: absence of this bit in +nContCharFlags changes the default behaviour that in +prior releases accepted numbers with group separators but lead +to unexpected results when parsing formula expressions where the +user entered a (wrong) separator that happened to be the group +separator instead of an intended decimal separator. Usually +inline numbers in a formula expression do not contain group +separators. + +@since LibreOffice 6.2 + */ +const long GROUP_SEPARATOR_IN_NUMBER = 0x0800; + /** If this bit is set in nContCharFlags parameters and a string enclosed in double quotes is parsed and two consecutive double quotes are encountered, the string is ended. If this bit diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 8b6ecdb27f85..8dc665642278 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -210,7 +210,7 @@ DECLARE_RTFEXPORT_TEST(testMathEqarray, "math-eqarray.rtf") { OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString const aExpected( -"y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none"); +"y = left lbrace stack { 0 , x < 0 # 1 , x = 0 # {x} ^ {2} , x > 0 } right none"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
[Libreoffice-commits] core.git: i18npool/source offapi/com svl/CppunitTest_svl_qa_cppunit.mk svl/qa
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 66 ++ i18npool/source/nativenumber/nativenumbersupplier.cxx | 107 -- offapi/com/sun/star/i18n/NativeNumberMode.idl | 11 + svl/CppunitTest_svl_qa_cppunit.mk | 14 + svl/qa/unit/svl.cxx | 12 + 5 files changed, 152 insertions(+), 58 deletions(-) New commits: commit 56a7f308cf57f87d9e2cdeb77f48b570f81de85e Author: Mike KaganskiDate: Sun May 13 03:09:43 2018 +0300 tdf#115007: add NatNum codes for cardinal/ordinal number names/indicators ... based on libnumbertext integrated since commit f1579d3d6c5f5f3a651825e035b93bee7a4f43c6. [NatNum12] gives cardinal number names (one, two, three, ...) [NatNum13] gives ordinal number names (first, second, third, ...) [NatNum14] gives ordinal indicators (1st, 2nd, 3rd, ...) Change-Id: Ie2afdeeb82da1b36e9755c02d7b2276c77be9c72 Reviewed-on: https://gerrit.libreoffice.org/54186 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index e222611a2afe..af4e27d0f69f 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -32,9 +31,6 @@ #include #include #include -#include -#include -#include // Cyrillic upper case #define C_CYR_A "\xD0\x90" @@ -588,6 +584,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence xNumberText; - if (!xNumberText.is()) - xNumberText = linguistic2::NumberText::create( m_xContext ); - OUString aLoc = LanguageTag::convertToBcp47(aLocale); - OUString numbertext_prefix = ""; - if (numType == TEXT_NUMBER) - numbertext_prefix += "ordinal-number "; - else if (numType == TEXT_ORDINAL) - numbertext_prefix += "ordinal "; - // Several hundreds of headings could result typing lags because - // of the continuous update of the multiple number names during typing. - // We fix this by buffering the result of the conversion. - static std::unordered_map > aBuff; - auto aBuffItem = aBuff.find(number); - std::map aItem; - if (aBuffItem == aBuff.end() || !aBuffItem->second.count(numbertext_prefix + aLoc)) - { - OUString snumber = OUString::number(number); - OUString aNum = - xNumberText->getNumberText( numbertext_prefix + snumber, aLocale); - if ( !xCharClass.is() ) - xCharClass = CharacterClassification::create( m_xContext ); - // use number at missing number to text conversion - if (aNum.getLength() == 0) - aNum = snumber; - // capitalize first letter - aItem[numbertext_prefix + aLoc] = xCharClass->toTitle(aNum, 0, 1, aLocale) + aNum.copy(1); - aBuff.insert(std::make_pair(number, aItem)); - } - else - { - aItem = aBuffItem->second; - } - result += aItem[numbertext_prefix + aLoc]; - break; - } + natNum = NativeNumberMode::NATNUM13; // ordinal number names (first, second, third, ...) + locale = aLocale; + bCapitalize = true; + break; case ROMAN_UPPER: result += toRoman( number ); break; @@ -937,7 +909,17 @@ DefaultNumberingProvider::makeNumberingString( const Sequence xNatNum(new NativeNumberSupplierService); -result += xNatNum->getNativeNumberString(OUString::number( number ), locale, natNum); +OUString aNum += xNatNum->getNativeNumberString(OUString::number(number), locale, natNum); +if (bCapitalize) +{ +if (!xCharClass.is()) +xCharClass = CharacterClassification::create(m_xContext); +// capitalize first letter +result += xCharClass->toTitle(aNum, 0, 1, aLocale) + aNum.copy(1); +} +else +result += aNum; } else if (tableSize) {
[Libreoffice-commits] core.git: i18npool/source offapi/com
i18npool/source/nativenumber/data/numberchar.h | 16 +++ offapi/com/sun/star/i18n/NativeNumberMode.idl | 26 ++--- 2 files changed, 31 insertions(+), 11 deletions(-) New commits: commit c16efc81bd9fb1cfc85f7949eccbdeb5818e5093 Author: Laurent Balland-PoirierDate: Tue Aug 16 15:30:26 2016 +0200 Native Numbers: update list of supported languages Change-Id: I3a6ef21e1d46aeecb5bfd84e43dd2563b201de0a Reviewed-on: https://gerrit.libreoffice.org/28170 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/i18npool/source/nativenumber/data/numberchar.h b/i18npool/source/nativenumber/data/numberchar.h index 62e490f..18974ac 100644 --- a/i18npool/source/nativenumber/data/numberchar.h +++ b/i18npool/source/nativenumber/data/numberchar.h @@ -76,14 +76,14 @@ static const sal_Unicode NumberChar[][10] = { { 0x0966, 0x0967, 0x0968, 0x0969, 0x096A, 0x096B, 0x096C, 0x096D, 0x096E, 0x096F }, // Marathi { 0x09E6, 0x09E7, 0x09E8, 0x09E9, 0x09EA, 0x09EB, 0x09EC, 0x09ED, 0x09EE, 0x09EF }, // Bengali { 0x0A66, 0x0A67, 0x0A68, 0x0A69, 0x0A6A, 0x0A6B, 0x0A6C, 0x0A6D, 0x0A6E, 0x0A6F }, // Punjabi (Gurmukhi) -{ 0x0AE6, 0x0AE7, 0x0AE8, 0x0AE9, 0x0AEA, 0x0AEB, 0x0AEC, 0x0AED, 0x0AEE, 0x0AEF }, // Gujarali +{ 0x0AE6, 0x0AE7, 0x0AE8, 0x0AE9, 0x0AEA, 0x0AEB, 0x0AEC, 0x0AED, 0x0AEE, 0x0AEF }, // Gujarati { 0x0030, 0x0BE7, 0x0BE8, 0x0BE9, 0x0BEA, 0x0BEB, 0x0BEC, 0x0BED, 0x0BEE, 0x0BEF }, // Tamil { 0x0C66, 0x0C67, 0x0C68, 0x0C69, 0x0C6A, 0x0C6B, 0x0C6C, 0x0C6D, 0x0C6E, 0x0C6F }, // Telugu { 0x0CE6, 0x0CE7, 0x0CE8, 0x0CE9, 0x0CEA, 0x0CEB, 0x0CEC, 0x0CED, 0x0CEE, 0x0CEF }, // Kannada { 0x0DE6, 0x0DE7, 0x0DE8, 0x0DE9, 0x0DEA, 0x0DEB, 0x0DEC, 0x0DED, 0x0DEE, 0x0DEF }, // Malayalam { 0x0ED0, 0x0ED1, 0x0ED2, 0x0ED3, 0x0ED4, 0x0ED5, 0x0ED6, 0x0ED7, 0x0ED8, 0x0ED9 }, // Lao { 0x0F20, 0x0F21, 0x0F22, 0x0F23, 0x0F24, 0x0F25, 0x0F26, 0x0F27, 0x0F28, 0x0F29 }, // Tibetan -{ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049 }, // Myammar +{ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049 }, // Myanmar { 0x17E0, 0x17E1, 0x17E2, 0x17E3, 0x17E4, 0x17E5, 0x17E6, 0x17E7, 0x17E8, 0x17E9 }, // Cambodian (Khmer) { 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817, 0x1818, 0x1819 }, // Mongolian { 0x0020, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8 }, // Hebrew @@ -111,14 +111,14 @@ static sal_Unicode DecimalChar[] = { 0x, // Marathi 0x, // Bengali 0x, // Punjabi (Gurmukhi) -0x, // Gujarali +0x, // Gujarati 0x, // Tamil 0x, // Telugu 0x, // Kannada 0x, // Malayalam 0x, // Lao 0x, // Tibetan -0x, // Myammar +0x, // Myanmar 0x, // Cambodian (Khmer) 0x, // Mongolian 0x, // Hebrew @@ -146,14 +146,14 @@ static const sal_Unicode MinusChar[] = { 0x, // Marathi 0x, // Bengali 0x, // Punjabi -0x, // Gujarali +0x, // Gujarati 0x, // Tamil 0x, // Telugu 0x, // Kannada 0x, // Malayalam 0x, // Lao 0x, // Tibetan -0x, // Myammar +0x, // Myanmar 0x, // Cambodian (Khmer) 0x, // Mongolian 0x, // Hebrew @@ -181,14 +181,14 @@ static sal_uInt16 SeparatorChar[] = { 0x, // Marathi 0x, // Bengali 0x, // Punjabi -0x, // Gujarali +0x, // Gujarati 0x, // Tamil 0x, // Telugu 0x, // Kannada 0x, // Malayalam 0x, // Lao 0x, // Tibetan -0x, // Myammar +0x, // Myanmar 0x, // Cambodian (Khmer) 0x, // Mongolian 0x, // Hebrew diff --git a/offapi/com/sun/star/i18n/NativeNumberMode.idl b/offapi/com/sun/star/i18n/NativeNumberMode.idl index ed12420..6af4613 100644 --- a/offapi/com/sun/star/i18n/NativeNumberMode.idl +++ b/offapi/com/sun/star/i18n/NativeNumberMode.idl @@ -56,16 +56,36 @@ published constants NativeNumberMode Chinese:Chinese lower case characters; CAL: 1/7/7 [DBNum1] Japanese: short Kanji characters [DBNum1]; CAL: 1/4/4 [DBNum1] Korean: Korean lower case characters [DBNum1]; CAL: 1/7/7 [DBNum1] +Hebrew: Hebrew characters +Arabic: Arabic-Indic characters Thai: Thai characters -Arabic: Indic characters -Indic: Indic characters +Hindi: Indic-Devanagari characters +Odia: Odia (Oriya) characters +Marathi:Indic-Devanagari characters +Bengali:Bengali characters +Punjabi:Punjabi (Gurmukhi) characters +Gujarati: Gujarati characters +Tamil: Tamil