summaryrefslogtreecommitdiff
path: root/io
AgeCommit message (Collapse)AuthorFilesLines
2020-04-07loplugin:flatten in ioNoel Grandin3-63/+63
Change-Id: I4f4dbbd4ce279cb25a8e4deba1967b5c23ce1385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26remove some unused local varsNoel Grandin1-4/+0
found by a more aggressive variant of loplugin:unusedvariables. This is my first pass, committing the simplest and most obviously unnecessary vars Change-Id: I9676a6e39a101937097788548764506c93811c57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87414 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-19sal_Char->char in idlc..linguisticNoel Grandin4-4/+4
Change-Id: Ib30fe34123ad7e5d892e8db9c742e08c4ca8fcd2 Reviewed-on: https://gerrit.libreoffice.org/85477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-12Fix typoAndrea Gelmini1-2/+2
Change-Id: Ie1a06014d989f51141a15c724ab026f5423335de Reviewed-on: https://gerrit.libreoffice.org/84995 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-11Fix typosAndrea Gelmini1-9/+9
Change-Id: Idc42061d8832f9d7ca5402e756c81305a309eefc Reviewed-on: https://gerrit.libreoffice.org/84968 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-24cppcheck: performing init in init list (hwpfilter, i., l.)Julien Nabet2-7/+2
Change-Id: Idf5b7be45d48076fbe191fbf1a2fa63c6da71902 Reviewed-on: https://gerrit.libreoffice.org/83617 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann11-0/+64
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-03loplugin:stringaddNoel Grandin1-1/+1
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-28loplugin:stringadd improve detectionNoel Grandin2-8/+8
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:stringadd in helpcompiler..ooxNoel Grandin2-19/+4
Change-Id: I858870d883de10a673d7ce2798bda8c8f511cee5 Reviewed-on: https://gerrit.libreoffice.org/79889 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-01Simplify Sequence iterations in ioArkadiy Illarionov3-52/+30
Use comphelper::findValue and initializer lists. Change-Id: I4ebaf556a21b263e48b82a7290093eb8a832d9da Reviewed-on: https://gerrit.libreoffice.org/78351 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet1-3/+1
in hwpfilter, include/test, io, linguistic, oox, pyuno, reportdesign Change-Id: I5c265c4fde85dd6d7faab8ae82809c4a0e6dd69b Reviewed-on: https://gerrit.libreoffice.org/77646 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-16use more TOOLS_WARN_EXCEPTIONNoel Grandin1-10/+5
Change-Id: Ic21ea11ff106e0732bb8fa600ef39a549d7bda86 Reviewed-on: https://gerrit.libreoffice.org/77569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini1-1/+1
Change-Id: Icdc486d64283961dad4a1d29ae662d66143f674b Reviewed-on: https://gerrit.libreoffice.org/77320 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): ioStephan Bergmann8-12/+12
Change-Id: Ia1bf6c89a0c70941f251dcbc68061df7bd3457b4 Reviewed-on: https://gerrit.libreoffice.org/76668 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-27Fix typosAndrea Gelmini1-1/+1
Change-Id: I380856ca45c835e732fdf080a522caab4534db5b Reviewed-on: https://gerrit.libreoffice.org/76346 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin2-44/+2
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 Date: Thu Dec 21 20:08:33 2017 +0900 chart2: suspend/resume setting rects dirty for 3D shapes comphelper::OInterfaceCompare is no longer necessary Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975 Reviewed-on: https://gerrit.libreoffice.org/71537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-25tdf#42949 Fix IWYU warnings in io/Gabor Kelemen19-54/+56
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I16dfde335816053e5821d5e975b27b6e4819b1a8 Reviewed-on: https://gerrit.libreoffice.org/71135 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-07log nice exception messages whereever possibleNoel Grandin2-11/+17
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-24loplugin:unusedfields in helpcompiler..jvmfwkNoel Grandin2-4/+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-09loplugin:indentation in helpcompiler..ioNoel Grandin4-4/+4
Change-Id: Ia3f05662cc9542feeac3096d29e9dec6d1858620 Reviewed-on: https://gerrit.libreoffice.org/67558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-01Better fix for missing [[noreturn]] of CPPUNIT_FAILStephan Bergmann1-1/+1
This includes a revert of commit 9808486a89c6368f836579f8d8c0dda63fd0063c "Avoid -Werror,-Wimplicit-fallthrough with clang-cl", and also undoes older MSVC workarounds (that would start to cause "warning C4702: unreachable code" now). Change-Id: If72bf336e12e0a2db589857e8875003dae861977 Reviewed-on: https://gerrit.libreoffice.org/67248 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-19use unique_ptr in ioNoel Grandin3-13/+8
fixing a leak in PipeAcceptor::accept Change-Id: Id47da5e2a2c4060958aee9233feec859aebc69c7 Reviewed-on: https://gerrit.libreoffice.org/65345 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin1-2/+2
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-21pvs-studio: V557 Array overrun is possibleCaolán McNamara1-1/+1
Change-Id: Ia4a7c857b3c94490364ed979ba2fcb9e192e3796 Reviewed-on: https://gerrit.libreoffice.org/62111 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-21tdf#120703 (PVS): handle failed reallocMike Kaganski1-2/+4
V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'm_p' is lost. Consider assigning realloc() to a temporary pointer. Change-Id: Ic298927a266da4d543f3856a1c9f97ba1f6fe941 Reviewed-on: https://gerrit.libreoffice.org/62092 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-03no need to call empty() before clear()Noel Grandin1-4/+1
found with git grep -A2 -nP '!.*\.empty()' | grep -B1 -w clear Change-Id: I87013eab9c6988048b891d20577e1f7efbce1b6c Reviewed-on: https://gerrit.libreoffice.org/61295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann2-2/+2
...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-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen3-0/+3
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-09loplugin:simplifyconstruct in helpcompiler..ioNoel Grandin1-3/+1
Change-Id: Ibdc1933b5d8d6be1fe42a7df93bd7e1c903bb39b Reviewed-on: https://gerrit.libreoffice.org/60202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin1-4/+2
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-01add operator+=(OUStringBuffer) method to OUStringNoel Grandin2-2/+2
to reduce needless object creation and copying some more And fix what looks like a bug in CSS hex color parsing at line 609 in sw/../parcss1.cxx that has been there since commit 7b0b5cdfeed656b279bc32cd929630d5fc25878b "initial import" Change-Id: Ibad42b23721a56493bd1edcd7165e6104494a5c3 Reviewed-on: https://gerrit.libreoffice.org/58357 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30Add missing sal/log.hxx headersGabor Kelemen1-0/+1
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-23Fix typosAndrea Gelmini1-1/+1
Change-Id: Id7d0de124c4b9006db8c28e5cebb3ba38b0143ee Reviewed-on: https://gerrit.libreoffice.org/57602 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-07-18Fix typosAndrea Gelmini1-1/+1
Change-Id: I5195d13b351c0eebad1eae901f7ce8408a9e5c92 Reviewed-on: https://gerrit.libreoffice.org/57028 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2018-07-08tdf#84323 - sal - add sane sleep interface: cleanup osl_waitThreadKevin Dubrulle2-7/+4
Replace osl_waitThread by osl::Thread::wait. Use std::chrono instead of TimeValue. Change-Id: I71691d014feeeb0c5d0ba29d048bda8e25e6e7dd Reviewed-on: https://gerrit.libreoffice.org/57130 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-18Use for-range loops in hwpfilter, i18n*, idl* and ioJulien Nabet1-10/+14
Change-Id: I980464162b73ed9ee0a09acbca1b9050af8d1027 Reviewed-on: https://gerrit.libreoffice.org/51492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-24Fix typosAndrea Gelmini1-1/+1
Change-Id: I359c5aff8c90359783588d189de4e5b94224fa9c Reviewed-on: https://gerrit.libreoffice.org/48232 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-19SAL_W32 is just an alias for _WIN32Stephan Bergmann1-1/+1
...so consistently use the latter instead of the former Change-Id: I144d5e7c472632f93b2258461510346bc85892d9 Reviewed-on: https://gerrit.libreoffice.org/48135 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15remove local copies of std::min,std::maxNoel Grandin4-9/+6
Change-Id: I067c4dcabad55180e4734fb06338a8e843713936 Reviewed-on: https://gerrit.libreoffice.org/47692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: ioStephan Bergmann1-22/+22
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: I2e2654e37d949205dea27e45dd4164f51ea95839
2018-01-11loplugin:useuniqueptr cppu,idlc,io,ucbhelperNoel Grandin1-11/+9
Change-Id: I6d8c24fabd52b39c66ce0b88b547df7ec85dad76 Reviewed-on: https://gerrit.libreoffice.org/47725 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-19inline use-once typedefsNoel Grandin1-3/+1
Change-Id: I5c3ffc03c26b3428f1f336e6ecba7838a1cf1157 Reviewed-on: https://gerrit.libreoffice.org/46764 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11loplugin:salcall fix functionsNoel Grandin10-25/+25
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-3/+3
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-30loplugin:constmethod in vcl and stocNoel Grandin2-3/+3
Change-Id: I7c02eecc16ca7cf89d9f7021116b0226885dbf06 Reviewed-on: https://gerrit.libreoffice.org/44044 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: ioStephan Bergmann11-24/+24
Change-Id: I68e0ebc5a1585d2f55a4061edd8ab197f437b6a2
2017-10-04add << operator for css::uno::ExceptionNoel Grandin1-5/+5
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-29loplugin:flatten check for throw in then clauseNoel Grandin1-15/+6
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-22loplugin:flatten in framework..packageNoel Grandin5-219/+161
Change-Id: Ide8a97eae6e2fdc7d2dcccba1480ac55a9b555bc Reviewed-on: https://gerrit.libreoffice.org/42593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>