summaryrefslogtreecommitdiff
path: root/i18npool/source/nativenumber/nativenumbersupplier.cxx
AgeCommit message (Collapse)Author
2018-06-28Check string length before copying, tdf#115007 follow-upEike Rathke
Change-Id: I50b842afc505ce603225fb2d25281cc8e9240200 Reviewed-on: https://gerrit.libreoffice.org/56537 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit d9388ab070ff99055650bf54b0e683a4be9bcdc9) Reviewed-on: https://gerrit.libreoffice.org/56540 Tested-by: Jenkins
2018-06-27tdf#115007 add NatNum12 formatting to datesLászló Németh
to support variants of preposition, suffixation, article or their combinations. For example, Catalan "de març"/"d'abril", English "1st of May"/"First of May", Hungarian "május 1-je/május 2-a" (May 1/2) or Turkish "2018'de/2019'da" (in 2018/2019) usage can be automatic in templates and mail merge. When the date format contains more than a date keyword, it needs to specify in the NatNum12 argument which date element has got special formatting (described by libnumbertext formatting codes, and an optional initial capitalize/upper/title argument): '[NatNum12 ordinal-number]D' -> "1st" '[NatNum12 D=ordinal-number]D" of "MMMM' -> "1st of April" '[NatNum12 D=ordinal]D" of "MMMM' -> "first of April" '[NatNum12 YYYY=title year,D=capitalize ordinal] D"of "MMMM", "YYYY' -> "First of April, Nineteen Ninety" Note: set only for YYYY, MMMM, M, DDDD, D and NNN/AAAA in date formats. It's possible to extend this for other keywords and date + time combinations, according to the possible language requirements. Note 2: l10n date formats can use the new NatNum12 date formats from formatindex=60, see FormatElement in i18npool/source/localedata/ XML files and FormatElement specification: https://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/locale.dtd#223 Change-Id: I598849f1492f4012e83cef9293773badbff16206 Reviewed-on: https://gerrit.libreoffice.org/55613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-on: https://gerrit.libreoffice.org/55767 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-06-21NatNum12: fix and add capitalization prefixes, tdf#115007 follow-upLászló Németh
Limit NatNum12 conversion only for the selected parts of the date format (this bug – double calls of getNumberText – was hidden by the space prefix " " and empty return values at the first calls, resulting unchanged dates yet). New prefixes: "capitalize", "upper" and "title" to handle optional capitalization. (In Calc, it was not possible to format the result of NatNum formatting, but some languages often need capitalization or title case to format numbers and currencies.) Thanks code clean up using enum WhichCasing to Eike Rathke. Reviewed-on: https://gerrit.libreoffice.org/55681 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Conflicts: svl/qa/unit/svl.cxx Change-Id: I5fceb784930e6bc6d376116f5a42ad49cd248a54 Reviewed-on: https://gerrit.libreoffice.org/56202 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-06-11tdf#115007: add import/export to NatNum12 (spell out numbers,László Németh
dates and money amounts, supporting all the XNumberText/libnumbertext formatting codes, for example "ordinal", "ordinal-number", "ordinal-feminine", etc., and ISO 4217 currency codes, also their possible combinations. NatNum12 formatting codes are stored by using the newly introduced (yet, loext:)transliteration-spellout attribute. creator-initials also added to token list Change-Id: I20f93c9d16778f142067a56d53b336d0acbe2d92 Reviewed-on: https://gerrit.libreoffice.org/54673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 32f1c56d8ff5e6f87dbcf086fd3743d6d36182bc) Reviewed-on: https://gerrit.libreoffice.org/55625 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: László Németh <nemeth@numbertext.org>
2018-06-11tdf#115007: Use [NatNum12 params...] syntaxMike Kaganski
This allows using all the libnumbertext library functions. [NatNum12] gives cardinal number names (one, two, three, ...) [NatNum12 ordinal] gives ordinal number names (first, second, third, ...) [NatNum12 ordinal-number] gives ordinal indicators (1st, 2nd, 3rd, ...) [NatNum12 money USD][$-409] gives formal English (US) money text ... etc (see numbertext.org for syntax). Change-Id: I16dbb44d8d4bdb82a1b950de6d438c8311b554ff Reviewed-on: https://gerrit.libreoffice.org/54366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 90d233b0311a208967a3e264820e00395bf057fb) Reviewed-on: https://gerrit.libreoffice.org/55624 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: László Németh <nemeth@numbertext.org>
2018-06-05NatNum spelling: also spell decimalsMike Kaganski
Change-Id: I421234e5e74bcdf83d55ed8b0e7a320e37f6a231 Reviewed-on: https://gerrit.libreoffice.org/54375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 7b5f5d77d56ee494647d9e7868546b3f2140896e) Reviewed-on: https://gerrit.libreoffice.org/55332
2018-05-15Guard static variables, tdf#115007 tdf#117171 follow-upEike Rathke
Change-Id: Ib8f73ceefb8278b6233d46d86a34a3869622239f
2018-05-15tdf#115007: add NatNum codes for cardinal/ordinal number names/indicatorsMike Kaganski
... 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 <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-03-08loplugin:constantparam in desktop..i18npoolNoel Grandin
Change-Id: Ie2e1004c1ccc03777a8da9cb1144e89eb28ff313 Reviewed-on: https://gerrit.libreoffice.org/50928 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-20loplugin:unusedindexMike Kaganski
Change-Id: Id6e17d00c87d79f899cf691d00e600dfc102cab0 Reviewed-on: https://gerrit.libreoffice.org/46832 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-12-11loplugin:salcall fix functionsNoel Grandin
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: i18npoolStephan Bergmann
Change-Id: I4356a9e559a3f63c172542256543b272df6ba173
2017-10-04move stuff in i18npool/i18nutil in own namespaceNoel Grandin
instead of trying to share the css::i18n namespace, which is just very confusing and should be left to actual UNO artifacts Change-Id: I2f5c36bf1af9a2a98c4f997dd450d015e75ed3f6 Reviewed-on: https://gerrit.libreoffice.org/43079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13use more OUString::operator== in forms..salNoel Grandin
Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc Reviewed-on: https://gerrit.libreoffice.org/39899 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18coverity#1412874 silence Out-of-bounds read warningCaolán McNamara
Change-Id: If51571f698ca11383b1b143281ede04bac111e2a
2017-06-18add comment on special case for the 15 and 16 numbersCaolán McNamara
Change-Id: Iecc46c30b9d4a91339099f5b0b6d8a9ca715b13b
2017-06-15use more SAL_N_ELEMENTS part 3Noel Grandin
Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-27loplugin:loopvartoosmallStephan Bergmann
Change-Id: I1842a5e047e4566371b62511ad5b56d466e717da
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-19New loplugin:dynexcspec: Add @throws documentation, i18npoolStephan Bergmann
Change-Id: Ie1304a081a8c26cb3204ca7fb3edfa7e2dfae386
2017-01-10New loplugin:conststringvar: i18npoolStephan Bergmann
Change-Id: Ic02549364d0499c453f88bda358c78fce7fc4343
2017-01-09New loplugin:externvar: i18npoolStephan Bergmann
Change-Id: Id38d1fde0e0f6e08899e83697f586d513b635aad
2016-08-26loplugin:refcounting: also cover temporaries being directly stack managedStephan Bergmann
Change-Id: Ib0f7c60df1d2fba0d4d9d3fa6faf3bb97867ebc0
2016-05-10Add SAL_FALLTHROUGH, where apparently appropriateStephan Bergmann
Change-Id: I041971ad00b6b2e41509fa6b877c0563748f1336
2016-04-28clang-tidy modernize-loop-convert in h-l/*Noel Grandin
Change-Id: I843528327b25d18476f8959cabba16371213a48a Reviewed-on: https://gerrit.libreoffice.org/24460 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann
Change-Id: I3f7f71f05db09219f0de3ec14bdb56bd16fb0c8d
2015-11-27Adding native number support for Cyrillic numeralsAleksandr Andreev
Change-Id: I054786a97b6f0e6ba3fe3b824ff9ff9748d8be4a Reviewed-on: https://gerrit.libreoffice.org/20013 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-11-17Don't assume sal_Unicode is unsigned shortStephan Bergmann
Change-Id: I727951614587654c11af5f6635a45c52ebec1b5a
2015-11-16use initialiser list for Sequence<OUString>Noel Grandin
Change-Id: Ia5e47261d1fc6fac2d046656c05a1c5eedb07e02 Reviewed-on: https://gerrit.libreoffice.org/19978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I7af8d14bfe7337fea3f18dbbd41eb32e0f7ae331
2015-11-02tdf#94269: Replace "n" prefix for bool variables with "b"Benjamin Ni
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-10-19com::sun::star->css in i18npoolNoel Grandin
Change-Id: I13a290cba0f38c79eb2d93148b972d3d931c3862 Reviewed-on: https://gerrit.libreoffice.org/19445 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-08-31loplugin:stringconstant: OUStringBuffer: appendAscii -> appendStephan Bergmann
Change-Id: Iff961fccfa7b60e788b538569bb724e806e99408
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-20Some more loplugin:cstylecast: i18npoolStephan Bergmann
Change-Id: Idbb928b2898bc6b2b5bfe3bdbfde0b81d68e4473
2014-12-12i18npool: Use appropriate OUString functions on string constantsStephan Bergmann
Change-Id: I82fea345a05c0327af3b75ccfd3358f54523c082
2014-09-26coverity#1241051 Negative array index readCaolán McNamara
Change-Id: I958267c88f74523a5aaba0ff6c677aadd2e84dd9
2014-09-26coverity#1241117 Negative array index readCaolán McNamara
Change-Id: I15787a4a2b964de3b12586c823be48c0289fea0f
2014-09-26coverity#1241372 Negative array index readCaolán McNamara
Change-Id: I73bae29c6cc737d341381c010face6b587b31598
2014-09-11Avoid name clash with generated C++ class corresponding to UNOIDL serviceStephan Bergmann
Change-Id: I96582bf05787a30479d324ff8deb7cea758bb2c2
2014-05-10Blind fix for red TinderboxesJulien Nabet
Change-Id: I9465943a7e3c0d485e8692e3e1ea0b258d67d120
2014-05-09'!= false' is redundant, and confusing - kill it.Jan Holesovsky
Change-Id: I1a52b9ce7b590e8cf274a2daaa1c55cfc1efe48b
2014-04-23i18npool: sal_Bool->boolNoel Grandin
Change-Id: Id73ee64dbf8586743f0e436e004e663a65d4548f
2014-04-17Avoid possible memory leaks in case of exceptionsTakeshi Abe
Change-Id: Ibadadacbe09a93e7d7a7210868c52a8fa582d427
2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-01-27i18npool: Ctor feature for another services.Matúš Kukan
Change-Id: Id2346686ac2f6c537825d70cac1a537d09e351d5
2013-12-18fdo#54938: Convert i18npool to use cppu::supportsServiceMarcos Paulo de Souza
Change-Id: I9acc496cd95c8362972fa0c41d35b77fc0715aba Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2013-11-11convert OUString compareToAscii == 0 to equalsAsciiNoel Grandin
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
2013-10-29cppcheck: Array index is used before limits checkJulien Nabet
Change-Id: I51f7408a81a10e2c586cb05b863f20b13bb7b263