summaryrefslogtreecommitdiff
path: root/io
AgeCommit message (Collapse)AuthorFilesLines
2021-03-26Drop these definesMike Kaganski6-28/+11
Change-Id: I7ff56d6f016ea90c4b5cdcbbb36141627037c0ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113125 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein1-0/+0
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-02-18loplugin:referencecasting add check for new rtl::Reference operatorNoel3-4/+4
rtl::Reference now has a conversion operator to uno::Reference, so look for places where we can simplify the code and use that. Change-Id: Ic81db50d670bed5e875300577d4bf5f3599cc2c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-11loplugin:refcounting generalise type checkingNoel3-8/+11
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-03tdf#124176 Use pragma once instead of include guardsAlchemist4-15/+4
Change-Id: I491742c51ddc7c97f02b148dfb81d9ba820a759e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108600 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann1-2/+3
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-10tdf#42949 Fix new IWYU warnings in directories [h-r]*Gabor Kelemen2-3/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I886b6f446293d3b1cfbf4ae05e8dbd7fabab9f20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105510 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-22long->tools::Long in hwpfilter..ooxNoel1-1/+2
Change-Id: I9ab8876aac7b2f8b488db6dfa9c6fd0cecd2238b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104626 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-27improve some exception messagesNoel Grandin3-8/+8
Change-Id: Ifc5d940fbf77ae13071c299fb6168bdc55dc5c95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-14io: create instances with uno constructorsNoel Grandin13-717/+321
See tdf#74608 for motivation. Change-Id: Ic5942f00147e4024ffc3d5880cf3c7462bcc14de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98678 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-10replace usage of blacklist with excludelist for IWYUThorsten Behrens1-1/+1
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 Change-Id: I2f22d455d2a936a85750eaab1fda215ebb6d9d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98182 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: ioStephan Bergmann1-1/+1
Change-Id: I150aa3666a9e1acf5fba445b9a709ccd9d8c7e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97593 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-05Make it more obvious that the error message is composedStephan Bergmann1-2/+2
...from a pipe name and an error number Change-Id: I1e79c1d635fd7f51faf9ede09ca862b37bd7b990 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-04Upcoming loplugin:elidestringvar: ioStephan Bergmann1-2/+1
Change-Id: Ic68bc08ed70733728a50d3753a27ec62ed4953f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95485 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>