summaryrefslogtreecommitdiff
path: root/svl/qa
AgeCommit message (Collapse)Author
2018-10-01Resolves: tdf#119613 [*-ZA] default to ISO 8601 date formatEike Rathke
This also made it necessary to adapt the unit tests that checked for the old default format in output. Change-Id: Ie7bc78d1e5a17e5cb6f52d5ed1ab42db80f07d2e Reviewed-on: https://gerrit.libreoffice.org/61200 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-31Use tools::Time::GetClock() in number formatter for wall clock timeEike Rathke
Also handle rounding/scaling better in ImpGetTimeOutput() for the [] duration formats, of which [HH]:MM:SS(.0000000) is used to edit time values. The wall clock change made it necessary to adapt some test cases in Test::testUserDefinedNumberFormats() where M_PI formatted to date+time actually is 1900-01-02 03:23:53.60527 with second 53 instead of the previously rounded 54. Change-Id: I242a6c753a24281e041d3f73af019bdd77c65b37 Reviewed-on: https://gerrit.libreoffice.org/59857 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-16Resolves: tdf#119013 do not over-aggressively reorder date particlesEike Rathke
In particular not when reading documents as we don't know what the original (default/system) locale was when the date format was created and stored and whether the format's date order actually matched the locale's ordering. Regression from commit 51478cefaa4e265b42e3f67eda0a64767ff3efba CommitDate: Tue Apr 18 17:01:27 2017 +0200 Resolves: tdf#107012 follow date order of the target locale Change-Id: I9d3bdbd512d95ed81ff6459e368a2d7497ec8a2d Reviewed-on: https://gerrit.libreoffice.org/59182 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-07SharedStringPool is always called with a CharClassNoel Grandin
Change-Id: Ib2b9963a90a135998b6189fba521bd85f5579cf5 Reviewed-on: https://gerrit.libreoffice.org/58645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24Fix typosAndrea Gelmini
Change-Id: I07cf04cd2acc5b50d64224edb9f2c2de2c61e356 Reviewed-on: https://gerrit.libreoffice.org/57884 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-06-29Improved loplugin:redundantcast (const-qualified typedefs): svlStephan Bergmann
Change-Id: Ife1db81f772ecf3bb713952be276ff8a2fd318a9 Reviewed-on: https://gerrit.libreoffice.org/56716 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-20tdf#117575 Add QA unit test of thousand sepLaurent BP
Change-Id: Id28e688e7f81a2f3f43f01be44d03c5f185ffd01 Reviewed-on: https://gerrit.libreoffice.org/55904 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-06-20NatNum12: 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. Change-Id: I5fceb784930e6bc6d376116f5a42ad49cd248a54 Reviewed-on: https://gerrit.libreoffice.org/55681 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-06-13tdf#115007 NatNum12 "spell out" formats in datesLászló Németh
to support variants of preposition, suffixation, article or their combination. For example, Catalan "de març"/"d'abril", English "1st of May"/"First of May" or Hungarian "május 1-je/május 2-a". When the date format contains more than a date keyword, it needs to specify in NatNum12 argument which date element needs special formatting by using libnumbertext: '[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=year,D=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, as required. Note 2: default l10n date formats can use the new NatNum12 date formats, 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>
2018-06-08tdf#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>
2018-06-05Add unit test for NatNum12 decimals spell-outEike Rathke
Change-Id: I31c84eb2267b4978f110a4f38cbf4d2377d59400
2018-06-01loplugin: look for CPPUNIT_ASSERT_EQUALS with params swappedNoel Grandin
idea originally from either tml or moggi, can't remember which Change-Id: Id78d75035036d3aa1666e33469c6eeb38f9e624d Reviewed-on: https://gerrit.libreoffice.org/55126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-30Add unit test for tdf#117819Eike Rathke
Change-Id: Ice57b81106d35f5b217f0680824d1acf62ff9098
2018-05-18Remove some cruftStephan Bergmann
That block of code at the top of the file started out as #include "precompiled_svl.hxx" #ifdef WNT # include <prewin.h> # include <postwin.h> # undef ERROR #endif in d2a16264ec6cb1ca5e8178096b72053a357cb3fb "Initial unit test skeleton, copied and modified from sc", so assume the leftover #undef is unnecessary cargo-cult by now. Change-Id: I39637518d1507352b1eb2ed19168013d9fe635ac Reviewed-on: https://gerrit.libreoffice.org/54499 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-18Reuse existing config_host/config_libnumbertext.h.inStephan Bergmann
Change-Id: I28d0260531132216c5f0bd187d400ed47cc43326 Reviewed-on: https://gerrit.libreoffice.org/54498 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-04-19convert SFXSTYLEBIT to scoped enumNoel Grandin
drop SFXSTYLEBIT_HIERARCHY because it has no overlap with these values, it's used an extra bit in SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter Change-Id: I8ee5ecb9b5f8d2087d8eedd1f5526260ec1e4018 Reviewed-on: https://gerrit.libreoffice.org/53089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16loplugin:useuniqueptr in SfxItemPool_ImplNoel Grandin
Change-Id: Ic3d695dd3ad4ee5ca6537f65d643d8736e3a5700 Reviewed-on: https://gerrit.libreoffice.org/52886 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-28convert COL_ constants to be of type ColorNoel Grandin
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21New loplugin:nestedunnamedStephan Bergmann
Change-Id: Ifb434589ef08428ce609bc7a40b015d4df13224c Reviewed-on: https://gerrit.libreoffice.org/50048 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-16Factor out Spanish "mar" tests to use checkSpecificNumberFormats()Eike Rathke
Change-Id: Ie2618ffeea49e45d7bd7d35238a1edbcc5887fa5
2018-02-16Prepare to add specific number format index to test againstEike Rathke
Change-Id: I1c01c9afe4a2479bd8e595b84816febe8e9e5947
2018-02-16svl: fix loplugin:staticanonymous warningMiklos Vajna
Change-Id: Ib983a8f4305dc916e077407d712883de6d05649a
2018-02-16Unit test tdf#114833 do not officiously force Y-M-D if D-M-Y is applicableEike Rathke
Change-Id: I2c78a06169526b079fd1463df23b09bacb50588b
2018-02-16ofz#6311 still problems with SdrEdgeObj listening to same obj at start as endCaolán McNamara
Change-Id: Ibd80b484788779b73943b28a5f36e51ebcacec30 Reviewed-on: https://gerrit.libreoffice.org/49821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-12More loplugin:cstylecast: svlStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I71e3b2c9b4c68183288f43999d242e95ae13584d
2017-12-19wrap scoped enum around css::util::NumberFormatNoel Grandin
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa Reviewed-on: https://gerrit.libreoffice.org/46339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-14Also EnglishKeywords is a NfKeywordTable, not just some vectorEike Rathke
Change-Id: I0683fe5f7632e9941f347773c2679af82421bdc4 Reviewed-on: https://gerrit.libreoffice.org/46455 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-12-14Naming nitpicks, r... for referenceEike Rathke
Change-Id: I1d169590302067fdcb3fe8ecc1cf5dea8f766a02
2017-12-14Move GetKeywords() and related from SvNumberformat to SvNumberFormatterEike Rathke
... as especially the keywords are controlled by the current state (locale) of the ImpSvNumberformatScan instance and *not* a property of SvNumberformat. Add a clarifying descriptive comment as well, and outline it's only for the unit tests anyway.. Change-Id: I732918026bf9ffc25db11033d5f10bc2f51e3505 Reviewed-on: https://gerrit.libreoffice.org/46426 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-12-13Blind fix for ambiguous CPPUNIT_ASSERT_EQUALStephan Bergmann
Change-Id: Ia0730cfd2293c374ec8b8f4aa69fef5d319642e4
2017-12-13Unit test testUserDefinedNumberFormats()Eike Rathke
Change-Id: Ic908af0bf5cbd83fab7bbf2d2f37a1b51bc5e32a
2017-11-01QA test of StandardColorLaurent BP
Change-Id: Ib5b414d533ea3dcce55f4e6a02f329e98acf6e83 Reviewed-on: https://gerrit.libreoffice.org/43791 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-10-23loplugin:includeform: svlStephan Bergmann
Change-Id: I769b091515d1e6b7d16652d11ff2b94a75584ad0
2017-10-23tdf#33689 Add QA unit testLaurent BP
Test of English NfKeywords with non-English languages These tests need https://gerrit.libreoffice.org/43633/ to pass for Finnish Change-Id: I5e6c3250e6136eeb2e8e25e1f411390e109d5b7e Reviewed-on: https://gerrit.libreoffice.org/43634 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-10-23tdf#33689 QA Check integrity of sEnglishKeywordLaurent BP
Check the number of elements Check equivalence with sKeyword Check if the order of elements in the sEnglishKeyword vector matches the order defined in NfKeywordTable, so if someone adds/(re)moves/inserts an element both table and vector stay aligned. Change-Id: I97b530b1c7ee262c7884f51e2562eace9f13d8f8 Reviewed-on: https://gerrit.libreoffice.org/43690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-10-17More tests for time and date+time fractions of seconds, tdf#112933 relatedEike Rathke
Covering the loop and non-loop states in ImpSvNumberformatScan::FinalScan() Change-Id: I4a8da617a2a61ad12a99462bfe4014aaa5a75c1b
2017-10-16Unit test for tdf#112933Eike Rathke
Change-Id: I0988401a9aa7afc25ea3a50883e4d3a5cfbe9d44
2017-10-02Add unit tests for ISO 8601 date+time inputEike Rathke
Change-Id: Iab53f39313c1bac04fe5718823455e5ef0e52f13
2017-08-30Unit tests for tdf#91758Eike Rathke
Change-Id: I4015a339ca18b214adca228b58319d897f0ad910
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17Clean up uses of OUString::fromUtf8 around string literalsStephan Bergmann
Change-Id: I9a2990e49c95a01ce505f13408be8c19db1cf5d1
2017-07-31loplugin:oncevarNoel Grandin
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in i18npool,opencl,svlNoel Grandin
Change-Id: I23368c3ce6d29c7b2e758e209e5a8315e82a2818 Reviewed-on: https://gerrit.libreoffice.org/40051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-02loplugin:casttovoid: svlStephan Bergmann
Change-Id: Iec49ad76f102dc228d41beb10d7e99ed197c0ea8
2017-06-27loplugin:oncevar in starmath..svlNoel Grandin
Change-Id: I20e3796407c7e429a88d2811673929ac1141a41c Reviewed-on: https://gerrit.libreoffice.org/39280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: svlStephan Bergmann
Change-Id: Iaa5b97267b6487c37744bd08d21c82015da9d522
2017-04-26use strong_int for LanguageTypeNoel Grandin
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448 Reviewed-on: https://gerrit.libreoffice.org/36629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-10tdf#106190 Tests of fraction formatsLaurent Balland-Poirier
Improve error message if test fails Add more formats to test Need https://gerrit.libreoffice.org/35320/ Change-Id: I89f5071e12ff87cdf1c03912922918390531e972 Reviewed-on: https://gerrit.libreoffice.org/35377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>