Commit Graph
2904 Commits
Author SHA1 Message Date
Andrea Gelmini cb958c4ff8 Fix typo
Change-Id: I9b29e51e550ea9f13497e1f46cf4cdc11cf8faa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135925
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-06-16 13:00:54 +02:00
Noel Grandin a447b5b6d1 loplugin:moveit
Change-Id: Ic593974a44d9e327e0385c7ffaaa6d42576ae01a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135911
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-16 09:16:01 +02:00
Noel Grandin d0f61d94d6 better solution for ignoreLocation for tree-wide plugins
Change-Id: I7336003e038781d4ef50380fa49f66b5ff19379f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135589
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-14 09:07:13 +02:00
Noel Grandin 24d15ba86c loplugin:mergeclasses sd::TitledDockingWindow with sd::PaneDockingWindow
Change-Id: I77314048173ebba0dc0e03f710607b74e73f0bde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135719
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-13 14:38:03 +02:00
Luboš Luňák 91b98efc2a make VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer() LOK-only
Because it's used only for LOK, and SvpSalVirtualDevice::CreateSurface()
otherwise wouldn't know whether to apply LOK DPI settings or not
(since this might be called for LOK tiled painting, when it should,
or it might be called from somewhere else while LOK is active, in which
case this should be handled normally). Getting that mismatched can cause
things like https://github.com/CollaboraOnline/online/issues/4834 .

Change-Id: I1df7b8a169c8ef2e799731a6695a032948536582
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135588
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-06-13 10:36:35 +02:00
Noel Grandin 230e461065 loplugin:unusedvarsglobal
Change-Id: I37a1772ffdd682d17571aa06e24089136d2d8547
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135600
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10 21:13:43 +02:00
Stephan Bergmann a8485d558f [API CHANGE] Remove deprecated idlc and regmerge from the SDK
* Client code must replace uses of idlc and regmerge with uses of unoidl-write,
  see the changes to odk/examples/ and ure/source/uretext/ in
  40f2aee658 "Provide unoidl-write also for the
  SDK" for examples.

* The new types.rdb format is not compatible with LibreOffice < 4.1.  Clients
  generating extensions containing such files are advised to use appropriate
  LibreOffice-minimal-version elements.

* For compatibility with old extensions, reading the legacy types.rdb format is
  still supported.

* The SDK no longer ships an idl/ sub-directory containing the udkap and offapi
  .idl files (as, unlike idlc, unoidl-write does not need them).
  odk/config/cfgWin.js had to be adapted to look (somewhat arbitrarily) for an
  examples/ sub-directory instead of idl/ when checking for "an sdk folder".
  gb_UnoApi_package_idlfiles became unused and has been removed.

* The idlc and regmerge executables have been removed.  Module idlc has been
  removed except for idlc/test/parser/, which is also used by
  CustomTarget_unoidl/unoidl-write_test, and which may eventually be moved into
  module unoidl.  Module external/ucpp and the corresponding configure options
  have also been removed.

Change-Id: I42a0231699b863b5ebe2bee63bc32c8f79278cc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122363
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-10 17:15:49 +02:00
Noel Grandin 611fe67394 loplugin:unusedenumconstants add support for ParenListExpr
Change-Id: I3dc2a5e4c0cae9a9ae955118e77eae63c17f7242
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135590
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10 15:49:56 +02:00
Noel Grandin f71606c920 new loplugin:moveit
look for local variables that can be std::move'd to parameters

off by default, since it doesn't do proper data flow analysis

Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10 13:13:15 +02:00
Jan-Marek Glogowski ea5a0918c8 VCL add vcl::WindowPosSize abstract class
... and use it to remove a duplicate and simplify code.

Should mostly be a refactoring, which was mainly done by some
larger sed calls, except for the new API calls, which helped
shrinking some LOC. All data is also now private.

Originally two of the "replaced" "classes" had unsigned width
and height and one had signed. Noel pointed out, that during
calculations, the value might get negative temporarly, so this
now settles with signed values. Still the set size should never
be negative and this is enforced this way. Not sure that is what
Noel had in mind.

This also includes:
- rename WindowState => WindowData
- rename WindowStateMask => WindowDataMask
- rename WindowStateState => WindowState
- move WindowState and WindowDataMask to vcl/windowstate.hxx
- move WindowData(Mask) and WindowState into vcl namespace
- readability: replace or'ed WindowState enums with "meta" enums
  + add "meta" WindowState enums PosSize and PosSizeState

Change-Id: Icd16cfb498531aa7238ddbde83fcb0ed6d9e4f77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135426
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-06-08 18:17:17 +02:00
Noel Grandin e6de84d46c std::move SfxPoolItem into SfxItemSet where possible
found with the help of a temporary loplugin (which i have put into the
store/ folder)

Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02 10:45:44 +02:00
Szymon Kłos 09847cdbd4 jsdialog: introduce popup management
Popup windows are managed by vcl (some moving between parents
happens on show/hide popup).

We need to access correct popup window to correctly close
popup in LOK. So remember popup instances.

Change-Id: I9e1ba18ded5a1bf675f95bd7178043eebd9bbd5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134576
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134675
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135197
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-05-31 22:09:42 +02:00
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
<https://github.com/llvm/llvm-project/commit/d79ad2f1dbc2db63121620f55d6cfa915f2733ac>
"[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