summaryrefslogtreecommitdiff
path: root/svl/qa
AgeCommit message (Collapse)Author
2019-06-21Drop INetURLObject::GetName and INetURLObject::GetExtensionMike Kaganski
They are just synonyms for GetLastName and GetFileExtension resp. Change-Id: Ic498c7025cc421b830394ed94d64529fd74fe7dd Reviewed-on: https://gerrit.libreoffice.org/74448 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-07tdf#42949 Fix IWYU warnings in svl/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Except source/svdde/* which is WIN-specific Also recheck include/svl Change-Id: I32d3bcb6b14665c56c07a2f10526329b08c64cbe Reviewed-on: https://gerrit.libreoffice.org/73630 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-27@deprecated should be with @DeprecatedTomoyuki Kubota
Without this patch, warnings will be given when LibreOffice is built with JDK9 or later. Change-Id: I7aa6e99ace2377fbdb7dd732949ce10d9bd9df58 Reviewed-on: https://gerrit.libreoffice.org/72947 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-20flatten SfxItemPool_Impl (tdf#81765 related)Noel Grandin
Flatten the vector of SfxPoolItemArray_Impl, to reduce pointer chasing. This struct is movable, etc, so no need to allocate it separately on the heap. Change-Id: I794b4356660e9cd0e63bc98b011f58162a838662 Reviewed-on: https://gerrit.libreoffice.org/70884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-20simplify SfxPoolItemArray_Impl (tdf#81765 related)Noel Grandin
Since we want to look up items by pointer, just store them in a std::unordered_set, which allows fast find(). This dramatically simplifies most operations on this data structure. Fix a dodgy sd test that was relying on items with the same whichid being in the pool being in a certain order. Change-Id: I4d79fc718f95e3083a20788be1050fbe9fca7263 Reviewed-on: https://gerrit.libreoffice.org/70881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03svl.lockfiles.test: Create the temporary lock files in workdirTamás Zolnai
Change-Id: I98b03754259c296ec8b4de2dddf6aee611bfe68a Reviewed-on: https://gerrit.libreoffice.org/70209 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-26Generate MSO lock files when the related MSO compat. option is setTamás Zolnai
Added a new compatibility option to the Tools -> Load / Save -> Microsoft. When this option is set on the UI or or set in the configuration files LO generates lock files for MSO supported file formats, similar to the lock files MSO generates itself. Change-Id: I2f882723841162add01be9d3f7285a5162a60331 Reviewed-on: https://gerrit.libreoffice.org/69678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-23Introduce new lockfile handler for MSO like lockfilesTamás Zolnai
* Implement writing of MSO lockfiles * Grab the already implemented parsing code (tryMSOwnerFile method) and put it together into one class * Add tests about the generated URL for lockfiles and the lockfile content * MSO lockfiles are not written yet by LO, next step is to integrate this code into the locking mechanism. Change-Id: I3b0ed1975cd57dfd006d4e1890b23c307890de5c Reviewed-on: https://gerrit.libreoffice.org/69582 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-20sw: make ODT export of paragraph auto-styles deterministicMiklos Vajna
If a complex enough document is loaded into Writer and saved as ODT, then the content.xml's automatic paragraph styles (P<num>) are re-ordered on each save, which leads to unnecessary noise. The actual random order is created during import by the time we convert direct formatting (e.g. from HTML import) to autostyles, as StylePoolImpl::maRoot stores autostyles in a map that orders autostyle parents based on their pointer address. This has benefits like automatic ordering of item sets and fast comparison, so don't change that, but extend the svl API to also track the name of those parents. This way by the time StylePool::createIterator() would iterate over those autostyles, it can order the parents by their name, so two import->export runs will result in the same autostyle ordering. (This appears to be the only indeterminism in content.xml for a test HTML input, while meta.xml and settings.xml still changes all the time.) Change-Id: I1cfcae2c664a5c5c3dee48be733046979c1593ed Reviewed-on: https://gerrit.libreoffice.org/69469 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-02-10loplugin:indentation in soltools..svlNoel Grandin
Change-Id: I270a12cdb68920b8fa23b82dd933724e30334485 Reviewed-on: https://gerrit.libreoffice.org/67565 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-05Move dubious file: -> smb: conversion from INetURLObject to file UCPStephan Bergmann
The Linux-only conversion of file URLs with a non-empty (other than "localhost") authority to smb URLs had been added in 2010 with 0b9ef81ba5ff08d85f21275222458a5b9b9e484c "tools-urlobj-smb-scheme-patch.diff: migrated" (applying a Go-oo patch?) but giving no rationale beyond "process relative SMB paths (in hyperlinks) correctly". That makes it hard to tell whether that patch is (still) actively useful for anything, or was just a misguided hack from the beginning: * Why make this Linux only? What about other non-Windows OSs? (On Windows, such URLs can be resolved as UNC pathnames.) If the reason for Linux-only was that it is the only OS where LO can handle smb URLs via GIO, why not make it conditional on ENABLE_GIO? * Why map to smb? There are various remote file access protocols. Hardcoding smb looks arbitrary here. Anyway, INetURLObject is arguably at a wrong level for such a patch. To not drop the hack wholesale, reimplement it in the file UCP, forwarding to a potential other UCP that can handle smb URLs any file://<host>/... URLs (rewritten as smb URLs) that the file UCP cannot handle itself. (file://localhost/... URLs will already have been normalized to file:///... by INetURLObject when they reach the file UCP, and even if they were not, the osl/file.hxx functionality underlying fileaccess::TaskManager::getUnqFromUrl knows how to handle them, so they will not take the forward-to-smb code branch.) (The corresponding #ifdef WIN code from 0b9ef81ba5ff08d85f21275222458a5b9b9e484c has already been removed with 82034b04e81b74a048595b0eac0f73581ecbc9e4 "tdf#119326 crash when adding "Windows Share" File resource".) (I came across that 2010 patch while looking into <https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support 'file://' scheme with actual hostname". A next step would be to make the file UCP actually handle any file://<host>/... URLs that denote the local host.) Change-Id: I77242705dc4c6c1e9cb3a4f32253224ac6cb13cb Reviewed-on: https://gerrit.libreoffice.org/67372 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-14tdf#42949 Fix IWYU warnings in include/svl/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ide75232858599c275e023c2300201090acd22307 Reviewed-on: https://gerrit.libreoffice.org/63237 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22loplugin:staticvar in soltools..svxNoel Grandin
Change-Id: Ie9f36eb0e00aaee34a27f136ed903f8f87e52dcc Reviewed-on: https://gerrit.libreoffice.org/61916 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08loplugin:constfields in svlNoel Grandin
Change-Id: I18183c5c257cbe69bd067d4e74c50483ae683cf3 Reviewed-on: https://gerrit.libreoffice.org/61509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-06Unit test for de-* Januar/Jänner, tdf#114927Eike Rathke
Change-Id: I8f0f3b88e172e93caca4de6d8000cb20c5af8333 Reviewed-on: https://gerrit.libreoffice.org/61428 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-10-05OUString::fromUtf8() instead of createFromAscii()Eike Rathke
So we can use UTF-8 input to test. Change-Id: Ie56d43226c8cc8a5bf10317961fa0a91d8acfcf0
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