Age | Commit message (Collapse) | Author |
|
found by my new loplugin:unusedvariableplus
Change-Id: Ic3f55f492d43a53d8850a97d44059ff127fd69a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87573
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
"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>
|
|
found by my new aggressive unused var plugin. these are unused return
values from function calls
Change-Id: I3359c583f535828f192cb833762dfedc008d82f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87439
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...in what might be attempts to avoid warnings about signed vs. unsigned
comparisons.
Change-Id: I0e689d8b730170f35107cbdf46c3d8cd9a593367
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87456
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
...plus loplugin:unnecessaryparen fallout in sw/source/uibase/docvw/edtwin.cxx.
Each of the files contained at least one #define that would have caused warnings
with upcoming loplugin:unsignedcompare. For consistency, I changed all #defines
in those files (using a variable of a specific type if the original #define used
a cast to that type, otherwise using 'auto').
Change-Id: I66f71b2d83394c9dc6952ae19df774cdd4d0b76a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87374
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I3f7cb6010142c8bdce96bf541a7efb650233942e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87325
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ic2212a502bbd42217934884f4fce49f6f8d4765c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87236
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
only called from one constructor
Change-Id: I082cf3b459c936b79a6df695fffac5e3cf43705b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: If66ee8d6441fea0a2bb9c6b8a956ecd94f025746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87177
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I7b273cdc0f90f2a8c9527d1f19fed97672a74741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87175
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I0703344aad4ca6c72e494160b019c13e24cc843a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87160
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
and flatten the pImpl data
Change-Id: I8d817cd2af0a3855d10dbfaa580c3379119d5067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87126
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: If130c8a4861998d7eafd2e9525592f3c811ec21c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87069
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I517a26a3ea64d86a1f494e3b9ea52ee28604e0b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I993ed47c6b4a43f6293bdf5c2803599d75337bb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86918
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
the calling class handles this nicely, and also tells us when we are not
handling some part of the XML file
Change-Id: Ic51a42b9d2dec96243e7f83b528d7455d4bc0504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86906
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ib012e7c814184eaeaab57200107e8bf4887058f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86707
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I2908abc13f16b0011fcb326e8405080cc30df74a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86684
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
found using 'git grep', I tried using clang-tidy, but it only
successfully found a tiny fraction of these
Change-Id: I61c7d85105ff7a911722750e759d6641d578da33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
which reduces code bloat, and lets us log when elements are ignored
Change-Id: I5ca12bc1fcbfa3bea49ebde819fd80bd233a96a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I768c5ae5a4c2c0b2f50a8eb541a5c7397c355345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86206
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: I1ba1b2e1f0568ee3874d171fe33686968e21a484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86205
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
|
|
Change-Id: I5f4c4b43067b99cd57f8ea941002481ef5977e09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86144
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
so we get more useful log messages when stuff goes wrong
Change-Id: Ia55db7ab1a4d79b0f281673fbbb06c61745fa89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85829
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
already in reportdesign/source/filter/xml/xmlEnums.hxx
Change-Id: I323b8d778a673a7dd82ca758133d955afc694b3a
Reviewed-on: https://gerrit.libreoffice.org/85570
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
duplicates in same file
Change-Id: I9ff404656620b28da13b6658f9a60e2e920aa953
Reviewed-on: https://gerrit.libreoffice.org/85569
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I6d32942960a5e997f16eb1301c45495661cd4cea
Reviewed-on: https://gerrit.libreoffice.org/85514
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
looks like these were left behind when the associated *Item classes were
moved from svx to editeng
Change-Id: I09bf48396e18a9f1a6dddb65618affc782777c25
Reviewed-on: https://gerrit.libreoffice.org/85341
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ia8192e03feda9e8ae70e29d8dc98d995f015f9ce
Reviewed-on: https://gerrit.libreoffice.org/85135
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I8ad75d1251df4d6f8097aaa68e4ec92331e38ad4
Reviewed-on: https://gerrit.libreoffice.org/85077
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ife9ab434888bfbcdc6ff4446b92f2aa83e6cb449
Reviewed-on: https://gerrit.libreoffice.org/84913
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Section Setup, Page Setup, and Character Settings dialogs
Change-Id: I31275ba45f5659fa7fe3988ae0f8ed3978196425
Reviewed-on: https://gerrit.libreoffice.org/64673
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I8ac3957579c76a89b9692bdb50cbe7a56e1693e3
Reviewed-on: https://gerrit.libreoffice.org/84444
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Replaced the odd HyperlinkField Edit whose text can be clicked on to activate
listeners, with an ordinary Edit and a Button beside it which can be clicked
instead to do that. I couldn't find a real world use of this HyperlinkField in
the forms or control properties, nor in casual experimentation in the sidebar
in the basicide dialog editor.
Also replaced the other strange Edit-alike TextView with a real Edit entry and
a dropdown which can be used to support entry of multi-line labels
Change-Id: Iad5265e404f6de14c8e760d617dbad49cd6ddead
Reviewed-on: https://gerrit.libreoffice.org/82213
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ibeac785fb1b1f30187fa5aa5350292bf96b307a0
Reviewed-on: https://gerrit.libreoffice.org/84489
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Ib7ea1dc2e2919430f4b3c9feb98344dbadf4a109
Reviewed-on: https://gerrit.libreoffice.org/84368
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ieee11f2ea3c5c18a84316a8b7c39a261afd720ed
Reviewed-on: https://gerrit.libreoffice.org/84308
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I0b1ae0d50fa8b4c01c36ece0fdd1c2b316ccd27b
Reviewed-on: https://gerrit.libreoffice.org/84357
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I49f9cfb4df670c68d21082a81e1a0aad225cc408
Reviewed-on: https://gerrit.libreoffice.org/84279
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ic88ed0d36f1aae9f32a0097354042526fc18d649
Reviewed-on: https://gerrit.libreoffice.org/84244
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I1e0ca144943fd37769c7b6cfc7e77c4f001b31a0
Reviewed-on: https://gerrit.libreoffice.org/84233
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
which merely announce that the next declaration is a class
Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc
Reviewed-on: https://gerrit.libreoffice.org/84229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Ib2ad0f0fe17c4db66693ef91e3cdbc8511eb8314
Reviewed-on: https://gerrit.libreoffice.org/84166
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
...with a boost::optional fallback for Xcode < 10 (as std::optional is only
available starting with Xcode 10 according to
<https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS
and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite
all code to use o3tl::optional instead of boost::optional.
One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per
fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus
-Werror=maybe-uninitialized" should no longer be necessary (and whose check
happened to no longer trigger for GCC 10 trunk, even though that compiler would
still emit bogus -Wmaybe-uninitialized for uses of boost::optional under
--enable-optimized, which made me ponder whether this switch from
boost::optional to std::optional would be a useful thing to do; I keep that
configure.ac check for now, though, and will only remove it in a follow up
commit).
Another longer-term benefit is that the code is now already in good shape for an
eventual switch to std::optional (a switch we would have done anyway once we no
longer need to support Xcode < 10).
Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses
boost::property_tree::ptree::get_child_optional returning boost::optional, so
let it keep using boost::optional for now.
After a number of preceding commits have paved the way for this change, this
commit is completely mechanical, done with
> git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g'
(before committing include/o3tl/optional.hxx, and relying on some GNU features).
It excludes some files where mention of boost::optional et al should apparently
not be changed (and the sub-repo directory stubs). It turned out that all uses
of boost::none across the code base were in combination with boost::optional, so
had all to be rewritten as o3tl::nullopt.
Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b
Reviewed-on: https://gerrit.libreoffice.org/84128
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: If7303a082e06f6937fca911c578a40475546cda2
Reviewed-on: https://gerrit.libreoffice.org/83442
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...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>
|
|
can just cast the parent member
Change-Id: I990bd4da3afbd78da819038c7907c28de87faaaf
Reviewed-on: https://gerrit.libreoffice.org/82567
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I2eab990c15f845b44a3b598571aca361dadf9ff3
Reviewed-on: https://gerrit.libreoffice.org/81946
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I7dd5fc3d53df63fd2ee2caa71586f0f5e13f187e
Reviewed-on: https://gerrit.libreoffice.org/81078
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I95e63105654952d12c1dfd62f51593de114be569
Reviewed-on: https://gerrit.libreoffice.org/81077
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|