summaryrefslogtreecommitdiff
path: root/l10ntools/source
AgeCommit message (Collapse)Author
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: l10ntoolsStephan Bergmann
Change-Id: I9b97f64f27dee5fe0c17ceaf93f7d137141be249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97600 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-24add Central Kurdish (ckb) language packChristian Lohmaier
Change-Id: I007edc0e339bd9cfd8caf95ecc954628d450664f
2020-06-15Don't return too early, clean vars first (l10ntools/treemerge)Julien Nabet
Change-Id: Ib99e0897fa36bdd0c8d805e38e77c3d626c0569a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-10Use xmlFreeDoc since pXhpFile is a xmlDocPtr (l10ntools/treemerge)Julien Nabet
Change-Id: I32fb8824aa91464d2198c76ba9357c82ec87a0ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15loplugin:buriedassign in l,o,p*Noel Grandin
Change-Id: Ib2dd157d43c4387eda009475311761fe2eb627cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92241 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-07loplugin:flatten in l10ntoolsNoel Grandin
Change-Id: Ib1f698eddea1da2a6e06e17d1c4fec9ef717e132 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03avoid flex-caused warnings about unused functionsLuboš Luňák
Change-Id: If6a028efbf2403fd92dcab914ae3197d34579392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87869 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-12-19sal_Char->char in idlc..linguisticNoel Grandin
Change-Id: Ib30fe34123ad7e5d892e8db9c742e08c4ca8fcd2 Reviewed-on: https://gerrit.libreoffice.org/85477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-03remove some useless comment linesNoel Grandin
which merely announce that the next declaration is a class Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc Reviewed-on: https://gerrit.libreoffice.org/84229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-17Extend loplugin:external to warn about enumsStephan Bergmann
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-03loplugin:stringaddNoel Grandin
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-02pocheck: also preserve header in check for function namesChristian Lohmaier
Change-Id: I53b67e8c690b110d2d77e100b8170ac968e35e2b
2019-10-01loplugin:stringadd in helpcompiler..ooxNoel Grandin
Change-Id: I858870d883de10a673d7ce2798bda8c8f511cee5 Reviewed-on: https://gerrit.libreoffice.org/79889 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27add Silesian (szl) language packChristian Lohmaier
Change-Id: I47d9659fc21abec652a5a440004c0c2d27ec3b53
2019-08-23Mark move ctors/assignments noexceptMike Kaganski
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-08-01new loplugin:mapindexNoel Grandin
Change-Id: I6b5f73b2187009e95d4d666e03e5803f522cee06 Reviewed-on: https://gerrit.libreoffice.org/76584 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): l10ntoolsStephan Bergmann
Change-Id: I98476e17e0ab6009d822205c7b31935173da2722 Reviewed-on: https://gerrit.libreoffice.org/76666 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-09tdf#126030 Translate automatic chart title in OOXML chartsGabor Kelemen
Add l10n support to oox module to achieve this Change-Id: I7bece62bdf5ef0f0d1ef424074f16cef94649d77 Reviewed-on: https://gerrit.libreoffice.org/74819 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-07-04cid#1448320: Resource leak in object (l10ntools/treemerge)Julien Nabet
Change-Id: I9d09d690e003d73878ef2e30da11cf079d0db441 Reviewed-on: https://gerrit.libreoffice.org/75098 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-27Ditch "using namespace U_ICU_NAMESPACE;", qualify icu:: insteadEike Rathke
geez.. for two places.. Change-Id: I4855fc92290547b0e1ca6ff5b2f10a333c6caa3f Reviewed-on: https://gerrit.libreoffice.org/74815 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-29Related: tdf#82184 correct wrong or obsoleted LCIDs for MSIEike Rathke
This solves the cases of Oromo, Kinyarwanda and Sinhala. Kabyle is a problem on its own and apparently not easily solvable, see attempts in https://gerrit.libreoffice.org/71247 Change-Id: Id001aeba07a95f283b4cd6057c1f6e8088de940a Reviewed-on: https://gerrit.libreoffice.org/71535 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-04-24tdf#124791: Fix Gaelic (Scotland) (gd-GB) LCID in MSI installerMike Kaganski
... which was obviously omitted in commit 6b678c135da07f34da1bf7b19562366361e95085, which introduced the correct value of 0x0491 (1169) in addition to the pre-existing 0x043C (1084). The new value is used when user sets relevant entry in Region and Language control panel applet (intl.cpl); having the old value in MSI summary information blocks auto-detection of proper installer language. [MS-LCID] Appendix A mentions that the new code is available since Win7, so we are good with the fix. [MS-LCID] https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c Co-authored-by: Eike Rathke <erack@redhat.com> Change-Id: Ic03b0e8eaf145c662fde48846cd5307e362d4d63 Reviewed-on: https://gerrit.libreoffice.org/71242 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-13loplugin:sequentialassign in embeddedobj..l10ntoolsNoel Grandin
Change-Id: I69377e2f96a376a7a5ccaec268c4f92c00a250f7 Reviewed-on: https://gerrit.libreoffice.org/70705 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03Revert "add more append methods to *StringBuffer"Noel Grandin
This reverts commit 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73. comment from sberg: we already have 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 "Replace OUStringBuffer::appendCopy with append(std::u16string_view)" (which can be extended to OStringBuffer if needed) Change-Id: Ifcc550a8cf26ef38ad49fde8b067f53c999c9276 Reviewed-on: https://gerrit.libreoffice.org/70178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-03add more append methods to *StringBufferNoel Grandin
which performs the append without needing the creation of a temporary *String Change-Id: If9ad3222275f26659db2e7df8d34f068977c4d17 Reviewed-on: https://gerrit.libreoffice.org/69826 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-20Reduce OString operationsMatteo Casalin
Change-Id: I13291ca27574d3536e55d8207a0b13b2694385be Reviewed-on: https://gerrit.libreoffice.org/69233 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-18Remove broken MergeDataHashMap optimizationStephan Bergmann
...which apparently didn't take into account that inserting into a std::unordered_map may invalidate iterators, which now started to cause build failures like > [PRP] dictionaries/hu_HU/dialog/hu_HU_de > warn:sal.osl:25175:25175:sal/osl/unx/thread.cxx:1026: RTL_TEXTENCODING_DONTKNOW -> _ASCII_US > .../gcc/trunk/inst/include/c++/9.0.1/debug/safe_iterator.h:307: > In function: > __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::pointer > __gnu_debug::_Safe_iterator<_Iterator, _Sequence, > _Category>::operator->() const [with _Iterator = > std::__detail::_Node_iterator<std::pair<const rtl::OString, > std::unique_ptr<MergeData> >, false, true>; _Sequence = > std::__debug::unordered_map<rtl::OString, std::unique_ptr<MergeData> >; > _Category = std::forward_iterator_tag; > __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::pointer = > std::pair<const rtl::OString, std::unique_ptr<MergeData> >*] > > Error: attempt to dereference a singular iterator. > > Objects involved in the operation: > iterator "this" @ 0x0x5a8228 { > type = std::__detail::_Node_iterator<std::pair<rtl::OString const, std::unique_ptr<MergeData, std::default_delete<MergeData> > >, false, true> (mutable iterator); > state = singular; > references sequence with type 'std::__debug::unordered_map<rtl::OString, std::unique_ptr<MergeData, std::default_delete<MergeData> >, std::hash<rtl::OString>, std::equal_to<rtl::OString>, std::allocator<std::pair<rtl::OString const, std::unique_ptr<MergeData, std::default_delete<MergeData> > > > >' @ 0x0x5a81c8 > } > /bin/sh: line 1: 25175 Aborted (core dumped) LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" $W/LinkTarget/Executable/propex -i $S/dictionaries/hu_HU/dialog/hu_HU_en_US.properties -l de -m ${MERGEINPUT} -o $W/PropertiesTranslateTarget/dictionaries/hu_HU/dialog/hu_HU_de.properties > make[1]: *** [.../solenv/gbuild/Dictionary.mk:88: .../workdir/PropertiesTranslateTarget/dictionaries/hu_HU/dialog/hu_HU_de.properties] Error 134 with trunk libstdc++ in debug mode. Both classes MergeData and MergeDataHashMap became redundant. Change-Id: I771548a6155e14037d84acfd74cd13566a26a8d7 Reviewed-on: https://gerrit.libreoffice.org/69395 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-14Fix TRUE to sal_True conversion in stringMatteo Casalin
This would lead to always false condition, since that text should be uppercase. Introduced in d210c6ccc30466e98240c1409df0550514668d68. Reduce parentheses while at it. Change-Id: Iec9cbbfd0a596ad1d4dcba50aa3a5c00a54ef425 Reviewed-on: https://gerrit.libreoffice.org/69234 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-05Group some more common codeMatteo Casalin
Change-Id: I2bf3e8afd9f330e8d7377300163a3224ed4db05c Reviewed-on: https://gerrit.libreoffice.org/68179 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-05Use optimized OString concatenationMatteo Casalin
Change-Id: Iaefacf4a57398d0e88b4de7552af11832db3e881 Reviewed-on: https://gerrit.libreoffice.org/68178 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-05Use optimized OString concatenationMatteo Casalin
Change-Id: I7c74e007cb382701c3d9c41f9a6fb76ff0cb19fe Reviewed-on: https://gerrit.libreoffice.org/68120 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-05Avoid unneeded OUString copyMatteo Casalin
Change-Id: I43d66f1bf4fc4a17f7dbea62e3fb13675dbbfb8a Reviewed-on: https://gerrit.libreoffice.org/68119 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
2019-03-03yyinput() returns intStephan Bergmann
Change-Id: I2e1958bff9778bab65b5c972bc9e0721a86546f5 Reviewed-on: https://gerrit.libreoffice.org/68630 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-28loplugin:unreffunStephan Bergmann
Change-Id: I983394e10e1a316fe01bd3925913e5e65f944b68 Reviewed-on: https://gerrit.libreoffice.org/68470 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-28Remove unused YYWarning functions (cargo cult?)Stephan Bergmann
Change-Id: I9cb03530150ee35bdaee4920dd2e818007a0a658 Reviewed-on: https://gerrit.libreoffice.org/68469 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-28loplugin:includeformStephan Bergmann
Change-Id: Id2c44c104a417feba152d4af43caca561f3432bf Reviewed-on: https://gerrit.libreoffice.org/68465 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-28loplugin:externvarStephan Bergmann
Change-Id: I7f09837e76a8368fd60aed1bb3a16fd0434e11ec Reviewed-on: https://gerrit.libreoffice.org/68466 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-27Untabify .l files (to silence loplugin:indentation warnings)Stephan Bergmann
Change-Id: I8368c8a1d52f6c55a8cea952b2b02345e41c1e5c Reviewed-on: https://gerrit.libreoffice.org/68448 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-27Add missing modelines to .l filesStephan Bergmann
...and change connectivity/source/parse/sqlflex.l license header from using (unusual, anyway) // comments to using /* */ comment, so that it can go before Flex's opening %{ Change-Id: I371890e937cc5055405c17226dd87ba1694688aa Reviewed-on: https://gerrit.libreoffice.org/68433 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-23loplugin:unusedfields in l10ntools..saxNoel Grandin
Change-Id: I6e4ff4853c3995072b020af54549dc81303a4fde Reviewed-on: https://gerrit.libreoffice.org/68225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-18Simplify containers iterations in [f-l]*Arkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: Ib3fab47318d1bfbb4df8f886a8cd9596525a420f Reviewed-on: https://gerrit.libreoffice.org/67914 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11new loplugin writeonlyvarsNoel Grandin
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in jvmfwk..lotuswordproNoel Grandin
Change-Id: I1af665f4c6d34d8514dd23bb7a3eba700ce3ddbc Reviewed-on: https://gerrit.libreoffice.org/67559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-28tdf#121697 XHP extensionsOlivier Hallot
This is the core part of the bug, and is WIP Extend the XML parser to include new incantations of the <paragraph> tag, namely <h1> to <h6> <note>, <tip> and <warning> Extension to the <item> tag: <menuitem>, <input>, <literal>, <widget> and <keycode> Change-Id: Idaed321cc8756fa6bcf4fbc170982365ff33d4d7 Reviewed-on: https://gerrit.libreoffice.org/63955 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>