summaryrefslogtreecommitdiff
path: root/helpcompiler
AgeCommit message (Collapse)AuthorFilesLines
2019-11-03make some classes module-privateNoel Grandin1-2/+2
improve the script, but it still generates some false positives Change-Id: If8ee1cba8c04ac0be11f73220149e6de15f24f44 Reviewed-on: https://gerrit.libreoffice.org/81929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann1-1/+1
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-11simplify "a = a +" to "a +="Noel Grandin1-1/+1
mostly so that my stringadd loplugin can point out places to improve Change-Id: I9920ee1c99cdb6b811ba67ff9d8e32aa261884b5 Reviewed-on: https://gerrit.libreoffice.org/80618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:stringadd in helpcompiler..ooxNoel Grandin1-4/+2
Change-Id: I858870d883de10a673d7ce2798bda8c8f511cee5 Reviewed-on: https://gerrit.libreoffice.org/79889 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19cid#1448495 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I8a7f347d8f3ff6195b10e5559ff0682734c54eaf Reviewed-on: https://gerrit.libreoffice.org/75900 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19cid#1448441 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I97f6ad2bd0a6d838871cfb9ff54f2e654d6abfd0 Reviewed-on: https://gerrit.libreoffice.org/75893 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-18cid#703974 Unchecked return valueCaolán McNamara1-1/+1
Change-Id: I833175e7687df88719d4d946cf97181158187c67 Reviewed-on: https://gerrit.libreoffice.org/75840 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-30tdf#42949 Fix IWYU warnings in helpcompiler/Gabor Kelemen11-37/+36
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie7e20c77a8035c0ee4f0316966d163b9cd7d11f2 Reviewed-on: https://gerrit.libreoffice.org/73006 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-22New loplugin:dataStephan Bergmann2-3/+3
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-07std::string has a std::hash specialisation since C++11Noel Grandin2-26/+3
Change-Id: I8cc01420d0235a8d1686881eca1ad9cc4a67ebe0 Reviewed-on: https://gerrit.libreoffice.org/70362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-24loplugin:unusedfields in helpcompiler..jvmfwkNoel Grandin2-2/+0
Change-Id: Ic10c521de310e0f0ac1f79a1ae169252c20075b2 Reviewed-on: https://gerrit.libreoffice.org/68226 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-18use clear() instead of erase(begin, end)Noel Grandin1-1/+1
Change-Id: Ie1dcff4c2e5f52521b4172ef5726413a9d048214 Reviewed-on: https://gerrit.libreoffice.org/67961 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in helpcompiler..ioNoel Grandin1-6/+5
Change-Id: Ia3f05662cc9542feeac3096d29e9dec6d1858620 Reviewed-on: https://gerrit.libreoffice.org/67558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin1-2/+2
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-21improve function-local statics in forms..reportdesignNoel Grandin1-7/+1
Change-Id: I285e2e75c8d9cad35445c89f00ef68b155806ea2 Reviewed-on: https://gerrit.libreoffice.org/63703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-23clang-tidy performance-unnecessary-copy-init in editeng..i18npoolNoel Grandin1-2/+1
Change-Id: I2ee2c8d15d8700cfaa1697363da4557c741a5f36 Reviewed-on: https://gerrit.libreoffice.org/62216 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann2-4/+8
...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 helpcompiler..ioNoel Grandin1-1/+0
Change-Id: Ibdc1933b5d8d6be1fe42a7df93bd7e1c903bb39b Reviewed-on: https://gerrit.libreoffice.org/60202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen2-1/+3
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 filter to jvmfwk Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5 Reviewed-on: https://gerrit.libreoffice.org/58204 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-27loplugin:returnconstant in helpcompilerNoel Grandin4-17/+4
and fix scanForFiles to return false on error Change-Id: I246e906de9985947be421d361340874c94a2102d Reviewed-on: https://gerrit.libreoffice.org/58085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27helpcompiler: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann1-1/+0
...by removing explicitly user-provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non-deleted in the future Change-Id: I61182be57a0ed9071e3559a6445aee98ec5c19bf Reviewed-on: https://gerrit.libreoffice.org/58057 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-13Don't create std::string from nullptrStephan Bergmann1-2/+10
...which violates the ctor's preconditions, so is UB. Also, the "XML Help Document Type Definition" appendix of <http://documentation.openoffice.org/online_help/OOo2HelpAuthoring.pdf> states that "branch" and "id" attributes are #REQUIRED for the "bookmark" element. (There's probably further cases in the surrounding code where a std::string is created from a potentially null argument, which would benefit from similar fixes.) Change-Id: I414576d13de784de1290951bcdd5e3ecb51f9cb8 Reviewed-on: https://gerrit.libreoffice.org/55735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-11tdf#96099 Remove some trivial std::vector typedefsArkadiy Illarionov4-7/+6
Change-Id: I0e60ec7a3edae42b25ff0917828d0a893ed39a38 Reviewed-on: https://gerrit.libreoffice.org/55245 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07tdf#96099 Remove std::vector typedefsAbhyudaya Sharma1-1/+0
Change-Id: Ic7e1cecaecadf3f9ebfa183727d61046dd87e473 Reviewed-on: https://gerrit.libreoffice.org/55260 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-04-16loplugin:useuniqueptr in StreamTableNoel Grandin3-13/+13
Change-Id: I6a6314a3e6df9edfb6d92d2afbc1567195946292 Reviewed-on: https://gerrit.libreoffice.org/52885 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-18Use for-range loops in helpcompilerJulien Nabet4-43/+29
Change-Id: I787a5b43cb09ac308082cac0e66540f975d79ead Reviewed-on: https://gerrit.libreoffice.org/51473 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-02-01helpcompiler: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski1-9/+0
Change-Id: I56298ee1962a4989bcc5446df2766d7aa30c28cd Reviewed-on: https://gerrit.libreoffice.org/48980 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-15loplugin:useuniqueptr in BasicCodeTaggerNoel Grandin2-6/+3
Change-Id: I85b7d5b3030d4b3ec5318e4ee6793927c1f16355 Reviewed-on: https://gerrit.libreoffice.org/47835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-26Replace lists by vector and deque (helpcompiler)Julien Nabet3-8/+7
Change-Id: I8d65947f3188ab7b54653eee887de2c5d4f8095d Reviewed-on: https://gerrit.libreoffice.org/45290 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-30loplugin:constmethod in idl,helpcompilerNoel Grandin3-3/+3
Change-Id: I9b328fc0a3ebdd15a646ee6dab800ffbadb1aaef Reviewed-on: https://gerrit.libreoffice.org/44050 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: helpcompilerStephan Bergmann1-1/+1
Change-Id: I8902e3f567d275d074fd6b33e4935cf41caca838
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski2-2/+4
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-03Replace more reinterpret_cast with SAL_W/SAL_UMike Kaganski2-38/+18
Change-Id: Ia632e4083222ad9e7f17c2ad0d0825f189c700cc Reviewed-on: https://gerrit.libreoffice.org/43071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-06cppcheck: unreadVariableJochen Nitschke1-4/+0
since initial commit d6cf80c14ef6abe02125bb8f66262961193cffd7 CWS-TOOLING: integrate CWS l10nframework01 Change-Id: I3d9761911c535965795b10b3ae96da3e7b51f23d Reviewed-on: https://gerrit.libreoffice.org/40808 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in vclNoel Grandin2-3/+3
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4 Reviewed-on: https://gerrit.libreoffice.org/40116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-02loplugin:casttovoid: helpcompilerStephan Bergmann1-4/+1
Change-Id: Ifd37b99b27d1bf25109c83a054b36c1da3825d84
2017-06-25loplugin:oncevar in helpcompiler..jvmfwkNoel Grandin2-3/+2
Change-Id: Ia9b20a8ca95684cbeb21e3425972c43ba50df3cd Reviewed-on: https://gerrit.libreoffice.org/39187 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-08remove some unnecessary use of OUStringBufferNoel Grandin1-2/+1
Change-Id: Ia4e02589d2fe79a27b83200a0e7a528a2c806519 Reviewed-on: https://gerrit.libreoffice.org/38508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28remove unnecessary use of OString::getStrNoel Grandin1-1/+1
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-26Make helpcompiler more verbose on dot ahelpsGabor Kelemen1-1/+1
Currently we get a warning if the ahelp is one dot and there was no previous bookmark tag. This warning contains only the text with the problemmatic ahelp. It would make it easier to hunt down such problems if we would know the file names. This patch does that, and now I see 334 problems in 137 files. Change-Id: I364368f7affb85d5c5d526dd4674757c51956aea Reviewed-on: https://gerrit.libreoffice.org/38044 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2017-05-09Clean up uses of SAL_U/SAL_W: helpcompilerStephan Bergmann1-1/+1
Change-Id: I0b9c7959cae65428ed1e80753e31f3ee9d726fc4
2017-05-03remove empty commentsNoel Grandin1-3/+0
found with: git ls-files | xargs grep -Pzl '/\*\* (\*|\s| )*\*/' Change-Id: I1f47bcb94d5a7b290a6c622c6941195fbb578597 Reviewed-on: https://gerrit.libreoffice.org/37159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock2-0/+2
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann1-1/+1
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-23Remove unused #include <ctype.h>Stephan Bergmann1-1/+0
Change-Id: I8bf3e30687e20151a9e1936e69362abfe9b3a99d
2017-03-22Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)Stephan Bergmann1-2/+4
Change-Id: If8085dc00db196eb51b6f14b4f4bac7c37dab249
2017-03-22Prevent calls to rtl/character.hxx functions with (signed) char argumentsStephan Bergmann2-2/+3
...that would implicitly be sign extended (for plain char only if it is signed), so non-ASCII char values would trigger the isUnicodeCodePoint assert. Change-Id: Iaf8024ad509e64525558e882fe3fd078cfb4ea91 Reviewed-on: https://gerrit.libreoffice.org/35523 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-16convert HelpProcessingErrorClass to scoped enumNoel Grandin3-28/+28
and drop unused HELPPROCESSING_INTERNAL_ERROR enumerator Change-Id: I0f2cf063a3f1472e1d52bab5039b1c3158d4865e
2017-01-26Remove dynamic exception specificationsStephan Bergmann4-7/+4
...(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-25loplugin: unnecessary destructor forms..idlcNoel Grandin2-4/+0
Change-Id: I765e0fa61f8134a60e5ea24452c6bbcb3fa8b054 Reviewed-on: https://gerrit.libreoffice.org/33492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>