summaryrefslogtreecommitdiff
path: root/svl/qa
AgeCommit message (Collapse)Author
2022-11-21qa: remove duplicated operatorsXisco Fauli
it's already defined in include/tools/color.hxx Change-Id: I26eaba4a1279fadd8669e9702b695e02871052d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142512 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-23make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)Luboš Luňák
Without this, it may not actually be there, so interning "" would use a different string instance, and then comparing with SharedString::getEmptyString() would actually compare non-equal. Change-Id: I22660f63aa321e3a8f72cfb96df1db56e08fbb84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140402 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-07-13tdf#149950: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: Iae7facef72ad17b29b49ea5b52aab77c16357da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137031 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-05-27sw: language fallback in MSWordExportBase::GetNumberFormat()Michael Stahl
There is this number format: <number:date-style style:name="N36" number:automatic-order="true"> <number:day number:style="long"/> <number:text>.</number:text> <number:month number:style="long"/> <number:text>.</number:text> <number:year number:style="long"/> </number:date-style> in a paragraph which has fo:language="zxx", so the field has LANGUAGE_NONE. MSWordExportBase::GetNumberFormat() exports as: DATE \@"dd/MM/yyyy" But should be: DATE \@"dd.MM.yyyy" Follow Eike's suggestion to use the number format's language in case the field doesn't have one. Change-Id: I596bea5daa75c717931b3c5d5506103b87b8ee08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134638 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-03Just use Any ctor instead of makeAny in svlStephan Bergmann
Change-Id: Iefa570476bf0c881e36679ae9511ff63162e05d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133771 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-03no point in mapping SID to itselfNoel Grandin
and once we remove that self mapping, no need to call GetWhich for those IDs either Change-Id: Ia881328a29bb022dace8d5f25c57279a381e0377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-15tdf#145381 handle closing brackets in URLs correctlyArmin Le Grand (Allotropia)
The task presents an URL that ends with a closing bracket. If pasted to LO, the closing bracket got interpreted as not being part of the URL due to the heuristical interpretation of URLs in urihelper. Adapted this to handle matching brackets, so that an closing and ending bracket will be added to the uri text when there is a matching pair. Added unit test to testFindFirstURLInText with simplified uri example. Change-Id: I58dd460a37d0066ff46845832eabd2a790e4ccd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126832 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-25Fix stack-use-after-scopeStephan Bergmann
...during CppunitTest_svl_qa_cppunit, after df42cb6552b20372f62b5a361709670db80e4ed4 "Optimize assignment from OUStringLiteral to OUString", > ==918==ERROR: AddressSanitizer: stack-use-after-scope on address 0x2b2e203b5900 at pc 0x2b2e1b9004f8 bp 0x7ffc06726270 sp 0x7ffc06726268 > READ of size 4 at 0x2b2e203b5900 thread T0 > #0 0x2b2e1b9004f7 in void rtl::str::release<_rtl_uString>(_rtl_uString*) /sal/rtl/strtmpl.hxx:1064:9 > #1 0x2b2e1b8d916c in rtl_uString_release /sal/rtl/ustring.cxx:1785:12 > #2 0x2b2e36263ec5 in rtl::OUString::~OUString() /include/rtl/ustring.hxx:493:9 > #3 0x2b2e3622c5ff in (anonymous namespace)::Test::testTdf103060() /svl/qa/unit/svl.cxx:553:1 [...] > [2304, 2320) 'EXPECTED_G3' (line 550) <== Memory access at offset 2304 is inside this variable (<https://ci.libreoffice.org/job/lo_ubsan/2176/>). (aa2064c5c5f23f6f4b7bc44e12345b37f66995bc "Improve loplugin:stringliteralvar" had failed to introduce those OUStringLiteral variables as static.) Change-Id: I59168979fcc4b055d17d1d4f315577eef1027505 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124134 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-30tdf#144697: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I7a62f7c5c8e6fceebcb9671fa28ec98dd7a312a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122878 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-09-23Add not-quite-ISO date+time with space and milliseconds and locale's separatorEike Rathke
NF_DATETIME_ISO_YYYYMMDD_HHMMSS000 YYYY-MM-DD HH:MM:SS.000 Users may expect to see that if they enter such, instead of the real ISO 8601 "T" format. Change-Id: Iad81750d1c74eedd8d4360163b29ecac98ef6824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122502 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-09-21Add ISO 8601 date+time with milliseconds formatEike Rathke
NF_DATETIME_ISO_YYYYMMDDTHHMMSS000 YYYY-MM-DD"T"HH:MM:SS,000 using either ',' or '.' separator, '.' if Time100SecSep is '.' ',' else A prerequisite for tdf#88359 to not lose data when importing such, especially without "Detect special numbers" on. Change-Id: I02ab682636e6ddbcc4537183a3625ea61662f016 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122400 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-09-17remove GetCharClassPtr from SvtSysLocaleNoel Grandin
we already have GetCharClass and we never return a nullptr Change-Id: I3cb79bc60be614c0474ecfdaad17991f2ecb6368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-09tdf#143664: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: If62da781bffc2480fd81dd6aaf28db69b46a0e31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120198 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-19Move svl::Items to include/svl/whichranges.hxx, and unify its usageMike Kaganski
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed to explicitly use 'value' in WhichRangesContainer's ctor, or create an instance for use in SfxItemSet ctor (svl::Items is already defined as a template value of corresponding type). Instead of WhichRangesContainer Foo(svl::Items<1, 2>::value); SfxItemSet Bar(rItemPool, svl::Items<1, 2>{}); now use: WhichRangesContainer Foo(svl::Items<1, 2>); SfxItemSet Bar(rItemPool, svl::Items<1, 2>); Change-Id: I4681d952b6442732025e5a26768098878907a238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-09Make loplugin:stringadd slightly more aggressiveStephan Bergmann
...by assuming that all const member functions are side-effect free. (This presumably means that some of the special cases in StringAdd::isSideEffectFree are obsoleted by this more general case, but any such removal is postponed to later clean-up.) (Came across this when idly wondering why 8b7f948d9d79393bc6c1b11d239706666fd5d7de "sc, VmlFormControlExporter: avoid OStringBuffer style" had not been found by the plugin before.) Change-Id: I6bca10df53885b14a590543aabd61f23b3748572 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118675 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-07-05tdf#143165: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I34e97340f9f7607107b98f8316fb092fa805d2c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118440 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-03Related: tdf#125035 en_US formatindex="19" DATE_SYSTEM_LONG with D not DDEike Rathke
Otherwise CppunitTest_sw_odfimport testDateFormFormats fails with - Expected: Wednesday, March 4, 2020 - Actual : Wednesday, March 04, 2020 if DateFormatter uses number formatter. This is also what https://www.localeplanet.com/icu/en-US/index.html lists for Date.0 and formatindex="30" has as well. This makes adapting CppunitTest_svl_qa_cppunit testNumberFormat necessary. Change-Id: I1c8cfd954f34f742b0397b8f922d22eb11ae19f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118361 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-06-09Add an SvAddressParser unit testStephan Bergmann
Change-Id: I7d08528f455bb7849e0b62da16c5387b1812ccb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116919 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-27tdf#34724, tdf#91420: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I81f784fb66b80ab0933047aa81d90aff1eec7971 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116246 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-26tdf#100122: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: Ie0a7ea6ae08ea96b04019148f80ee94ef22ef1bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116187 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-26tdf#52510: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I18a7000104add044ba59381c201cb5aff9fb459d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116184 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-24tdf#100834: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I14896935a4735d3719b385e8e7b70094e3d68904 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116067 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-24tdf#100755: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I350148d788ff1bf9dd1c5ccf97aeaad04f975634 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116062 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-21tdf#129878: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I61ad886f4fc79ae6c4a71bcd331adbd7a8e9d966 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115900 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-21tdf#122991: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I94fdab71acbbaf768f5151c642527d61728dfc7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115899 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-21tdf#123748: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I55b3ad930f39f955b5c1f326a12c20af5fc46a1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115896 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-15Related: tdf#128314 Add unit test for NatNum12 lower namesEike Rathke
Change-Id: I909a730111985905e2054b03dbc26e9bab7df92c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115641 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-05-15Related: tdf#128314 tdf#137349 Add unit test for NatNum12 upper namesEike Rathke
Change-Id: Ib71b6bc12471322f0a66eced2258045a563cbb07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115639 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-05-11tdf#127363: svl_qa_cppunit: Add unittestXisco Fauli
Change-Id: I23f792b33ac7147007980e9af38afeb61fd28165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115388 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-05-08ref-count SfxItemPoolNoel Grandin
so we can remove SfxItemPoolUser, which is a right performance hog when we have large calc spreadsheets Change-Id: I344002f536f6eead5cf98c6647dd1667fd9c8874 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115247 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-21loplugin:stringadd replace OUStringLiteral temporaries with OUString::ConcatNoel Grandin
Change-Id: I656f06a74d9f0180ae460264563d6a935c7d2c60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-08Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)Stephan Bergmann
...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-27Improve loplugin:stringliteralvarStephan Bergmann
...to also consider O[U]String ctors taking pointer and length Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-16tdf#123936 Formatting files in module svl with clang-formatPhilipp Hofer
Change-Id: Iaaac34428ef0e5b8f09f6cbcad16ea5bab145321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105714 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2020-10-08use sal_Int32 for style-sheet indexNoel Grandin
instead of a mix of unsigned and sal_uInt16. Change-Id: Ice56d58d22856daa6645577610368ba19a849176 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104076 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-03Make ImpSvNumberformatScan::GetColor constMike Kaganski
Change-Id: Idbcce18029944ab884cdde03e21190cbb574a00f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102005 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2020-06-12fix ASAN in SharedStringPoolNoel Grandin
regression from commit 3581f1d71ae0d431ba28c0f3b7b263ff6212ce7b optimize SharedStringPool::purge() and fix tests which results in us potentially de-referencing an already de-allocated OUString object in the first loop in purge(). So switch to a different strategy, which only needs one data structure, instead of two. Change-Id: Iaac6beda48459643afdb7b14ce7d39d68a93339c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95226 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-11Drop configurability of libnumbertext useTor Lillqvist
It was fairly pointless to be able to --disable-libnumbertext. Besides, disabling it broke the ordinal page (etc) numbering feature: "1st", "2nd", "3rd", etc showed up as "Ordinal-number 1", "Ordinal-number 2", "Ordinal-number 3" etc. Change-Id: I645169054a8fdc8dac89cd48b6c369fd61749467 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96119 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-05Upcoming loplugin:elidestringvar: svlStephan Bergmann
Change-Id: I124dd9be0ca8ede61323dd77b737253c5af99ceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95570 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-03fix ubsan in SharedStringPoolNoel Grandin
with a slightly dodgy fix. regression from commit 3581f1d71ae0d431ba28c0f3b7b263ff6212ce7b optimize SharedStringPool::purge() and fix tests It's not ideal - we no longer have a way of purging uppercase keys that are longer in use. But that doesn't cost much memory, because we are sharing those strings. We could potentially identify them with extra book-keeping in either intern() or purge(), but since this class is performance-sensitive, best just to sacrifice some space in the map. Change-Id: I85a469448f5b36b1b6889da60280edd56bbcb083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-02optimize SharedStringPool::purge() and fix testsNoel Grandin
which were checking the wrong thing - we don't care about the input strings to intern(), we care about which SharedString objects are still alive. Change-Id: Ia35a173a02a24efb335268dcae4078a956d11098 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95177 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-05-28Make loplugin:simplifypointertobool handle parenthesized expressionsStephan Bergmann
...as discussed as an open TODO in the commit message of fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr". The necessary changes across the code base have been done fully automatically with the rewriting plugin on Linux. (All those changes apparently involve uses of macro arguments wrapped in parentheses in the macro body, but always in conditionally-converted-to-bool contexts. In other contexts, such automatic rewriting would add the "bool" to the macro body, which would be wrong in general, but we apparently get away with that sloppy coding for now.) The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had introduced to treat such (then-undetected, it had turned out) parenthesized cases now turns out to not be needed after all. Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-26Fix typoAndrea Gelmini
Change-Id: I44b332e840a5e3084c0c16fe05f0918e42217c13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94821 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-05-25Remapping NatNum-DBNum in Korean for compatibility tdf#130193DaeHyun Sung
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@redhat.com>
2020-05-25tdf#130193: Asian Excel-Calc number format interopNaruhiko Ogasawara
remap NatNum - DBNum in Japanese/Chinese to improve Excel interoprability from DBNum to NatNum (import) in ja/zh: - DBNum1 -> NatNum4 (modern long Kanji text) - DBNum2 -> NatNum5 (traditional long Kanji text) - DBNum3 -> NatNum3 (fullwidth Arabic digits) from NatNum to DBNum (export) in ja: - NatNum1 -> DBNum1 - NatNum2 -> DBNum2 - NatNum3 -> DBNum3 - NatNum4 -> DBNum1 - NatNum5 -> DBNum2 - NatNum6 -> DBNum3 - NatNum7 -> DBNum1 - NatNum8 -> DBNum2 - NatNum9 -> (DBNum0, as Arabic) in zh, nothing change about export. It also partially solves the issue tdf#130140 (about Japanese, not Korean) To do this, more data-drivened MapDBNumToNatNum() and MapNatNumToDBNum() in svl/source/numbers/zformat.cxx By mapping "NatNum - DBNum" to a table using map and array, it makes the specification for each language more understandable The new test cases are also included in svl/qa/unit/svl.cxx Change-Id: I34a70d970ef2e46c1b3db5db1c397ab89c056191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94376 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2020-05-09fix leak in svl unit testNoel Grandin
Change-Id: I8dc11da4e1de5c2e2831ac85dff0daeac0e0ce95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-13Revert "loplugin:constfields in svl"Noel Grandin
This reverts commit 5181253946ca1877cc42050452aa6d733d6da3f1. Change-Id: I30e30aae45c33824c0df823a9fad710faa81ea3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90453 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>