Commit graph

1487 commits

Author SHA1 Message Date
Mike Kaganski
56f3dbffdf Simplify a bit
Change-Id: I618b0f8bcb2e8032ee12367c73e1136685f66b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176183
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-08 05:34:20 +01:00
Mike Kaganski
ad686b26ce No need to use SAL_THROW_EXTERN_C macro in CXX
Change-Id: I6eb9f0431a9402479a2d90d5b6f68b611d52a9f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-02 22:16:06 +01:00
Bogdan Buzea
0a347396d3 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 152, 194
V1037 Two or more case-branches perform the same actions. Check lines: 565, 592

Change-Id: I52ec0921c898ca74473631ba36a76f6444ce07d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175358
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-23 11:57:15 +02:00
Caolán McNamara
e1a4cdb356 cid#1555847 COPY_INSTEAD_OF_MOVE
and

cid#1555851 COPY_INSTEAD_OF_MOVE

Change-Id: I826dbd7810398bf60be64702f11b912200f16b09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172226
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-22 22:42:37 +02:00
Andrea Gelmini
c910d8cd67 Fix typo
Change-Id: Ic80446b21443a025a4d4877730ef097ba39ca66d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169752
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-29 20:17:22 +02:00
Noel Grandin
e8fdc8a4ff elide some OUString temporaries
Change-Id: I8364489639c8c02e9670ee597f48d61007244f5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166973
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-02 02:51:23 +02:00
Caolán McNamara
8dbf87595e WaE: C6011 Dereferencing NULL pointer warnings
convert OSL_ASSERT to assert, etc.

Change-Id: Idb920aab41e5d63ee07d0a8ef4c4cba1a220fc14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166850
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-04-30 18:51:12 +02:00
Caolán McNamara
a6f52af757 try to workaround clang crash
Stack dump:
 0.	Program arguments: clang++ -stdlib=libc++ -fsanitize-blacklist=/src/libreoffice/bin/sanitize-excludelist.txt -DBOOST_SYSTEM_NO_DEPRECATED -DCPPU_ENV=gcc3 -DLINUX -DNDEBUG -DOSL_DEBUG_LEVEL=0 -DUNIX -DUNX -DX86_64 -D_PTHREADS -D_REENTRANT -DCPPU_DLLIMPLEMENTATION -fvisibility=hidden -Wall -Wno-missing-braces -Wendif-labels -Wextra -Wundef -Wunreachable-code -Wshadow -Wunused-macros -Wembedded-directive -finput-charset=UTF-8 -fmessage-length=0 -fno-common -pipe -fstack-protector-strong -Wdeprecated-copy-dtor -Wimplicit-fallthrough -Wunused-exception-parameter -Wrange-loop-analysis -fvisibility-inlines-hidden -fPIC -Wshadow -Woverloaded-virtual -std=c++20 -pthread -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp -stdlib=libc++ -fexceptions -DLIBO_INTERNAL_ONLY -c /src/libreoffice/cppu/source/threadpool/current.cxx -o /work/workdir_for_build/CxxObject/cppu/source/threadpool/current.o -MMD -MT /work/workdir_for_build/CxxObject/cppu/source/threadpool/current.o -MP -MF /work/workdir_for_build/Dep/CxxObject/cppu/source/threadpool/current.d_ -I/src/libreoffice/include -I/work/config_build -I/work/workdir_for_build/UnoApiHeadersTarget/udkapi/normal
 1.	/src/libreoffice/cppu/source/threadpool/current.cxx:77:8: current parser token ';'
 2.	/src/libreoffice/cppu/source/threadpool/current.cxx:37:1: parsing namespace 'cppu'
 3.	/src/libreoffice/cppu/source/threadpool/current.cxx:41:1: parsing function body 'cppu::get_type_XCurrentContext'
 4.	/src/libreoffice/cppu/source/threadpool/current.cxx:41:1: in compound statement ('{}')
  #0 0x000000000190f863 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/clang-15+0x190f863)
  #1 0x000000000190d7ae llvm::sys::RunSignalHandlers() (/usr/local/bin/clang-15+0x190d7ae)
  #2 0x000000000190ed0d llvm::sys::CleanupOnSignal(unsigned long) (/usr/local/bin/clang-15+0x190ed0d)
  #3 0x0000000001893000 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
  #4 0x00007f628aef1420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
  #5 0x00007f628aafc963 (/lib/x86_64-linux-gnu/libc.so.6+0x18b963)
  #6 0x000000000186b31b llvm::APInt::APInt(unsigned int, llvm::ArrayRef<unsigned long>) (/usr/local/bin/clang-15+0x186b31b)
  #7 0x0000000003d5031a (anonymous namespace)::StmtPrinter::VisitUserDefinedLiteral(clang::UserDefinedLiteral*) StmtPrinter.cpp:0:0
  #8 0x0000000003d44e40 clang::Stmt::printPretty(llvm::raw_ostream&, clang::PrinterHelper*, clang::PrintingPolicy const&, unsigned int, llvm::StringRef, clang::ASTContext const*) const (/usr/local/bin/clang-15+0x3d44e40)

Change-Id: I963a7ee431748b21ab587a90208f9cdbb2df2bf9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166918
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-30 13:39:03 +02:00
Noel Grandin
60728712f0 loplugin:ostr in cppu,cppuhelper
Change-Id: I15c00d7a87396d07be2d10a0311f308a93e8eec3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-04-27 15:11:25 +02:00
Gabor Kelemen
b6f5472ea1 tdf#146619 Drop unused 'using namespace' in: cppu/ cppuhelper/
Change-Id: I4658c2a5c780fa5e8dd83381eb9978510973e0a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165511
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-29 21:20:50 +01:00
Gabor Kelemen
ab95ed2c4b Use less boost_headers in low level libraries
Most of these don't use boost themselves, nor do they need
it transitively since the use of boost::optional was removed

Change-Id: Ic9dee1c4e160b313ec5b91677b02ffdea6c5779d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164440
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-06 21:23:17 +01:00
Stephan Bergmann
822b221b3d Abort if type information is missing when creating sequences
When the typelib_TypeDescription is null, the following code would dereference a
null pointer anyway (but which doesn't necessarily cause an immediate crash on
some platforms like Wasm, so better be explicit).  (Also, leave those checks out
of functions like uno_type_sequence_realloc, which would have been preceded by a
call to one of the functions creating a sequence of the given type, and which
would thus already have detected failure to obtain the relevant type
information.)

Change-Id: I36193ea837edeca451fd09a866623cf40d3cdb4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163813
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-23 15:54:27 +01:00
Stephan Bergmann
56ceb5db4e cppumaker: Work around problematic constant named "auto"
...which had been added all the way back in 2002 with
6cd0bbd8ce "adding new file to HEAD" to constants
group css.drawing.CaptionEscapeDirection, which has meanwhile been published, so
no chance of cleaning that up.

But cppumaker already has a mechanism to work around problematic UNOIDL
identifiers, but which was only used for "new-style" entities when they got
introduced, mainly to avoid compatibility issues when retroactively changing the
code generated for existing entities.

But for C++ keywords, the generated code was always broken, so no harm in fixing
it, so introduce an additional IdentifierTranslateMode::KeywordsOnly and use
that at least for constants, to address the immediate issue.

(And with that, a hack can be removed from gb_UnoApiEmbindTarget__add_embind.)

Change-Id: I5cf62fd8b3b298dff2ec28452fb97b424a4ba473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162305
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-19 13:44:01 +01:00
Caolán McNamara
44739ff1ee cid#1546503 Using invalid iterator
and:

cid#1546480 Using invalid iterator
cid#1546479 Using invalid iterator
cid#1546454 Using invalid iterator
cid#1546419 Using invalid iterator
cid#1546410 Using invalid iterator
cid#1546150 Using invalid iterator
cid#1546039 Using invalid iterator
cid#1545831 Using invalid iterator
cid#1545736 Using invalid iterator
cid#1545701 Using invalid iterator
cid#1545630 Using invalid iterator
cid#1545381 Using invalid iterator

Change-Id: I9e151b623f751ee1e982b5da0011ff08ab0ad5e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160270
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-03 22:12:17 +01:00
Julien Nabet
d0b0908e62 c++20: use std::erase instead of std::removed followed by erase (part 2)
Change-Id: I0222f0f53f387dd57bd674b1e137b53487f4e1d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159611
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18 20:27:47 +01:00
Caolán McNamara
c5d512203e cid#1546008 silence Using invalid iterator
Change-Id: I76043da245d47d10993361235425f48b7f6d4034
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157359
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-28 13:38:40 +02:00
Noel Grandin
637cceeefb loplugin:stringadd in c*
after my patch to merge the bufferadd loplugin into stringadd

Change-Id: I66f4ce2fd87c1e12eefb14406e0e17212f68ceff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149497
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-24 15:29:18 +00:00
Stephan Bergmann
9111536f1b Introduce css.reflection.Dump singleton
...and revert e1c6f36d8b "Add a to_string()
function to the code generated for UNO IDL constant groups".  (But keep the
constants groups the latter had added to cppu/qa/cppumaker/types.idl, and use
them in the newly added CppunitTest_stoc_dump, for better or worse.)

Change-Id: I56e9eaeb1e45b83a72a25eceef13e719dc6f3a1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149281
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Jenkins
2023-03-22 08:46:35 +00:00
Tor Lillqvist
e1c6f36d8b Add a to_string() function to the code generated for UNO IDL constant groups
If the inpt matches one of the constants exactly, the result is the
name of that constant. If the input matches some combination of
constant values that are single bits, the result is the sequence of
the names of those constants joined with plus signs.

For instance, if the IDL has:

constants Constants {
    const byte BIT0 = 1;
    const byte BIT1 = 2;
    const byte BIT2 = 4;
    const byte BIT3 = 8;
}

The result of Constants::to_string(5) is "BIT0+BIT2", and the result
of Constants::to_string(17) is "17".

I am sure there are corner cases that aren't handled as would be
intuitive, especially with types that include unsigned values.
Correspondingly, the semantics of the generated to_string() functions
is not formally defined.

Also add a unit test for the new functionality.

Change-Id: I14aa826d0989ac6dfe97dd5c09119b1601c65643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148995
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2023-03-17 11:46:36 +00:00
Gabor Kelemen
c95597ac42 Drop 'using namespace ::std' in dirs b* c*
Change-Id: I59392ee7aa71c219e475a09da67a868cfdd14b41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147074
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2023-02-15 18:37:59 +00:00
Stephan Bergmann
70bcf9e8be Remove support for AIX
As discussed in the mailing list thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2023-January/089808.html>
"Plan to remove dead C++ UNO bridge implementations (bridges/source/cpp_uno/*)",
the bridge implementation at bridges/source/cpp_uno/gcc3_aix_powerpc is
apparently dead and should thus be removed.  However, that was the only bridge
implementation for AIX, which implies that support for the AIX platform as a
whole is dead and should thus be removed.

Change-Id: I96de3f7f97d4fd770ff78256f0ea435383688be9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146057
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-27 07:28:16 +00:00
Mike Kaganski
3d236177be Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name
to show that the result is not an O(U)String.

Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-11 12:46:01 +02:00
Stephan Bergmann
ca550863f7 Better cast to sal_[u]IntPtr when passing pointer to O[U]String::number
Change-Id: I5b7a0fa060c1e0ae4aa194e0c1862f303dd8a2d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138062
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-10 13:40:09 +02:00
Noel Grandin
80a900838e elide some makeStringAndClear() calls
Change-Id: Ifd8de0042b843de0766a370fb19b9f7791974612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137284
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21 11:24:10 +02:00
Stephan Bergmann
5687eba49f Drop obsolete preprocessor directives from UNOIDL files
...which were used by ildc, which is gone since
a8485d558f "[API CHANGE] Remove deprecated idlc
and regmerge from the SDK", and have always been ignored as legacy by its
unoidl-write replacement.

This change has been carried out (making use of GNU sed extensions) with

> for i in $(git ls-files \*.idl); do sed -i -z -E -e 's/\n\n((#[^\n]*\n)+\n)*(#[^\n]*\n)+\n?/\n\n/g' -e 's/\n(#[^\n]*\n)+/\n/g' "$i"; done && git checkout extensions/source/activex/so_activex.idl odk/examples/OLE/activex/so_activex.idl

which apparently happened to do the work.  (The final two files are not UNOIDL
source files.)

Change-Id: Ic9369e05d46e8f7e8a304ab01740b171b92335cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135683
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-13 16:27:45 +02:00
Stephan Bergmann
754eb1541a No need to call resume() on all already running thread
(This was there ever since the beginning in
85c2477a94 "INTEGRATION: CWS bunoexttm", while for
the similar OuterThread it was always absent.)

Change-Id: I3c43f0e35435b6035f6a1f2a1ca9f104bd639689
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135240
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-01 16:43:29 +02:00
Stephan Bergmann
db3f072dd6 New o3tl::intcmp.hxx
...introducing o3tl::cmp_equal etc. implementing C++23 std::cmp_equal etc., plus
an o3tl::IntCmp wrapper around it for convenient operator syntax

Change-Id: I1d2e0d1aef99c531039fb83de31ed8e6036fde03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135095
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-29 19:38:46 +02:00
Stephan Bergmann
c3e9eb997f [API CHANGE] Deprecate unused typelib_setCacheSize and make it a no-op
...and simplify the remaining code using the (now const) nCacheSize

Change-Id: I4468cf223c158a318ba56ba63f5f60121c94f42d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134879
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-29 16:42:33 +02:00
Michael Weghorn
123bb44f4a Extend '-Werror=attributes' workaround to GCC versions < 12.1
Adapt the GCC version check from the workaround introduced
in

    commit 2c6cea672a
    Date:   Wed May 18 10:46:55 2022 +0200

        Work around bogus -Werror=attributes with old GCC

        ...after 9c3c6a6b66 "Replace OFFSET_OF macro with
        a function template", as seen at
        <https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/38076/>,

        > /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/check.cxx:263:28: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
        >      [[maybe_unused]] Char3 chars;
        >                             ^~~~~

        (Not sure which versions of GCC are affected exactly; lets restrict this to

to all versions before 12.1.

My GCC 11.3.0 build on Debian testing failed just the
same way otherwise.

A `git log --grep=maybe_unused` in the GCC git repo suggests
that this is no longer necessary from the following
GCC 12.1 commit [1] on:

    commit c0f769fa3114ea852a26d93f0ee3f9595463de0b
    Author: Jason Merrill <jason@redhat.com>
    Date:   Fri Jun 11 16:10:50 2021 -0400

        c-family: don't warn for [[maybe_unused]] on data member

        The C++17 standard (and C2x) says that [[maybe_unused]] may be applied to a
        non-static data member, so we shouldn't warn about it.  And I don't see a
        reason not to handle a FIELD_DECL the same as any other decl, by setting
        TREE_USED on it.  It doesn't look like anything yet cares about that flag on
        a FIELD_DECL, but setting it shouldn't hurt.

        gcc/c-family/ChangeLog:

                * c-attribs.c (handle_unused_attribute): Handle FIELD_DECL.

        gcc/testsuite/ChangeLog:

                * g++.dg/ext/attrib62.C: No longer warn.
                * g++.dg/diagnostic/maybe_unused1.C: New test.

        gcc/ChangeLog:

                * doc/extend.texi (unused variable attribute): Applies to
                structure fields as well.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c0f769fa3114ea852a26d93f0ee3f9595463de0b

Change-Id: I815e4a24da13e0ae66b1dff2941e636c7ebdfd9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134653
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2022-05-23 08:46:50 +02:00
Stephan Bergmann
2c6cea672a Work around bogus -Werror=attributes with old GCC
...after 9c3c6a6b66 "Replace OFFSET_OF macro with
a function template", as seen at
<https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/38076/>,

> /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/check.cxx:263:28: error: ‘maybe_unused’ attribute ignored [-Werror=attributes]
>      [[maybe_unused]] Char3 chars;
>                             ^~~~~

(Not sure which versions of GCC are affected exactly; lets restrict this to
GCC 7 for now.)

Change-Id: I28ec8914b60c98dce769ad40ef4141aec4960aa3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134509
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-18 11:42:14 +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
e0559fb4c9 clang-tidy modernize-pass-by-value in cppu
Change-Id: I7f6432b9609d175ff7e21ff2e73991275eea60b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134473
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17 17:36:36 +02:00
Noel Grandin
f0ed5d4637 osl::Mutex->std::mutex in cppu::MappingsData
Change-Id: I34292537e9724d7667ba099285c87a32ae13ffad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134028
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-09 10:15:24 +02:00
Stephan Bergmann
cc6247a064 Just use Any ctor instead of makeAny in cppu
Change-Id: Ie178e13251b7cb1b69facbbc12e530f6dc4632ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133836
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 21:45:59 +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
cdfd4d6c9a use more string_view in cppu
Change-Id: Id6b33eb39917ce7b805ea4a5d713d5d78aaa93ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133257
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-21 15:29:33 +02:00
Stephan Bergmann
9a42c99d7b Simplify equality comparison among the various UNOIDL integer types
Change-Id: I67b11049938de470a2a5096cac376fdb0529ab5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132992
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-14 10:21:42 +02:00
Noel Grandin
a5343a89f8 use more string_view in cppu
Change-Id: Ifd2ee4827e0083ffaff9120fee239fb16553380e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132957
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 16:11: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
Noel Grandin
035c9fc7ec use more subView when converting to Int32
Change-Id: Ia1be48050cca386a6e765aa2229de1bc9e64ffff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132749
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-09 13:26:39 +02:00
Thorsten Behrens
c367a2781f WASM UNO: add a minimal dummy bridge
... and use the same fake exception rethrowing code then the
mobile platforms.

Change-Id: Ic90de1cfd1e0092d6064d041a613d60d9f5f76b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128596
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-19 14:26:09 +01:00
Stephan Bergmann
4ee0ad0541 Fix build
...after 840b4eb2f3 "Recheck modules [a-c]* with
IWYU" causing

> In file included from workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:8,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCase.h:6,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:5,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/extensions/HelperMacros.h:9,
>                  from cppu/qa/test_any.cxx:26:
> workdir/UnpackedTarball/cppunit/include/cppunit/tools/StringHelper.h: In instantiation of ‘typename std::enable_if<(! std::is_enum<_Tp>::value), std::__cxx11::basic_string<char> >::type CppUnit::StringHelper::toString(const T&) [with T = char16_t; typename std::enable_if<(! std::is_enum<_Tp>::value), std::__cxx11::basic_string<char> >::type = std::__cxx11::basic_string<char>]’:
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:74:50:   required from ‘static std::string CppUnit::assertion_traits<T>::toString(const T&) [with T = char16_t; std::string = std::__cxx11::basic_string<char>]’
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:168:58:   required from ‘void CppUnit::assertEquals(const T&, const T&, SourceLine, const std::string&) [with T = char16_t; std::string = std::__cxx11::basic_string<char>]’
> cppu/qa/test_any.cxx:282:9:   required from here
> workdir/UnpackedTarball/cppunit/include/cppunit/tools/StringHelper.h:25:9: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char16_t) [with _Traits = char_traits<char>]’
>    25 |     ost << x;
>       |     ~~~~^~~~
> In file included from ~/gcc/trunk/inst/include/c++/12.0.0/istream:39,
>                  from ~/gcc/trunk/inst/include/c++/12.0.0/sstream:38,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/portability/Stream.h:283,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:7,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCase.h:6,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:5,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/extensions/HelperMacros.h:9,
>                  from cppu/qa/test_any.cxx:26:
> ~/gcc/trunk/inst/include/c++/12.0.0/ostream:558:5: note: declared here
>   558 |     operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;
>       |     ^~~~~~~~

etc.

Change-Id: I2e6d3591dec9eeb6647738d37296c7d2bfa6a186
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128369
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-13 12:25:26 +01:00
Gabor Kelemen
840b4eb2f3 Recheck modules [a-c]* with IWYU
See tdf#42949 for motivation

Change-Id: I74a3c3a67c3639376e2251c3eb917fa4139dfbd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127808
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-13 08:26:15 +01:00
Noel Grandin
25298930bc loplugin:flatten in canvas..cui
Change-Id: I208767eaa60d913fe2882403f1f9351eb08256f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127224
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21 15:55:46 +01:00
Stephan Bergmann
45d93ea927 Fix clang-cl -Zc:dllexportInlines- build
That flag is only supported by clang-cl, not by MSVC, and
c7c9f3f57a "use clang-cl's -Zc:dllexportInlines-
for clang-cl builds" apparently naively assumed that it would work to build LO
with clang-cl and that flag without actually trying it out, and
1040228c35 "My clang-cl build does not work with
-Zc:dllexportInlines-" effectively disabled it completely.

The way to avoid unresolved external symbols during linking of URE libraries
(see the 1040228c35 commit message) is apparently
to also build libraries that the URE libraries depend on with the flag, hence
the change from gb_Library_set_is_ure_library to
gb_Library_set_is_ure_library_or_dependency.  For now, I only marked those
additional libraries (unoil and xmlreader) that actually caused issues when
linking the URE libraries.

Change-Id: I3a85c73246250981cd86b7ee41f87b41f393a4b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126012
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
2021-12-02 07:39:52 +01:00
Noel Grandin
f381c353b4 BaseList doesn't need set member after the constructor is done
Change-Id: Idc174a0cd53c45beba3100b1f8258e6839291be8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124885
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-09 09:17:34 +01:00
Noel Grandin
b3c6b3a274 rtl::Static to thread-safe static
Change-Id: I35e2a252708228bdbeaee557ef35763c64608653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124884
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-09 08:28:56 +01:00
Mike Kaganski
58edf89898 d46f659c75 follow-up: simplify checks
Change-Id: Ib95e7c562741f76a742cd31aa033956a0f0a3c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124169
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 23:09:34 +02:00
Mike Kaganski
370c9d725a d46f659c75 follow-up: add unit test
Change-Id: I34be2bc813bf0d62cac935a84c6371cd64ee68f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124168
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 21:37:09 +02:00
Mike Kaganski
d46f659c75 Make sure that self-assign test checks types
This may be important with static empty sequence cppu::g_emptySeq, that is
common for sequences of different types.

The changes in sd/qa/unit/data/xml/*.xml fix places where anys with empty
Sequence<OUString> used to wrongly take 'if(aAny >>= aPropSeq)' branch in
dumpPropertyValueAsElement (drawinglayer/source/dumper/XShapeDumper.cxx).

Change-Id: I5b0544ca94b30437c01dd46f376408f91510bcb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124167
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26 07:19:40 +02:00