summaryrefslogtreecommitdiff
path: root/l10ntools
AgeCommit message (Collapse)Author
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-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>
2018-11-23remove unused enums in reportdesign,linguistic,l10ntools,vcl,svxNoel Grandin
Change-Id: I3ae854f9fed485be915ded5bc4d7e93f5db23dc6 Reviewed-on: https://gerrit.libreoffice.org/63891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-18cppcheck: fix returnDanglingLifetime (l10ntools)Julien Nabet
Change-Id: Ia3c094ee65be3f5048df6896a4a6428bdd8fed10 Reviewed-on: https://gerrit.libreoffice.org/63527 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-17pocheck: don't throw away Plural-Forms headerChristian Lohmaier
also don't change POT creation date when rewriting a po file, update Po-Revision instead. When creating templates, put X-Accelerator before X-Generator (like pootle would order it) Change-Id: I7fec4cb1c50e27b87decd9a892de3f01a02253ed Reviewed-on: https://gerrit.libreoffice.org/63416 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-11-17localize: sort directories to have predictable sorting in pot filesChristian Lohmaier
also remove pre-onegit special handling Change-Id: Ie60be508a188e00b9eea1b743ea10f1f985c459e Reviewed-on: https://gerrit.libreoffice.org/63288 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-11-06loplugin:collapseif in dbaccess..lotuswordproNoel Grandin
Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662 Reviewed-on: https://gerrit.libreoffice.org/62934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-31loplugin:useuniqueptr in l10ntoolsNoel Grandin
Change-Id: Ib8dafdb2b3831cdd9481fd19b340ac377c8dc9db Reviewed-on: https://gerrit.libreoffice.org/62649 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-27pocheck: don't choke on plural formsChristian Lohmaier
Change-Id: I51a82ce5fc09d44ebc6f7c06c67b475ee2adf68b Reviewed-on: https://gerrit.libreoffice.org/62419 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2018-10-23clang-tidy performance-unnecessary-copy-init in idl..reportdesignNoel Grandin
Change-Id: I4b2eda375bbfe1ba35a45168515d885935adcb76 Reviewed-on: https://gerrit.libreoffice.org/62217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22add Lower Serbian (dsb) language packChristian Lohmaier
Change-Id: Ibafa81b412036e98fa9ab047fc8e204660eae120
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18loplugin:staticvar in hwpfilter..salNoel Grandin
Change-Id: I8bf3509637cb295847e0dd667c1862269a192bbe Reviewed-on: https://gerrit.libreoffice.org/61881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08l10ntools: remove unused srclexAndras Timar
Change-Id: I464309a2409485b34bd9662372bedd897b41e474 Reviewed-on: https://gerrit.libreoffice.org/61490 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-10-01fix of extension description l10nAndras Timar
Change-Id: Ica102309627fade2a064ee5516e84801affe4082 Reviewed-on: https://gerrit.libreoffice.org/61184 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-30pocheck: tdf#119080 update po checker tool for post LO 6.0 po filesAndras Timar
Change-Id: I700eaa0d412fb609fdc89ca07003534e6bb13854
2018-09-30pocheck: we need to access msgctxt of a PO entryAndras Timar
Change-Id: I43978811056692623344239d2c6e4763fa7de16b Reviewed-on: https://gerrit.libreoffice.org/61165 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-09-30pocheck: PO entries can have multiple source code reference lines since LO 6.0Andras Timar
Change-Id: Icbe0dd5e63eb5b10d162f34347ab86dde547dc62 Reviewed-on: https://gerrit.libreoffice.org/61164 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-09-30pocheck: do not change msgctxt when po is regeneratedAndras Timar
Change-Id: I220fce194813f783c807c23eeffd2421cadd7636 Reviewed-on: https://gerrit.libreoffice.org/61163 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-09-30pocheck: handle the '#, c-format' flagAndras Timar
Change-Id: I7d1d344e79e0c23886a21032d2ce85e5abb199cb Reviewed-on: https://gerrit.libreoffice.org/61162 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-09-30pocheck: stop further processing, if input file cannot be openedAndras Timar
Change-Id: Ida6a13e112871ab6864ae2a32a33a15a591154c2 Reviewed-on: https://gerrit.libreoffice.org/61161 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2018-09-30pocheck: fix usage messageAndras Timar
pocheck needs environment variables that bin/run does not provide Change-Id: I0de148363d60c515d4024cd0e97d1025ce50b6a5 Reviewed-on: https://gerrit.libreoffice.org/61160 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
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-09-09loplugin:simplifyconstruct in l10ntools..packageNoel Grandin
Change-Id: I8dba8ef1e7455af1e55bbd6086b49c0606bf4927 Reviewed-on: https://gerrit.libreoffice.org/60212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-09Revert "clang-tidy performance-move-const-arg"Noel Grandin
This reverts commit 3d604d1cd6cc70ef96782ef769f0479b509987a8. comments from sberg: I assume dropping the std::move from aCurSel(std::move(aSel)) is caused by performance-move-const-arg's warning "if std::move() is called with an argument of a trivially-copyable type" (<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>). For my taste, that approach is too tightly tied to a class's current implementation details, something that may change over time. Imagine a trivially copyable class C with a raw pointer member (where the lifecycle of the pointed-to object is tracked by some higher-level, likely broken protocol). Now, that protocol is fixed and the raw pointer member is replaced with a std::shared_ptr. C is no longer trivially copyable, and the dropped std::move would turn out to be beneficial again. (Also, if Clang and clang-tidy did implement the fixed rules for trivially copyable classes from CWG1734/C++17, where a subset of a trivially copyable class's copy/move members may be deleted, the above rule to warn "if std::move() is called with an argument of a trivially-copyable type" would no longer make sense as written; consider a trivially copyable class whose copy ctor has been deleted.) Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9 Reviewed-on: https://gerrit.libreoffice.org/60166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-move-const-argNoel Grandin
Change-Id: I607891e120688b746c8a4c577018d97147a79217 Reviewed-on: https://gerrit.libreoffice.org/60029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-05loplugin:useuniqueptr in l10ntoolsNoel Grandin
Change-Id: I8aaab2f3055bd0856926803ee7f71107b7cb1851 Reviewed-on: https://gerrit.libreoffice.org/59994 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from l10ntools to reportdesign Change-Id: Ia2dc93dd848c2dc0b6a8cb6e19849c614ec55198 Reviewed-on: https://gerrit.libreoffice.org/58205 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>