summaryrefslogtreecommitdiff
path: root/hwpfilter
AgeCommit message (Collapse)AuthorFilesLines
2020-04-29GCC trunk towards GCC 10 still emits a bogus -Wstringop-truncationStephan Bergmann1-2/+2
Change-Id: I86e7bf7615bd31ed90b067cebfbaf0126c8d8c2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84055 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-15loplugin:buriedassign in f,h,i*Noel Grandin3-14/+36
Change-Id: Iac753e528e13cb2565832a484e87f88061bbc91e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-08loplugin:flatten in hwpfilterNoel Grandin1-9/+9
Change-Id: Ie3e970ec0fc761cf8a5e16ea72b7e95c28462234 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91846 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-16clang-format f*,h* with under 5-percent lines of changeMuhammet Kara4-4/+4
Files which could become clang-format conformant with under 5-percent lines of change relative to the total count of lines in the file are found by using bin/find-clang-format.py, and fixed with /opt/lo/bin/clang-format -i <path-of-the-file> There will be follow-up patches to fix all 'under-5-percent' files. Change-Id: I702c09bcd3a9a113b3d66c30edb6cf3b7e6a6593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88776 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin1-2/+1
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03loplugin:duplicatedefines (clang-cl)Stephan Bergmann1-3/+1
(already defined in hwpfilter/source/hwplib.h) Change-Id: Id85048817b825ad265eba20e221c0703467b66b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87890 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28New loplugin:unsignedcompareStephan Bergmann2-10/+14
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-27tdf#124176: Use pragma once instead of include guardsHakan Bakacak1-3/+1
Change-Id: I65639e32765ba0804aeb5b5880eca2b5d186485e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87431 Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-24loplugin:makeshared in hwpfilter..i18npoolNoel Grandin2-4/+4
Change-Id: I2e757043215164df173c89e21cebe2f4c9c05de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08tdf#96505:Get rid of cargo cult long integer literalsayhanyalcinsoy1-2/+2
Change-Id: I6ee1f79d4b96c4ed161eff11c1b75574d89902dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85843 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-01crashtesting: footnote-layout doesn't existCaolán McNamara1-3/+3
presumably should be page-layout-properties instead presumably triggered since a FastParser API change over Change-Id: Ic4f5e9c30921adb26bb05028f2a3f75d8c0d731e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86051 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-19sal_Char->char in formula..i18npoolNoel Grandin1-1/+1
Change-Id: I765979f41842befcf25909944100d1caa97f81a8 Reviewed-on: https://gerrit.libreoffice.org/85476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-24cppcheck: performing init in init list (hwpfilter, i., l.)Julien Nabet2-6/+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 Bergmann7-0/+36
...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-08-Werror,-Wunused-macros (clang-cl)Stephan Bergmann1-4/+0
Not sure why the unused-macro warning for isnan only started to show now that I build on Windows with clang-cl against MSVC 2019 (rather than 2017). The code was there ever since 16cba77220efab8204eeecb49ccd3ec033efca38 "#112673# initial checkin of HWP filter", but there appears to never have been any use of isnan at least in hwpfilter/ itself. Change-Id: Ib202da91806baf347bbaf1ac2a47bcc7f81bd868 Reviewed-on: https://gerrit.libreoffice.org/82271 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin1-2/+3
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-02cid#1455209 Wrapper object use after freeCaolán McNamara1-8/+6
Change-Id: I5883d2d954d62301c8d6ca47ceedd6401aee1dc6 Reviewed-on: https://gerrit.libreoffice.org/81935 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-29cid#1448471 Wrapper object use after freeCaolán McNamara1-6/+26
Change-Id: I4a6f31491f857280623302569afa982b37c16e89 Reviewed-on: https://gerrit.libreoffice.org/81629 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-1/+25
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-17Remove some memset callsMike Kaganski5-28/+14
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-11ofz#18116 TimeoutCaolán McNamara1-4/+8
Change-Id: If0bf63bacf9b5f7502287b1e465a34806d18b874 Reviewed-on: https://gerrit.libreoffice.org/80641 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-04ofz#17823 avoid timeoutCaolán McNamara1-0/+9
Change-Id: I3658d476873a502adc0cbd8be9a4f6ffd5b62c87 Reviewed-on: https://gerrit.libreoffice.org/80236 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-01loplugin:stringadd in helpcompiler..ooxNoel Grandin1-5/+5
Change-Id: I858870d883de10a673d7ce2798bda8c8f511cee5 Reviewed-on: https://gerrit.libreoffice.org/79889 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26loplugin:constmethod in framework..lotuswordproNoel Grandin1-10/+10
Change-Id: I14a3855a75cf081d86c2a404966db38c617c0256 Reviewed-on: https://gerrit.libreoffice.org/79541 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák1-1/+1
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet1-7/+2
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-01new loplugin:mapindexNoel Grandin1-2/+3
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): hwpfilterStephan Bergmann1-2/+2
Change-Id: I1dcb28e357b9116fad227e731c59c64d09f0b9d1 Reviewed-on: https://gerrit.libreoffice.org/76672 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-25Fix typoAndrea Gelmini1-1/+1
Change-Id: I0b1e92daa83d1bc5aadeb70a730521198571a5d8 Reviewed-on: https://gerrit.libreoffice.org/74663 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-21/+13
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-03GCC trunk towards GCC 9 still emits a bogus -Wstringop-truncationStephan Bergmann1-2/+2
Change-Id: I1e9e439558025030f79e070680831f1139675993 Reviewed-on: https://gerrit.libreoffice.org/66869 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-29Fix conditional around closing #pragma GCC diagnostic popStephan Bergmann1-1/+1
...which 7cf3574ac9208e70c03eeaca2def0235ec90f55f "Avoid -Werror=format/stringop-truncation" had failed to adapt Change-Id: Ide00c8136db27519c2d694576910c423d40d481e Reviewed-on: https://gerrit.libreoffice.org/71521 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-29Avoid -Werror=format/stringop-truncationJulien Nabet1-1/+1
It also affects gcc 8.3 Change-Id: I896e84d5e1e96abfe81294e921cfcc060e44fb6f Reviewed-on: https://gerrit.libreoffice.org/71474 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-10clang-tidy: Fix suspicious catches of WIP unhandled-self-assignment checkTamás Zolnai1-0/+3
Change-Id: I1cb16b180f4cc5bf4d65485f03c44a06414d3580 Reviewed-on: https://gerrit.libreoffice.org/70481 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin1-6/+6
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin1-1/+1
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04Revert "new loplugin typedefparam"Noel Grandin1-1/+1
This reverts commit 9865440d217d975206a3f91612f0666312bc8fd8. This is not ready to land yet, seems like the latest update of the logic reveals a bunch more places I need to fix before it can land.
2019-03-04new loplugin typedefparamNoel Grandin1-1/+1
verify that parameters use the exact same typedef-names (if any) in definition and declaration Change-Id: I55d2817f599b0253904dce2d35a1a93967e15a77 Reviewed-on: https://gerrit.libreoffice.org/68439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-01Some more WIN32 -> _WIN32Stephan Bergmann1-1/+1
...at least some of which have presumably been missing from ce43d0ae9279edbf1ad108fe0d8325327a038d49 "use consistent #define checks for the Windows platform" by accident (and some just clean up comments) Change-Id: I5532685c7df96ae3c8a25b73d8064d7433964a9b Reviewed-on: https://gerrit.libreoffice.org/68580 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin1-1/+1
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-09loplugin:indentation in helpcompiler..ioNoel Grandin9-195/+195
Change-Id: Ia3f05662cc9542feeac3096d29e9dec6d1858620 Reviewed-on: https://gerrit.libreoffice.org/67558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-24loplugin:constparams in dbaccess..ooxNoel Grandin2-2/+2
Change-Id: I9c04906dd492c6f8a816f57f40bc31406a871a78 Reviewed-on: https://gerrit.libreoffice.org/66793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-21Avoid -Werror=stringop-truncationStephan Bergmann2-2/+15
...as emitted by at least GCC 8.2 with --enable-optimized. These are not actually problems, as in both cases strncpy(p,...,N-1) is used to copy a string into an area p of length N that has initially been zero-initialized, so p[N-1] will already contain NUL. But add the (redundant) p[N-1]=NUL just in case, and to silence GCC (where the documentation explicitly recommends this additional write as a way to silence the warning). Unfortunately, in hstyle.cxx at least GCC 8.2 with --enable-optimized would still emit the warning, even though it uses the recommended way of handling it, so needs to be silenced with a #pragma. Change-Id: Ie41f420c732c2bfb699903ebd21ce1a89dd2b236 Reviewed-on: https://gerrit.libreoffice.org/66620 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-28Fix typoAndrea Gelmini1-1/+1
Change-Id: Ia445f4377ceab4b6ce147de2dc54cf4edf0ed7d5 Reviewed-on: https://gerrit.libreoffice.org/65564 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-21use unique_ptr in hwpfilterNoel Grandin9-131/+113
Change-Id: I3491777281912e095c9222e83028d358d6826841 Reviewed-on: https://gerrit.libreoffice.org/65522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-19-Werror=class-memaccess (trunk towards GCC 9)Stephan Bergmann1-2/+4
..."‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct HWPDrawingObject’ with no trivial copy-assignment; use value-initialization instead" after 96c85e7d107ad0d79295349f01cd8578ce7daeba "loplugin:useuniqueptr in hwpfilter" Change-Id: Iee2b0ba2ec57233a311c88cb904af2bae71286d0 Reviewed-on: https://gerrit.libreoffice.org/65375 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann3-6/+6
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-25tdf#120703 PVS: V560 A part of conditional expression is always true/falseMike Kaganski1-4/+4
Change-Id: I8d98aa7dd77fbd79611b8a4aba77e8c378fd1cae Reviewed-on: https://gerrit.libreoffice.org/63981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-11-16loplugin:staticmethods improvementNoel Grandin2-3/+3
Change-Id: I8889ce8a7d2309b54454cfe4c6421282e1c6e755 Reviewed-on: https://gerrit.libreoffice.org/63434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai1-3/+1
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>