Commit graph

2892 commits

Author SHA1 Message Date
Noel Grandin
f2c02331a7 new loplugin:unnecessary locking
off by default, since each warning needs careful inspection

Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20 08:03:27 +02:00
Stephan Bergmann
41a967af06 Extend loplugin:redundantcast to trivial reinterpret_cast from T to itself
Change-Id: I7c0be7b435d6b5f97bdd40484023584146638d70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134506
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-18 10:52:59 +02:00
Stephan Bergmann
9c3c6a6b66 Replace OFFSET_OF macro with a function template
(in preparation of extending loplugin:redundantcast to more reinterpret_cast
scenarios, which would have caused a false positive here).  Required a tweak to
loplugin:fakebool (as the relevant reinterpret_cast to silence some occurrences
is no longer seen "inline" now), and the heuristics of loplugin:unused no longer
worked (also because of the now-hidden reinterpret_cast'ing), but adding a
maybe_unused attribute looks better than tweaking that plugin's heuristics even
further.

Change-Id: Iead1a9b31983918cf8f3b0e6c727c0081437c6d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134504
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-18 09:30:41 +02:00
Noel Grandin
9e57e16484 loplugin:unusedvariableplus
Change-Id: Id93086be1224b6f6bf0bdaa1d50b4f289099027e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133876
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05 17:35:08 +02:00
Stephan Bergmann
abac7828ae Deprecate css::uno::makeAny; completely disable it for LIBO_INTERNAL_ONLY
There is just no good reason not to use a css::uno::Any constructor instead, so
simplify the code base.  For URE backwards compatibility, keep it around as
deprecated for !LIBO_INTERNAL_ONLY.

Change-Id: I9409d8853cac270d47377a31ba35a1fc23fa9800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133879
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-05 14:26:32 +02:00
Noel Grandin
8bf380f7d3 add o3tl::matchIgnoreAsciiCase
Change-Id: Iad8e1ed256d84808404bf20ed7a16b05b3db5818
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03 16:30:01 +02:00
Noel Grandin
ddef1e2c01 add o3tl::equalsAscii
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03 09:12:32 +02:00
Stephan Bergmann
64106353c9 Just use Any ctor instead of makeAny in writerperfect
(which needs one more false loplugin:redundantfcast suppression case)

Change-Id: Ib8a72a510384f497bddaef5b812a46ea473481d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133703
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-02 22:01:00 +02:00
Noel Grandin
40077fe309 new loplugin:stringviewdangle
to find places where string_view is pointing into a temporary String

Change-Id: Ib530b36f441e95d83d8f687d40a97516a0806721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133656
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-30 21:20:55 +02:00
Stephan Bergmann
5b6bc8182b Use the false warning suppression mechanism for loplugin:fakebool
Change-Id: I6572e500edc1be845c28389b0a4d3ca258dbbecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133593
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29 13:09:40 +02:00
Noel Grandin
5fe702f1b6 add o3tl::toUInt32
Change-Id: I07f11bf12fbe1d1c2d812fa0965d6e632e1e1aba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133437
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26 19:37:20 +02:00
Stephan Bergmann
e63e769bd3 Introduce a better mechanism to suppress false loplugin warnings
...by annotating occurrences of false warnings with [-loplugin:<name>] comments
in source files and letting individual plugins opt-in to watch out for such
suppression annotations, rather than maintaining lists of excluded source files
in the individual plugins.  (See the new loplugin::Plugin::suppressWarningsAt.)

Instead of making all calls to loplugin::Plugin::report check for suppression
annotations, the intent is that this check will only be added opt-in to those
places in the plugins that are prone to emitting false warnings.  In general it
is better to have plugins that don't produce false warnings in the first place,
or at least let those warnings be addressed with trivial and harmless source
code modifications, avoiding the need for any suppression mechanism.

As a proof of concept, I have removed the exclude list from
loplugin:redundantfcast and instead annotated the relevant source code.  (And
thereby found that three of the six originally excluded files didn't need to be
excluded any more at all?)

For now, this mechanism looks for comments (both //... and /*...*/, even
documentation-style /**...*/) that overlap the current and/or the preceding
line, because at least for code controlled by clang-format it is often easier to
move comments to a line of their own, preceding the commented code.  Looking
also at the current line (and not only at the preceding one) opens the door for
erroneous over-eager annotation, where an annotation that was meant to address a
false warning on the current line would also silence a potentially true warning
on the following line.  This probably doesn't cause much trouble in practice,
but is up for potential change.

Change-Id: I91ce7a0e5248886a60b471b1a153867f16bb5cea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133365
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-25 18:21:24 +02:00
Andrea Gelmini
427188600f Fix typo
Change-Id: I0444ed426dddd36e464b59758545155e11e9c13a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133298
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-04-21 20:55:53 +02:00
Bartosz Kosiorek
80c8563366 tdf#55058 tdf#143875 EMF+ Fix display of dashed lines and line joints
With previous implementation, empty spaces between dashes
were too long.
Additionally line joints were not working correctly, after
EMF+ reworking: tdf#111486

This commit fixes all these issues and additionally it is
covering it with tests.
Change-Id: I9404e566d2d7d3405ab817268ad9b1f538c200eb

Change-Id: I523f92a928ab592ff175d0d01c1ad1a3bc22e324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133207
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-04-21 10:30:26 +02:00
Noel Grandin
65075a76ff loplugin:stringviewvar disable for now
since it might generate false +

Change-Id: Icde883e0a2d60e70dd4ce9bbf823b54847cbb180
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133203
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-20 12:59:42 +02:00
Noel Grandin
ab699bfdb3 new loplugin:stringviewvar looks for OUString vars that can be
... that can be string_view

Change-Id: I0ddf66725e08b58e866a764f57200dd188b9f639
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133066
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-19 18:31:10 +02:00
Noel Grandin
33bd16b344 loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr()

Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-17 10:27:33 +02:00
Stephan Bergmann
4cc5ceb9e3 Adapt to clang::PPCallbacks::InclusionDirective change in Clang 15 trunk
<d79ad2f1db>
"[clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective()"

Change-Id: Ib2ea325cca3be03d3b5dfb9dfc3d870be659b129
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133085
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-15 21:05:03 +02:00
Stephan Bergmann
6a9f342add Introduce rtl::createUriCharClass
...to make those char class array initializations more readable.  (Making the
corresponding variables constexpr is mostly done so that failures in the
provided `unencoded` arguments, like non-ASCII characters or duplicate
character typos, would lead to compile-time errors also for !HAVE_CPP_CONSTEVAL.
And assigning to a sal_Bool std::array needs another hack to avoid false
loplugin:implicitboolconversion warnings.)

Change-Id: Ieb8827f69f55f1212a9428817d5331fcb18ef1d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133058
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-15 08:39:21 +02:00
Stephan Bergmann
36b7288a0c Use DeclCheck at one place in loplugin:implicitboolconversion
...and add tests for those additions to isBoolExpr done in
8e4d82cd11 "loplugin:implicitboolconversion: warn
about conversions to unsigned char" (and which were added to avoid false
warnings like

> testtools/source/bridgetest/bridgetest.cxx:643:21: error: implicit conversion (IntegralToBoolean) of call argument from 'unsigned char' to 'bool' [loplugin:implicitboolconversion]
>                     (xLBT->transportPolyBoolean(
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

and

> cui/source/options/optaboutconfig.cxx:359:62: error: implicit conversion (IntegralToBoolean) of call argument from 'unsigned char' to 'bool' [loplugin:implicitboolconversion]
>                             sValue.append(OUString::boolean( seq[j] ));
>                                                              ^~~~~~

)

Change-Id: I0683144e1c39d31303faf678afaafd708ef7ff79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133018
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-14 18:25:49 +02:00
Noel Grandin
fdfd517a6f loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents

Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 08:38:53 +02:00
Caolán McNamara
77bc0bcfb6 gtk4: add a surface_cell_renderer
to bridge our continuing usage of cairo and gtk4 GtkComboBox cell renderers
without dropping any existing hidpi wins

Change-Id: If5244766c13dd5d82445cb626ef4096e3c6ea244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132926
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-12 20:51:47 +02:00
Noel Grandin
cbaf1fbaa6 loplugin:stringview more o3tl conversion
look for call sequences that can use string_view and the new o3tl
functions in o3tl/string_view.hxx

Also add a few more wrappers to said #include file

Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-12 12:42:15 +02:00
Noel Grandin
85c2ed8dc7 loplugin:stringview add check for getToken().toInt32
where we can convert that to
    o3tl::toInt32(o3tl::getToken(
and avoid the heap allocation of a temporary string

Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11 14:45:38 +02:00
Noel Grandin
e4ff847fe0 loplugin:stringview check for getToken and trim
since we now have o3tl versions of those that work on
string_view.

Also improve those o3tl functions to support both string_view
and u16string_view

Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10 12:59:38 +02:00
Noel Grandin
3a88b513fd loplugin:stringviewparam convert methods using trim
for which we add a new o3tl::trim method

Change-Id: I9d37b6264eea106aa2f3502bd24b8cccf7850938
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08 10:26:10 +02:00
Stephan Bergmann
19d623d545 Simplify GlobalNamespace check
Change-Id: Id70abc5d1ccdc41dc771fe77ad0e7584efe76826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132569
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-05 14:40:07 +02:00
Stephan Bergmann
88bba21f83 Fix GlobalNamespace check
...so that e.g. building on F36 with -stdlib=libc++ doesn't fail with

> i18nutil/source/utility/paper.cxx:311:75: error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr]
>         locale_t loc = newlocale(LC_PAPER_MASK, "", static_cast<locale_t>(0));
>                                                                           ^

when the locale_t typedef declaration is nested in extern "C" (from
/usr/include/stdlib.h) which in turn is nested in extern "C++" (from LLVM's
include/c++/v1/math.h)

Change-Id: Ie81d7425cda231954bdbab47c3a0431dc7c27f5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132520
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-04 17:30:52 +02:00
Noel Grandin
3e1e0af376 loplugin:stringviewparam convert methods using match
which converts to a combination of substr and o3tl::starts_with

Change-Id: I5b01a181b9e6bee3483e4f49f1a9426abcc682d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132458
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-03 10:01:48 +02:00
Noel Grandin
c898611bd5 loplugin:stringviewparam convert methods using compareTo
which converts to compare

Change-Id: If03c790ea113a7caedbe89f926b29055c9ec1e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 16:55:36 +02:00
Noel Grandin
1927b51993 loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind

Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 13:31:19 +02:00
Stephan Bergmann
1e84c0b8d1 -Werror,-Wunused-but-set-variable
...which was apparently meant as a "Possible debugger breakpoint" in
DBG_UTIL-only sw_DebugRedline.  The obvious fix is to mark nDummy as volatile,
but increment of a volatile variable is deprecated, so replace those with reads
of the variable, but which triggered false loplugin:casttovoid so fix that too.

Change-Id: I07376e665caa4fd9befaba06d261a50df7a63a10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132237
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28 23:27:28 +02:00
Stephan Bergmann
8a734ba928 Drop support for OpenGL denylist on X11
...which appears to have become even less relevant with
db89f53c31 "remove OpenGL VCL backend code".  And
the vcl/unx/glxtest.cxx machinery that it is based on is (a) known to cause
issues like <https://gitlab.freedesktop.org/mesa/mesa/-/issues/3957>
"LibreOffice's OpenGL version detection code hangs when running inside a flatpak
container with a different mesa version", and (b) is one of the two reasons why
an soffice that uses Wayland nevertheless also requires Xwayland during startup
(the other reason being oosplash).  So getting rid of the glxtest machinery is
beneficial.

The remaining two potential uses of OpenGL on X11/Wayland are the obscure
css.rendering.SpriteCanvas.OGL service implementation (about which
db89f53c31 states that "it seems has never been
finished or enabled (or so it most probably should be dumped too)") and some
slideshow transitions.  About the latter, Caolán stated on IRC:  "I think we
grew this set of stuff to check for dodgy opengl primarily for the case where
vcl used opengl for ordinary UI optimizations; but I think that use is gone now
so I wonder does it make sense to just drop all of that entirely; for just slide
transitions we apparently survived fine without the denylist for ages".  (And in
any case there is still the WatchdogThread support with OpenGLZone::hardDisable
in VCLExceptionSignal_impl, vcl/source/app/svmain.cxx, should any OpenGL code
run into problems.)

(The removal of gb_LinkTarget_use_glxtest from gb_LinkTarget_use_vclmain, which
indirectly brought in gb_LinkTarget_use_libraries,*,vcl, revealed that an
explicit use of vcl was missing from various Executables etc., which thus had to
be added now.)

Change-Id: Ifa5220fd09910a4459ca546d9655e479a2e38f1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131943
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28 14:31:07 +02:00
Stephan Bergmann
0792b85914 Adapt loplugin:singlevalfields to AtomicExpr
> AtomicExpr 0xcb01120 'std::__detail::__platform_wait_t':'int'
> |-ImplicitCastExpr 0xcb01108 'std::__detail::__platform_wait_t *' <LValueToRValue>
> | `-MemberExpr 0xcb01048 'std::__detail::__platform_wait_t *' lvalue ->_M_addr 0xcafd9c8
> |   `-CXXThisExpr 0xcb01038 '__waiter_base<_Tp> *' implicit this
> |-IntegerLiteral 0xcb01098 'int' 5
> `-IntegerLiteral 0xcb01078 'int' 1
> AtomicExpr 0xd1e2d08 'std::__detail::__platform_wait_t':'int'
> |-ImplicitCastExpr 0xd1e2cf0 'std::__detail::__platform_wait_t *' <LValueToRValue>
> | `-MemberExpr 0xd1e2cc0 'std::__detail::__platform_wait_t *' lvalue ->_M_addr 0xcb02bf8
> |   `-CXXThisExpr 0xd1e2cb0 'struct std::__detail::__waiter_base<struct std::__detail::__waiter_pool> *' implicit this
> |-IntegerLiteral 0xcb01098 'int' 5
> `-IntegerLiteral 0xcb01078 'int' 1
> error: 'error' diagnostics seen but not expected:
>   File ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/atomic_wait.h Line 312: oh dear, what can the matter be? [loplugin:singlevalfields]
>   File ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/atomic_wait.h Line 312: oh dear, what can the matter be? [loplugin:singlevalfields]

Change-Id: I71c43b482aaa0992b7ce131d27e262b8e3b4087f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132160
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28 10:23:20 +02:00
Noel Grandin
ace70dae44 loplugins ignoreLocation() is unreliable with PCH
Change-Id: Ic12cacb6e058a8725ea6d722399e3afe6ea458c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-25 14:35:24 +01:00
Stephan Bergmann
5ace52e6ae Adapt loplugin:trivialconsructor to clang-cl
...where the S4 template constructor may still have an unparsed null body, so

    if (!constructorDecl->hasTrivialBody())
        return true;

will suppress the expected warning.  Lets just accept that clang-cl on Windows
will find less instances of loplugin:trivialconstructor.  (And moving the
expected-error comment around on the line was demanded by clang-format.  Oh my.)

Change-Id: I3357fbd0fbf932f7f93c421c2f079a8cfc536eef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132019
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-24 09:28:15 +01:00
Noel Grandin
7a2c36bb69 loplugin:constantparam improvements
(1) sanitize call value output, make downstream processing easier
(2) remove bad ignoreLocation() call, which was eliminating a lot of
valueable data and thus generating false positives

Change-Id: I39230c260c5cf717559300913fbc68bc3485b957
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131986
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24 08:39:48 +01:00
Noel Grandin
1a29b960bb loplugin:unusedfields
Change-Id: Ifa2e2b35b725a877ef43526ad243cbfd02148807
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131951
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-23 10:18:54 +01:00
Stephan Bergmann
721c4faa50 Adapt loplugin:indentation to --enable-qt6
> In file included from vcl/qt6/QtClipboard.cxx:10:
> vcl/qt6/../qt5/QtClipboard.cxx:142:16: error: statement mis-aligned compared to neighbours  [loplugin:indentation]
>         Q_EMIT clearClipboard();
>                ^

etc.

Change-Id: I8ceacfd5eafe963699d8313d3f8cadbed4ccd260
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131929
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-22 14:15:52 +01:00
Stephan Bergmann
fe40f64578 Win/X11OpenGLDeviceInfo don't need a common base class
Change-Id: I9fc7e763b8cf055c3aabaaa97fe8c85ebc5e71b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131926
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-22 11:41:54 +01:00
Stephan Bergmann
10981fb2fa Consistently avoid loplugin:trivialconstructor when there are defaulted params
(The template default constructor in S8 had already been suppressed via

    std::distance(recordDecl->ctor_begin(), recordDecl->ctor_end()

being zero, but the similar case in S7 caused a warning.)

Change-Id: I4d18dec8bb971198eb8503262572a08c019c66bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131663
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-16 21:10:27 +01:00
Stephan Bergmann
0c50141cfc Fix loplugin:trivialconstructor handling of ctor templates
Change-Id: Ic8b2f26498099c77b834d8e152f06d2834dfee3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131658
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-16 16:09:34 +01:00
Stephan Bergmann
c11464f548 Simplify loplugin:trivialdestructor
The recursive checking of (non-virtual) bases and the checking of all virtual
bases were unnecessary.  It suffices to just check whether all the direct
(virtual and non-virtual) bases have trivial destructors.

(And FieldHasTrivialDestructor*Body* was a misnomer, as it actually checks
whether the corresponding type has a trivial destructor.)

Change-Id: I8a70e18eea4b629ad56577fa885f51925f9d7dde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131608
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15 14:41:28 +01:00
Stephan Bergmann
25fee1f66b loplugin:trivialdestructor: Remove spurious anonymous union special case
No idea what this "The destructor for an implicit anonymous union member is
never invoked" block was meant to be good for.

If a union-like class X has a variant member Y with a non-trivial destructor, an
(implicitly-declared) defaulted destructor of X would be defined as deleted, so
we must not warn about a user-provided destructor of X with an empty body.  But
that is already covered by the fact that the anonymous union of which Y is a
member will have a non-trivial destructor if Y has a non-trivial destructor.

Change-Id: Ia30381a07fadd3132f5595575716c6c5097fa34d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15 13:41:02 +01:00
Stephan Bergmann
5e6ee5503b Check that loplugin:trivialdestructor doesn't warn about deleted dtors
...which happens to be covered by

      if (!destructorDecl->hasTrivialBody())
          return false;

Change-Id: Ica2874e710da08d668b7e773373a1188a8ae16a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131575
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15 13:40:28 +01:00
Stephan Bergmann
c3346dc573 loplugin:trivialdestructor: Only warn about definitions
Change-Id: I666e72a5c95b48cd5bc0cb775de3ec6a6c82fe39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131574
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15 13:40:00 +01:00
Noel Grandin
ef82ccdda9 new loplugin:trivialconstructor
Change-Id: Iaaf63c49ce94987ab9c4ebc68e963cc3054a3c34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131342
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-14 07:36:13 +01:00
Luboš Luňák
dddee125cc load ods/xlsx with full row attributes without allocating all columns
If there's e.g. an entire row bold, it's enough to set default
attribute for unallocated columns.

This also reverts the workaround from commit 297ab561c6, as it's
no longer necessary.

Change-Id: I0b208709aeaff1c0d59da2410926876715cfe642
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131320
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-11 10:09:03 +01:00
Noel Grandin
7002caa97e new loplugin:trivialdestructor
look for potentially trivial destructors that can then be elided

Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-11 09:06:06 +01:00
Stephan Bergmann
9c431f4d3a Don't use Library_tl in URE libraries
This partly reverts 8b5e23eac3 "log nice exception
messages whereever possible", e1eb7cb04a
"loplugin:logexceptionnicely in starmath..svgio",
d6d80c4e17 "OSL_FAIL.*exception ->
TOOLS_WARN_EXCEPTION", and 877f40ac3f "tdf#42949
Fix new IWYU warnings in directories [h-r]*", and adapts
loplugin:logexceptionnicely accordingly.

Change-Id: I792b853b988c7c5f77179ca0672c30cb4223b5a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-25 08:20:55 +01:00