Commit Graph

2646 Commits

Author SHA1 Message Date
6b00d0576a Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b)
...by re-enabling the code temporarily #if'ed-out in
a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved
loplugin:cppunitassertequals" (and which then triggers lots of other
lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings).

For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it
was more straightforward to rewrite them with an explicit call to operator ==
(which silences loplugin:cppunitassertequal) than to adapt them to
CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types.

In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been
implemented trivially for now, but might want to combine that with the
DEBUG_PIVOT_TABLE-only ScDPItemData::Dump.

Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-08 09:15:01 +01:00
7529dbcb24 Make loplugin:cppunitassetequals diagnostic more informative
...which will come in handy for a later improvement of that plugin

Change-Id: I548b9388bee60b381c0a2c820f20f596aa0072f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110453
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05 21:58:41 +01:00
404f14ce91 Clean up SmColorTokenTableEntry
Remove useless member SmColorTokenTableEntry::cIdent
aColorTokenTableDVIPS renamed (make the loop enter in one line)
removed redundant code in visitors (related to color)
removed temporal variables on visitors (related to color)
removed temporal variables on mthmlexport (related to color)
removed redundant code in mathmlexport (related to color)
Since SmColorTokenTableEntry is used as pointer remove useless operators

Change-Id: Icef831711c95e4f9c23b29a3a3606dd9d6fcf6c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110321
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-03 07:56:45 +01:00
dec14c4a07 Avoid --disable-assert-always-abort loplugin:stringviewparam false positives
...like

> l10ntools/source/helper.cxx:19:69: error: replace function parameter of type 'const rtl::OString &' with 'std::string_view' [loplugin:stringviewparam]
>     const OString& rText, const OString& rUnEscaped, const OString& rEscaped )
>                                                      ~~~~~~~~~~~~~~~^~~~~~~~

where the call to rEscaped.getLength(), which would otherwise suppress the
warning, is hidden inside an assert.

(Similar to aab0322580c87864a4f0c0af1fed07282c8dccbb "Disable
loplugin:casttovoid when --disable-assert-always-abort".)

Change-Id: Ie054f75317707757b1c6243c593f539d445a9fee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110331
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-02 20:45:24 +01:00
068d4108e5 loplugin:redundantcast catch more dynamic_cast
Change-Id: Ia28e58217cefa306567b53688d851fa210b7821c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110287
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-02 12:24:00 +01:00
1250aecd71 loplugin:stringviewparam extend to new..
O[U]StringBuffer methods

Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-29 09:25:12 +01:00
1da6908173 add string_view variants of methods to O[U]StringBuffer
and update the stringview loplugin to detect cases where we can
use these new methods.

Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28 11:11:28 +01:00
aa2064c5c5 Improve loplugin:stringliteralvar
...to also consider O[U]String ctors taking pointer and length

Change-Id: Iea5041634bfbf5054a1317701e30b56f72e940fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110025
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-27 23:24:42 +01:00
2682feb036 Adapt loplugin:stringconstant to many functions taking string_view args now
So look through (implicit) O[U]String to string_view conversions for those
arguments.

Change-Id: I1101d3f681d227ad0a76a4477bf52a1a3898cfdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109926
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-26 08:42:09 +01:00
506036ba3f clang/constfieldsrewrite.cxx: Remove duped lines
Spotted by cppcheck.
A duplicated if and comment; looks like a merge screwup ?

Change-Id: Iceed88d85d42be601975b7a1daff7a1f002644d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-25 14:30:36 +01:00
6907cbb897 improve loplugin:pointerbool
to look through template instantiations involving std::forward

motivated by
    commit b1617acde182d1683bdfb529794d7456f8b4bf6d
    drop RadioButton arg defaults
    the nBits arg in builder.cxx was in the wrong place

Change-Id: I222ea2aeea6f44ae54839e824a247a8105392c2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-22 17:46:01 +01:00
af34108d90 Use C++20 consteval for the Color(sal_uInt32) ctor
...to make it more obvious that, since 63a68064bb33f180b8a231f7524d99405d910226
"make the Color constructors explicitly specify transparency", it should only be
called when the argument is known at compile-time to have no transparency/alpha
channel.

(This revealed a GCC bug causing bogus

> xmloff/source/chart/ColorPropertySet.cxx: In constructor ‘xmloff:💹:ColorPropertySet::ColorPropertySet(Color)’:
> xmloff/source/chart/ColorPropertySet.cxx:81:9: error: ‘this’ is not a constant expression
>    81 |         m_nDefaultColor( 0x0099ccff )  // blue 8
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

so in configure.ac suppress HAVE_CPP_CONSTEVAL when the compiler is found
broken.)

Change-Id: I68df7bd5fbd9b2dcf2243b5a4bde4064d3d665fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109697
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-21 07:58:02 +01:00
db1561f051 Build compilerplugings code with -fvisibility-inlines-hidden
Even though `llvm-config --cxxflags` does not reflect it, LLVM generally uses
-fvisibility-inlines-hidden on Unix-like platforms at least since <https:
//github.com/llvm/llvm-project/commit/6b43f1f40f644b896f44078872c0b93ec3afef67>
"[CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=Off" debuting
in release/3.8.x.

At least with my build on macOS 11.1 ARM64 against recent LLVM 12 trunk, that
caused a mismatch between

> $ nm -m compilerplugins/clang/sharedvisitor/analyzer.o | grep __ZGVZNK5clang24TemplateTemplateParmDecl18getDefaultArgumentEvE7NoneLoc
> 0000000000028038 (__DATA,__data) weak external __ZGVZNK5clang24TemplateTemplateParmDecl18getDefaultArgumentEvE7NoneLoc

and

> $ nm -m ~/llvm/inst/lib/libclangAST.a\(JSONNodeDumper.cpp.o\) | grep __ZGVZNK5clang24TemplateTemplateParmDecl18getDefaultArgumentEvE7NoneLoc
> 000000000001ccf0 (__DATA,__data) weak private external __ZGVZNK5clang24TemplateTemplateParmDecl18getDefaultArgumentEvE7NoneLoc

etc., causing (albeit harmless) warnings

> [GEN] compilerplugins/clang/sharedvisitor/analyzer
> ld: warning: direct access in function 'clang::JSONNodeDumper::VisitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl const*)' from file '~/llvm/inst/lib/libclangAST.a(JSONNodeDumper.cpp.o)' to global weak symbol 'guard variable for clang::TemplateTemplateParmDecl::getDefaultArgument() const::NoneLoc' from file 'compilerplugins/clang/sharedvisitor/analyzer.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
[...]

-fvisibility-inline-hidden is presumably supported by all
$(COMPILER_PLUGINS_CXX) used on non-Windows platforms in the wild, so lets be
bold and add it unconditionally.

Change-Id: I0d405b4f57066baa098977e65e5ba4a3a47575c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109712
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-20 22:17:35 +01:00
4b55847b81 Improve loplugin:doubleconvert
(The use of isa_and_nonnull<> instead of isa<> is necessary for cases like

  return (i_styleSettings.*i_getDefaultColor)();

in lcl_getEffectiveColor, svtools/source/table/gridtablerenderer.cxx.)

Change-Id: Iffc59b1146dd4ce13bbd3c8a6f46bd3c78a39344
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109663
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-20 11:27:33 +01:00
750d96706c loplugin:unusedmethods
GtkPrintWrapper stuff is dead since

    commit ed07ec7606cb24cccaf6b7b81b2bd308debaa2e6
    drop never completed GtkSalPrinter

Change-Id: Ia42e9bca020a9683ba247d466f743a0018e920f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109618
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-19 18:24:25 +01:00
e552ddda9a Mathml gets it's own directory
It has grown recently and is going to grow more.
cfgitem.hxx has been moved and clangformated because it is not anymore in excludelist

Change-Id: I277837b2c0a90ae4e84028dc6e19962939c1aef3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-18 13:12:27 +01:00
63a68064bb make the Color constructors explicitly specify transparency
to reduce the churn, we leave the existing constructor in place,
and add a clang plugin to detect when the value passed to the
existing constructor may contain transparency/alpha data.

i.e. we leave expressions like Color(0xffffff) alone, but
warn about any non-constant expression, and any expression
like Color(0xff000000)

Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16 10:07:07 +01:00
9013666c5a cid#1471346 Uncaught exception
Change-Id: I535affd6597636aa32e1cf9c6005238f9503ef6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109266
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-14 20:22:35 +01:00
94f6765d6e Avoid loplugin:stringviewparam when there already is a string_view overload
This avoids clang-cl

> In file included from core/connectivity/source/drivers/ado/Aolevariant.cxx:20:
> connectivity/source/inc\ado/Aolevariant.hxx(72,40): error: replace function parameter of type 'const rtl::OUString &' with 'std::u16string_view' [loplugin:stringviewparam]
>             OLEVariant(const OUString& us)
>                        ~~~~~~~~~~~~~~~~^~

which would make that OLEVariant ctor overload redundant with the existing

  OLEVariant(std::u16string_view us);

overload, but with the OUString overload gone, implicit conversions from
OUString to OLEVariant would no longer work, e.g.,

> connectivity/source/drivers/ado/AColumn.cxx(184,76): error: no viable conversion from 'rtl::OUString' to 'const connectivity::ado::OLEVariant'
>             OTools::putValue(m_aColumn.get_Properties(), sAdoPropertyName, getString(rValue));
>                                                                            ^~~~~~~~~~~~~~~~~

Change-Id: I92a5cc29d9fd2a5ff1a951f79df64879d0f71743
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109180
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-12 22:28:18 +01:00
f2e4451372 loplugin:unusedfields
Change-Id: I0599f33ef4c0070e6ce61b0041db074cce217349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108659
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-06 07:42:55 +01:00
c34e8bd713 loplugin:stringviewparam: operator +=
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-04 15:29:54 +01:00
1f1f68d6e8 Bump copyright year to 2021
Change-Id: I3159bfc21a35fc80aef57c7d809d8ea8c62a732e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108566
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-01-03 00:15:27 +01:00
042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
9013dc1650 Simplify loplugin:stringviewparam comparison operator handling
In practice, it works fine to look at all of them, regardless of actual argument
types.

Change-Id: Ifc49cbcd6003c8837c1b3f81d432c59fb0657bf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108366
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-27 11:26:32 +01:00
86c943b15d Cleanups after vcl/bitmapaccess.hxx splitting
Change-Id: I5a24fb984ba6fbfc2b316420d5ffa372f35ce061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108318
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-12-26 21:00:52 +01:00
a3d0091d18 New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.

(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)

Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26 14:51:15 +01:00
68a3c364f7 Don't call isIntegerConstantExpr on value dependent Expr
...as it causes Clang to fail with

> Assertion failed: (!isValueDependent() && "Expression evaluator can't be called on a dependent expression."), function isIntegerConstantExpr, file .../llvm/llvm-project/clang/lib/AST/ExprConstant.cpp, line 15487.

Change-Id: I335f7610955c30a5c102bfb3b8aa6441a30dd247
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108241
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-23 20:47:47 +01:00
cf7306194f No longer need to worry about ambiguous operator== in loplugin:stringviewparam
...after 46c5de832868d2812448b2caace3eeaa9237b9f6 "make *String(string_view)
constructors explicit"

Change-Id: I6e884c762a2fc91f5dd6fbb197a596fd60f17cae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108043
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-20 13:07:02 +01:00
746da2e47d Related tdf#138715: kill last Mork refs
Change-Id: Id655f533a6957257329f9c1f9e4c082516e149f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107978
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-12-19 09:52:31 +01:00
e27f6852d2 Various minor loplugin fixes (macOS ARM64), redux
Change-Id: I720dde70c6f6ca6c25d7b430f117ea578a25f34e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107922
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-17 22:36:08 +01:00
c1625e807f tdf#138715 remove mork strings and install targets
Hopefully fixes the package build. Regression from commit
ee9ed2192b56c98e5b8ee9890ddb4c533117332a ("tdf#138715 remove mork
driver").

Change-Id: I0faad65af834e3668c9845eadfe3439ae57b3699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107692
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-12-14 16:16:09 +01:00
c521e61435 loplugin:unusedenumconstants
Change-Id: I49996ad433409a9189c0f7adc997858e1512f40c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107687
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 14:34:06 +01:00
d98cf29aa4 loplugin:singlevalfields
Change-Id: I31107d4e3b3bd175187a8c29a094a4c6acf2a87c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107686
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 14:33:28 +01:00
fdeff6cfc0 loplugin:unusedfields
Change-Id: I73c49b83f5c1ef17fbff18af675e95d2f2a7b243
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107685
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 14:33:11 +01:00
dbe467b6c2 loplugin:unusedmethods
Change-Id: I442d99e8f6a7df11dc950c5073f683bffc41a852
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107661
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 10:03:56 +01:00
07f7afec78 loplugin:unnecessaryvirtual
Change-Id: Ie083afe2763b21e0abada228e4007b9b387c2d39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107660
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 08:37:34 +01:00
b342342722 loplugin:unusedfields
Change-Id: Ib04b32654f005a879d52b880bc3787bbbab09372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107659
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-14 07:47:16 +01:00
ee9ed2192b tdf#138715 remove mork driver
since TB moved to sqlite

Change-Id: Ifddf1a6c9783a294ee9ccfac667c7e798674d7a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107574
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-12-13 17:29:09 +01:00
35e471bb4d Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY.  These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).

This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).

The improvement to loplugin:stringadd became necessary to fix

> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.

Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11 21:25:10 +01:00
df810a8205 Fix loplugin:stringviewparam handling of comparison operators
Change-Id: I58456efb9588b544d998ac6a4c27d55457280742
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107510
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-09 23:31:17 +01:00
ff8d82dc4c Improve loplugin:stringview diagnostic messages
Change-Id: If1b94de205fb9c1cc0491603f27073dfde67a485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107511
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-09 23:25:00 +01:00
e1e4edd4d1 loplugin:singlevalfields update to python3
Change-Id: I1257b7b865caa356c85eeeb45a19a537fc434ac5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107368
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-08 11:26:53 +01:00
b541cd9a80 loplugin:unusedmethods
Change-Id: Ib51fd610c5188fe95872d509f004ae88f38c5417
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107351
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07 16:59:28 +01:00
039a87fb10 loplugin:unusedfields
Change-Id: Ia02d8359e0158c7658ac3abcaf2b6c19a3b33131
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107348
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07 15:03:25 +01:00
a5dea5aacd loplugin:unnecessaryvirtual
Change-Id: Ie9b6a588e23453aac49ba44e5c50ae70a5fb866a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07 15:03:13 +01:00
ec4daaea90 Ignore unparsed function template bodies in loplugin:unusedvariablecheck
Otherwise, clang-cl would have reported a false positive at

> In file included from C:/lo-clang/core/vcl/source/window/builder.cxx:74:
> C:/lo-clang/core/vcl/inc\jsdialog/jsdialogbuilder.hxx(176,26): error: unused parameter 'sTypeOfJSON' [loplugin:unusedvariablecheck]
>              std::string sTypeOfJSON)
>                          ^

Change-Id: I14420cf6712a6a18e0d341a5b00e38dff5f6c92e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107330
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-07 10:20:25 +01:00
ef80ef57f5 call createFastChildContextFallback in more places
to make my fastparser work easier to manage

Change-Id: If98592f016cd35ca13b48d9df363e32fb1095b55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-04 20:19:32 +01:00
6c905fb643 Improve loplugin:stringview detection of unnecessary O[U]String construction
Change-Id: Ia45119e11377e916a1e1deb5648ed9033c417d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107228
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-04 17:54:48 +01:00
0124111394 Replace unowinreg.dll with execution of reg QUERY
The SDK's <https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/
Transparent_Use_of_Office_UNO_Components> on all platforms included the Windows-
specific unowinreg.dll in generated jars (so that those jars, when distributed
to a Windows environment, would find a LO installation by inspecting the Windows
registry).  That unowinreg.dll was originally built as a 32-bit DLL (though when
building a 64-bit Windows LO, it happened to be built as a 64-bit DLL).  For
non-Windows LO builds, it could either be built locally with a MinGW toolchain
(--enable-build-unowinreg) or downloaded from dev-www.libreoffice.org.

However, that had various issues:

For one, unowinreg.dll was not necessarily available in a distributed jar as a
64-bit DLL for use with a 64-bit JRE on Windows.  (Theoretically, running such a
jar with a 32-bit JRE to access a 64-bit LO installation's URE jars could have
worked.  But practically, those URE jars in turn require native DLLs, which
would then not have been available as 32-bit DLLs for use in the 32-bit JRE.)

For another, at least the unowinreg.dll resulting from --enable-build-unowinreg
on Fedora 33 would have had a dependency on libgcc_s_dw2-1.dll that would
generally not have been available in a target Windows environment.

There appears to be no pure Java way to read the Windows registry, but instead
of using a native code DLL for that, it appears to work just as well to call out
to reg.exe and parse its output.

This removes the --enable-build-unowinreg and --with-mingw-cross-compiler
configuration options.  (The sole use of the MinGW toolchain in LO was for
building unowinreg.dll.)

Change-Id: I3283ea38c884d3221a205e5ab6ec99a2691ef474
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107140
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2020-12-03 15:01:00 +01:00
8332d6d820 loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-30 12:32:14 +01:00