Commit graph

3323 commits

Author SHA1 Message Date
Mike Kaganski
2ef6b7f9db Drop some OTypeCollection uses
Change-Id: Ia1467c44998961f5e0820fb4d0621a4189d49d9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178095
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-08 19:07:31 +01:00
Mike Kaganski
8fdef54870 Simplify OPropertyContainer::getBaseTypes
Change-Id: I438d510e05329163dabdc8ed42d3a97d49e19ef9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178055
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 21:55:58 +01:00
Mike Kaganski
04c62acc63 Use std::initializer_list, C-style array instead of more expensive Sequence
Change-Id: Ibb268268926cc91f595f19026f6cee4b5a74a8bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178038
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 19:10:08 +01:00
Caolán McNamara
8c1dbd3188 cid#1607542 COPY_INSTEAD_OF_MOVE
and

cid#1606986 COPY_INSTEAD_OF_MOVE
cid#1557969 COPY_INSTEAD_OF_MOVE
cid#1557837 COPY_INSTEAD_OF_MOVE
cid#1557772 COPY_INSTEAD_OF_MOVE
cid#1557735 COPY_INSTEAD_OF_MOVE
cid#1557672 COPY_INSTEAD_OF_MOVE
cid#1557664 COPY_INSTEAD_OF_MOVE
cid#1557650 COPY_INSTEAD_OF_MOVE
cid#1557642 COPY_INSTEAD_OF_MOVE
cid#1557639 COPY_INSTEAD_OF_MOVE
cid#1557628 COPY_INSTEAD_OF_MOVE
cid#1557623 COPY_INSTEAD_OF_MOVE
cid#1557581 COPY_INSTEAD_OF_MOVE
cid#1557489 COPY_INSTEAD_OF_MOVE
cid#1557473 COPY_INSTEAD_OF_MOVE
cid#1557317 COPY_INSTEAD_OF_MOVE
cid#1557261 COPY_INSTEAD_OF_MOVE
cid#1557146 COPY_INSTEAD_OF_MOVE
cid#1557135 COPY_INSTEAD_OF_MOVE
cid#1557134 COPY_INSTEAD_OF_MOVE
cid#1557079 COPY_INSTEAD_OF_MOVE
cid#1557063 COPY_INSTEAD_OF_MOVE
cid#1557052 COPY_INSTEAD_OF_MOVE
cid#1556982 COPY_INSTEAD_OF_MOVE
cid#1556977 COPY_INSTEAD_OF_MOVE
cid#1556950 COPY_INSTEAD_OF_MOVE
cid#1556943 COPY_INSTEAD_OF_MOVE
cid#1556804 COPY_INSTEAD_OF_MOVE
cid#1556736 COPY_INSTEAD_OF_MOVE
cid#1556658 COPY_INSTEAD_OF_MOVE
cid#1556621 COPY_INSTEAD_OF_MOVE
cid#1556590 COPY_INSTEAD_OF_MOVE
cid#1556579 COPY_INSTEAD_OF_MOVE
cid#1556534 COPY_INSTEAD_OF_MOVE
cid#1556524 COPY_INSTEAD_OF_MOVE
cid#1556478 COPY_INSTEAD_OF_MOVE
cid#1556467 COPY_INSTEAD_OF_MOVE
cid#1556422 COPY_INSTEAD_OF_MOVE
cid#1556314 COPY_INSTEAD_OF_MOVE
cid#1556309 COPY_INSTEAD_OF_MOVE
cid#1556258 COPY_INSTEAD_OF_MOVE
cid#1556143 COPY_INSTEAD_OF_MOVE
cid#1556119 COPY_INSTEAD_OF_MOVE
cid#1556101 COPY_INSTEAD_OF_MOVE
cid#1556097 COPY_INSTEAD_OF_MOVE
cid#1556039 COPY_INSTEAD_OF_MOVE
cid#1555966 COPY_INSTEAD_OF_MOVE
cid#1555948 COPY_INSTEAD_OF_MOVE
cid#1555915 COPY_INSTEAD_OF_MOVE
cid#1555836 COPY_INSTEAD_OF_MOVE
cid#1555748 COPY_INSTEAD_OF_MOVE
cid#1555644 COPY_INSTEAD_OF_MOVE
cid#1555582 COPY_INSTEAD_OF_MOVE
cid#1555478 COPY_INSTEAD_OF_MOVE
cid#1555475 COPY_INSTEAD_OF_MOVE
cid#1555409 COPY_INSTEAD_OF_MOVE
cid#1555372 COPY_INSTEAD_OF_MOVE
cid#1555334 COPY_INSTEAD_OF_MOVE
cid#1555330 COPY_INSTEAD_OF_MOVE
cid#1555310 COPY_INSTEAD_OF_MOVE
cid#1555257 COPY_INSTEAD_OF_MOVE
cid#1555247 COPY_INSTEAD_OF_MOVE
cid#1555147 COPY_INSTEAD_OF_MOVE
cid#1555120 COPY_INSTEAD_OF_MOVE
cid#1555059 COPY_INSTEAD_OF_MOVE
cid#1555016 COPY_INSTEAD_OF_MOVE
cid#1554880 COPY_INSTEAD_OF_MOVE
cid#1554824 COPY_INSTEAD_OF_MOVE
cid#1554808 COPY_INSTEAD_OF_MOVE
cid#1546189 COPY_INSTEAD_OF_MOVE

Change-Id: I2d2f33c603f1596228c9ecb169472ba6751e7826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177593
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-30 22:39:23 +01:00
Tomaž Vajngerl
dee760e92c comphelper: put each Crypto impl. in own file - minimize ifdefs
This puts NSS and OpenSSL implementations into own classes and
adds an interface to make this possible. The implementation is
now determined in Library_comphelper.

Change-Id: I4918f19bca0adfd2f9180fb418d1bd57bb83982d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177383
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-28 09:50:08 +01:00
Tomaž Vajngerl
8f2bf78a55 comphelper: fix test - key should be 32 bytes, not 16 bytes
Issue spotted when trying encryption and decryption with OpenSSL,
which doesn't handle the shorter keys correctly.

Also can't use the same instance of Encrypt after an attempt that
failed  (0 bytes written) as the blocks are inter-dependent and
it looks like OpenSSL already changes the state.

Change-Id: I061764e6727c7fbe600e11c5a5a6b8889d15c4e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177305
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2024-11-26 03:54:55 +01:00
Tomaž Vajngerl
5e0c670e65 comphelper: add support for AES256_ECB encryption
Change-Id: I5e8ab2a2be6ea9cd5d1ed93b70780f1f6153f3fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176892
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-26 01:36:07 +01:00
Tomaž Vajngerl
626c184f77 crypto: add AES256 test, document Encrypt, Hash conv. function
This adds AES256 test of encryption and decryption - an example
on how the Encrypt and Decrypt classes are used.

Also add a convenience function for Hash, accepting vector of
bytes as this is used in a lot of places.

Change-Id: I9b395c7afb8fac45cae8d7d8bd983f5daaafd64b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176887
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-22 07:19:30 +01:00
Noel Grandin
193207c5ab improve loplugin passparamsbyref
I think I managed to disable this when I converted it to
use the shared plugin infrastructure.

So fix that, and then make it much smarter to avoid various
false positives.

Change-Id: I0a4657cff3b40a00434924bf764d024dbfd7d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-19 07:46:25 +01:00
Stephan Bergmann
86b86ac87e Give DocumentEventHolder (aka EventHolder<DocumentEvent>) a key function
...that is not inline, so that RTTI and vtable are not emitted for each dynamic
library individually.  (Where they would be internal on macOS, which could break
optimized uses of dynamic_cast for that final class just checking vtable pointer
identity, as could happen for the dynamic_cast at
dbaccess/source/core/dataaccess/documenteventnotifier.cxx:232:51,

>   232 |         const DocumentEventHolder& rEventHolder = dynamic_cast< const DocumentEventHolder& >( _rEvent );
>       |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And with the extern explicit template instantiation, EventHolder needs to be
SAL_DLLPUBLIC_TEMPLATE instead of just SAL_DLLPUBLIC_RTTI now, so that
Library_comphelper will export the DocumentEventHolder ctors and
DocumentEventHolder::getEventObject.)

(This would ideally have been caught by an upcoming improvement of
loplugin:dyncastvisibility, but might be complicated to check there for template
instantiations.)

Change-Id: I1e6280b185535968a870fbfadaff6238d38858e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176547
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-11-14 11:10:30 +01:00
Mike Kaganski
1180b3473a com::sun::star -> css
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-10 10:50:15 +01:00
Noel Grandin
5fe9b3df62 loplugin:reftotemp in codemaker..connectivity
Change-Id: I9da2976410f7c4da8ab0d85150fc87f2b3df9e0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176275
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-08 17:33:29 +01:00
Noel Grandin
ed0b12f4ea no need to take a copy of the getProcessComponentContext return value
we can just take a "const &".

(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)

Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-11-08 15:23:52 +01:00
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
Bogdan Buzea
0481c2c75e tdf#163486: PVS: Redundant code.
V649 There are two 'if' statements with identical conditional expressions. The first 'if' statement contains function return. This means that the second 'if' statement is senseless. Check lines: 212, 216.

Change-Id: Id596419cc3134355904b4ca93a44c017ffa6635c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175153
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-06 18:52:30 +01:00
Caolán McNamara
92f5913aef cid#1556442 COPY_INSTEAD_OF_MOVE
and

cid#1607753 COPY_INSTEAD_OF_MOVE
cid#1554790 COPY_INSTEAD_OF_MOVE
cid#1556463 COPY_INSTEAD_OF_MOVE
cid#1554838 COPY_INSTEAD_OF_MOVE
cid#1556231 COPY_INSTEAD_OF_MOVE
cid#1556878 COPY_INSTEAD_OF_MOVE
cid#1554913 COPY_INSTEAD_OF_MOVE
cid#1558064 COPY_INSTEAD_OF_MOVE
cid#1557043 COPY_INSTEAD_OF_MOVE
cid#1556985 COPY_INSTEAD_OF_MOVE
cid#1556766 COPY_INSTEAD_OF_MOVE
cid#1557351 COPY_INSTEAD_OF_MOVE
cid#1554863 COPY_INSTEAD_OF_MOVE
cid#1556764 COPY_INSTEAD_OF_MOVE
cid#1556279 COPY_INSTEAD_OF_MOVE
cid#1555970 COPY_INSTEAD_OF_MOVE
cid#1556942 COPY_INSTEAD_OF_MOVE
cid#1557964 COPY_INSTEAD_OF_MOVE
cid#1555166 COPY_INSTEAD_OF_MOVE
cid#1556496 COPY_INSTEAD_OF_MOVE
cid#1557175 COPY_INSTEAD_OF_MOVE
cid#1558054 COPY_INSTEAD_OF_MOVE
cid#1557392 COPY_INSTEAD_OF_MOVE
cid#1557850 COPY_INSTEAD_OF_MOVE
cid#1555118 COPY_INSTEAD_OF_MOVE
cid#1557131 COPY_INSTEAD_OF_MOVE
cid#1556614 COPY_INSTEAD_OF_MOVE
cid#1609650 COPY_INSTEAD_OF_MOVE
cid#1555114 COPY_INSTEAD_OF_MOVE
cid#1555241 COPY_INSTEAD_OF_MOVE
cid#1555442 COPY_INSTEAD_OF_MOVE
cid#1556473 COPY_INSTEAD_OF_MOVE
cid#1557654 COPY_INSTEAD_OF_MOVE
cid#1554689 COPY_INSTEAD_OF_MOVE
cid#1556316 COPY_INSTEAD_OF_MOVE
cid#1557929 COPY_INSTEAD_OF_MOVE
cid#1554807 COPY_INSTEAD_OF_MOVE
cid#1554858 COPY_INSTEAD_OF_MOVE
cid#1555103 COPY_INSTEAD_OF_MOVE
cid#1555517 COPY_INSTEAD_OF_MOVE
cid#1556424 COPY_INSTEAD_OF_MOVE
cid#1557252 COPY_INSTEAD_OF_MOVE
cid#1557566 COPY_INSTEAD_OF_MOVE
cid#1608020 COPY_INSTEAD_OF_MOVE
cid#1557742 COPY_INSTEAD_OF_MOVE
cid#1555884 COPY_INSTEAD_OF_MOVE
cid#1554809 COPY_INSTEAD_OF_MOVE
cid#1555336 COPY_INSTEAD_OF_MOVE
cid#1555173 COPY_INSTEAD_OF_MOVE
cid#1556067 COPY_INSTEAD_OF_MOVE
cid#1557040 COPY_INSTEAD_OF_MOVE
cid#1556235 COPY_INSTEAD_OF_MOVE
cid#1557366 COPY_INSTEAD_OF_MOVE
cid#1555910 COPY_INSTEAD_OF_MOVE
cid#1556716 COPY_INSTEAD_OF_MOVE
cid#1558022 COPY_INSTEAD_OF_MOVE
cid#1555769 COPY_INSTEAD_OF_MOVE
cid#1555940 COPY_INSTEAD_OF_MOVE
cid#1557077 COPY_INSTEAD_OF_MOVE
cid#1555270 COPY_INSTEAD_OF_MOVE
cid#1555660 COPY_INSTEAD_OF_MOVE
cid#1556302 COPY_INSTEAD_OF_MOVE
cid#1555678 COPY_INSTEAD_OF_MOVE
cid#1556538 COPY_INSTEAD_OF_MOVE
cid#1557689 COPY_INSTEAD_OF_MOVE
cid#1555009 COPY_INSTEAD_OF_MOVE
cid#1555433 COPY_INSTEAD_OF_MOVE
cid#1555671 COPY_INSTEAD_OF_MOVE
cid#1555255 COPY_INSTEAD_OF_MOVE
cid#1557681 COPY_INSTEAD_OF_MOVE
cid#1557512 COPY_INSTEAD_OF_MOVE
cid#1554958 COPY_INSTEAD_OF_MOVE
cid#1555758 COPY_INSTEAD_OF_MOVE
cid#1555597 COPY_INSTEAD_OF_MOVE
cid#1558040 COPY_INSTEAD_OF_MOVE
cid#1556476 COPY_INSTEAD_OF_MOVE
cid#1557646 COPY_INSTEAD_OF_MOVE
cid#1557950 COPY_INSTEAD_OF_MOVE
cid#1557019 COPY_INSTEAD_OF_MOVE
cid#1557885 COPY_INSTEAD_OF_MOVE
cid#1556402 COPY_INSTEAD_OF_MOVE
cid#1557906 COPY_INSTEAD_OF_MOVE
cid#1556619 COPY_INSTEAD_OF_MOVE
cid#1554683 COPY_INSTEAD_OF_MOVE
cid#1556549 COPY_INSTEAD_OF_MOVE
cid#1554747 COPY_INSTEAD_OF_MOVE
cid#1554929 COPY_INSTEAD_OF_MOVE
cid#1555362 COPY_INSTEAD_OF_MOVE
cid#1557053 COPY_INSTEAD_OF_MOVE
cid#1557891 COPY_INSTEAD_OF_MOVE
cid#1555043 COPY_INSTEAD_OF_MOVE
cid#1555107 COPY_INSTEAD_OF_MOVE
cid#1557203 COPY_INSTEAD_OF_MOVE
cid#1556728 COPY_INSTEAD_OF_MOVE
cid#1557773 COPY_INSTEAD_OF_MOVE
cid#1556845 COPY_INSTEAD_OF_MOVE

Change-Id: I001fb67e597b096e992fd8a0cd6f3ec577767c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176098
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-06 13:58:54 +01:00
Noel Grandin
47a1dccd17 loplugin:passstuffbyref in comphelper
Change-Id: I2c94b6e0bbdce4f4236815df8c4841327a33939e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176053
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-06 09:25:20 +01:00
Miklos Vajna
ad3f929a73 comphelper: test uno::Any parsing from JSON
Fails with commit cccbf8608f3b76651993bc8576c672367c228fa2 (feat(json):
Allow serializing any, 2024-10-16) reverted.

Change-Id: Ifd59f9921f89cc4f52a21a597f433684c715f186
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176044
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-05 14:19:10 +01:00
Stephan Bergmann
bb9090c60b Fix USE_TLS_OPENSSL builds
...after c8cba8ae30 "move CryptTools from oox to
comphelper so we can reuse it"

Change-Id: Id899c9fac9f18833afd64f18d81a7ad50916872e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176041
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-11-05 10:03:35 +01:00
Tomaž Vajngerl
c8cba8ae30 move CryptTools from oox to comphelper so we can reuse it
Also move the relevant tests and clean-up the names a bit to make
it mroe consistent.

Change-Id: I929ef9c13b954fd6a506471231d1bc41e4ef9980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176027
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-04 21:51:32 +01:00
Tomaž Vajngerl
c749c21c5a comphelper: move tostring to hash.hxx so it can be reused
tostring to convert a vector of bytes into a hex string is useful
in other tests and implementation, so move it into common hash.hxx

Change-Id: Iebc71919c6209222eb01b78c307420afddc8caca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176020
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-04 21:19:51 +01:00
Skyler Grey
3a9caad863 feat(json): Allow serializing any
Previously, as far as I can tell, there was no way to send a Size in a
.uno command (as would be needed in, say, '.uno:InsertAVMedia').

We do, however, already have a way to send an `[]any`, and we can use a
similar method to allow sending arbitrary types with `any` rather than
`[]any`.

To use this, the type you really want to send has to be wrapped in any,
so for example...

{
  type: "any",
  value: {
    type: "com.sun.star.awt.Size",
    value: {
      Width: {
        type: "long",
	value: 0,
      },
      Height: {
        type: "long",
	value: 0,
      }
    }
  }
}

Change-Id: Ic33594dee955d475d81733adb21950c0458435e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174740
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit cccbf8608f3b76651993bc8576c672367c228fa2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175982
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-04 09:39:27 +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
Caolán McNamara
0c6e26890a cid#1556875 COPY_INSTEAD_OF_MOVE
and

cid#1556891 COPY_INSTEAD_OF_MOVE
cid#1556903 COPY_INSTEAD_OF_MOVE
cid#1556917 COPY_INSTEAD_OF_MOVE
cid#1556925 COPY_INSTEAD_OF_MOVE
cid#1557021 COPY_INSTEAD_OF_MOVE
cid#1557092 COPY_INSTEAD_OF_MOVE
cid#1557119 COPY_INSTEAD_OF_MOVE
cid#1557218 COPY_INSTEAD_OF_MOVE
cid#1557342 COPY_INSTEAD_OF_MOVE
cid#1557727 COPY_INSTEAD_OF_MOVE
cid#1557800 COPY_INSTEAD_OF_MOVE
cid#1557821 COPY_INSTEAD_OF_MOVE
cid#1557830 COPY_INSTEAD_OF_MOVE
cid#1557677 COPY_INSTEAD_OF_MOVE
cid#1557674 COPY_INSTEAD_OF_MOVE

Change-Id: I20dab0c49a17c28b4feaf97440a36d4962310b29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175686
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-26 21:54:56 +02:00
Noel Grandin
caf1bc0c4c assert on invalid param in OPropertyContainerHelper::getFastPropertyValue
which flushes out a bug in OPropertySetHelper::getPropertyValueImp

Change-Id: I5d3928e55eb9f019629896ad6478011520318fd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175474
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-24 10:49:24 +02:00
Bogdan Buzea
661aee7aac tdf#163486: PVS: Identical blocks
V760 Two identical blocks of text were found. The second block begins from line 325.

Change-Id: I5854337d4d1c0d946b096804b536433c48f0696f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175381
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-22 19:34:34 +02:00
Caolán McNamara
ee4554b0ac cid#1555259 COPY_INSTEAD_OF_MOVE
and

cid#1555264 COPY_INSTEAD_OF_MOVE
cid#1555280 COPY_INSTEAD_OF_MOVE
cid#1555303 COPY_INSTEAD_OF_MOVE
cid#1555313 COPY_INSTEAD_OF_MOVE
cid#1555314 COPY_INSTEAD_OF_MOVE
cid#1555323 COPY_INSTEAD_OF_MOVE
cid#1555333 COPY_INSTEAD_OF_MOVE
cid#1555338 COPY_INSTEAD_OF_MOVE
cid#1555349 COPY_INSTEAD_OF_MOVE
cid#1555364 COPY_INSTEAD_OF_MOVE
cid#1555379 COPY_INSTEAD_OF_MOVE
cid#1555398 COPY_INSTEAD_OF_MOVE
cid#1555410 COPY_INSTEAD_OF_MOVE
cid#1555411 COPY_INSTEAD_OF_MOVE
cid#1555416 COPY_INSTEAD_OF_MOVE
cid#1555429 COPY_INSTEAD_OF_MOVE
cid#1555434 COPY_INSTEAD_OF_MOVE
cid#1555441 COPY_INSTEAD_OF_MOVE
cid#1555446 COPY_INSTEAD_OF_MOVE
cid#1555480 COPY_INSTEAD_OF_MOVE
cid#1555490 COPY_INSTEAD_OF_MOVE
cid#1555524 COPY_INSTEAD_OF_MOVE
cid#1555527 COPY_INSTEAD_OF_MOVE
cid#1555531 COPY_INSTEAD_OF_MOVE
cid#1555578 COPY_INSTEAD_OF_MOVE
cid#1555581 COPY_INSTEAD_OF_MOVE
cid#1555591 COPY_INSTEAD_OF_MOVE
cid#1555614 COPY_INSTEAD_OF_MOVE
cid#1555619 COPY_INSTEAD_OF_MOVE
cid#1555633 COPY_INSTEAD_OF_MOVE
cid#1555654 COPY_INSTEAD_OF_MOVE
cid#1555707 COPY_INSTEAD_OF_MOVE
cid#1555712 COPY_INSTEAD_OF_MOVE
cid#1555746 COPY_INSTEAD_OF_MOVE
cid#1555763 COPY_INSTEAD_OF_MOVE

Change-Id: Ibcc1a3649c5663328e60474c06e51902aa74db52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175407
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-22 17:53:07 +02:00
Mike Kaganski
7b2ea917ce Optimize JsonToPropertyValues a bit
1. Make it take string view: helps to avoid extra string allocation
e.g. in desktop::jsonToPropertyValuesVector, and will help more,
when C++26 stringstream ctor taking string view is available.

2. Factor out a function taking boost::property_tree::ptree, making
implementation simpler for [][]com.sun.star.beans.PropertyValue and
[]com.sun.star.beans.PropertyValue, without writing a child node to
a JSON string, and parsing it again.

Change-Id: I16ac2641633ea67a7c9c054c9df09a790500e6fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175361
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-21 20:28:43 +02:00
Sakura286
7bd9aaccb9 tdf#158237 comphelper: Use C++20 contains() instead of find() and end()
Change-Id: I3fc233ffc4c57b02e605306cb9bf3903a88401a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175116
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-18 10:02:51 +02:00
Xisco Fauli
5a384cc233 tdf#163486: PVS: recurring check
V571: Recurring check. The 'if (m_pListener)' condition was already verified in line 104.

After 4d07ee9a54
"loplugin:virtualdead"

Change-Id: I12e90376211f3625cdda482909a96d43fe55cc3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175096
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-18 08:48:59 +02:00
Andrea Gelmini
c1cfc64a12 Fix typo
Change-Id: Ie611105ff1e487657b6aacec6c0c22af095e2c14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174355
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-01 18:10:08 +02:00
Noel Grandin
fc0cb364ae create method for doing the "dispose-on-destruct"
which is (a) a little tricky and (b) needs to be on the base class to
get the locking just right

Change-Id: I425d4747e7e0ca0741fded9a6a70f6fa9995e102
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-01 15:18:21 +02:00
Noel Grandin
a6f1841aed loplugin:unusedmethods
Change-Id: I3897ccb3349874672b778835b9c15642cb1a14f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174298
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-01 11:16:39 +02:00
Caolán McNamara
36b988312a cid#1555574 drop unused copy ctor
Change-Id: Ibaad87cc2f481f3bc7f726ecde0c466a563a96a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173588
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-09-18 11:45:21 +02:00
Noel Grandin
99243746d2 use more concrete UNO classes in comphelper
Change-Id: I1a81d2264a450c23a5196f980e91a686f69edca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173248
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-12 12:34:50 +02:00
Noel Grandin
369c3bb5f0 use more concrete UNO type in comphelper
Change-Id: I290b3ca15d9fc50e5c272c8e6a6634811a595d20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173134
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-09-10 16:23:08 +02:00
Noel Grandin
f9ff22db05 tsan:lock-order-inversion in forms
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
(pid=14614)
Cycle in lock order graph: M0 (0x720c004ac190) => M1 (0x720c004a8200) =>
M0

Mutex M1 acquired here while holding mutex M0 in thread T43:
2 osl::Mutex::acquire() /home/noel/libo-tsan/include/osl/mutex.hxx:63
(libuno_cppuhelpergcc3.so.3+0x8fdd9)
3 osl::Guard<osl::Mutex>::Guard(osl::Mutex&)
/home/noel/libo-tsan/include/osl/mutex.hxx:144
(libuno_cppuhelpergcc3.so.3+0x8fdd9)
4 cppu::OBroadcastHelperVar<cppu::OMultiTypeInterfaceContainerHelper,
com::sun::uno::Type>::addListener(com::sun::uno::Type
const&, com::sun::uno::Reference<com::sun::uno::XInterface>
const&) /home/noel/libo-tsan/include/cppuhelper/interfacecontainer.h:468
(libuno_cppuhelpergcc3.so.3+0x8fdd9)
5
cppu::OPropertySetHelper::addPropertiesChangeListener(com::sun::uno::Sequence<rtl::OUString>
const&,
com::sun::uno::Reference<com::sun:🫘:XPropertiesChangeListener>
const&) /home/noel/libo-tsan/cppuhelper/source/propshlp.cxx:912
(libuno_cppuhelpergcc3.so.3+0x8fdd9)
6
comphelper::OPropertySetAggregationHelper::addPropertiesChangeListener(com::sun::uno::Sequence<rtl::OUString>
const&,
com::sun::uno::Reference<com::sun:🫘:XPropertiesChangeListener>
const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:495
(libcomphelper.so+0x1a1865)
7 comphelper::OPropertySetAggregationHelper::startListening()
/home/noel/libo-tsan/comphelper/source/property/propagg.cxx:466
(libcomphelper.so+0x1a1416)
^^^ Mutex M0 previously acquired by the same thread here:
8
comphelper::OPropertySetAggregationHelper::addPropertyChangeListener(rtl::OUString
const&,
com::sun::uno::Reference<com::sun:🫘:XPropertyChangeListener>
const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:488
(libcomphelper.so+0x1a181a)
9 non-virtual thunk to
comphelper::OPropertySetAggregationHelper::addPropertyChangeListener(rtl::OUString
const&,
com::sun::uno::Reference<com::sun:🫘:XPropertyChangeListener>
const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:?
(libcomphelper.so+0x1a181a)
10 frm::OInterfaceContainer::implInsert(int,
com::sun::uno::Reference<com::sun:🫘:XPropertySet>
const&, bool, frm::ElementDescription*, bool)
/home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:787
(libfrmlo.so+0x23e03c)
11 frm::OInterfaceContainer::insertByIndex(int, com::sun::uno::Any
const&)
/home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:904
(libfrmlo.so+0x240644)
12 non-virtual thunk to frm::OInterfaceContainer::insertByIndex(int,
com::sun::uno::Any const&)
/home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:?
(libfrmlo.so+0x240716)
13 FmXUndoEnvironment::Inserted(FmFormObj*)
/home/noel/libo-tsan/svx/source/form/fmundo.cxx:424
(libsvxcorelo.so+0x41b2a4)
14 FmXUndoEnvironment::Inserted(SdrObject*)
/home/noel/libo-tsan/svx/source/form/fmundo.cxx:336
(libsvxcorelo.so+0x41a982)
15 FmXUndoEnvironment::Notify(SfxBroadcaster&, SfxHint const&)
/home/noel/libo-tsan/svx/source/form/fmundo.cxx:292
(libsvxcorelo.so+0x41a8a0)
16 non-virtual thunk to FmXUndoEnvironment::Notify(SfxBroadcaster&,
SfxHint const&) /home/noel/libo-tsan/svx/source/form/fmundo.cxx:?
(libsvxcorelo.so+0x41acd2)
17 SfxBroadcaster::Broadcast(SfxHint const&)
/home/noel/libo-tsan/svl/source/notify/SfxBroadcaster.cxx:40
(libsvllo.so+0xe7c3d)
18 SdrObjList::InsertObject(SdrObject*, unsigned long)
/home/noel/libo-tsan/svx/source/svdraw/svdpage.cxx:351
(libsvxcorelo.so+0x6fdf3a)
19 FmFormPage::InsertObject(SdrObject*, unsigned long)
/home/noel/libo-tsan/svx/source/form/fmpage.cxx:79
(libsvxcorelo.so+0x3c1e05)
20
SvxDrawPage::add(com::sun::uno::Reference<com::sun::drawing::XShape>
const&) /home/noel/libo-tsan/svx/source/unodraw/unopage.cxx:191
(libsvxcorelo.so+0x850c7b)
21
SwFmDrawPage::add(com::sun::uno::Reference<com::sun::drawing::XShape>
const&) /home/noel/libo-tsan/sw/source/core/unocore/unodraw.cxx:649
(libswlo.so+0xc30712)
22 non-virtual thunk to
SwFmDrawPage::add(com::sun::uno::Reference<com::sun::drawing::XShape>
const&) /home/noel/libo-tsan/sw/source/core/unocore/unodraw.cxx:?
(libswlo.so+0xc31732)
23 gcc3::callVirtualMethod(void*, unsigned int, void*,
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int,
unsigned long*, double*)
/home/noel/libo-tsan/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
(libgcc3_uno.so+0xd92a)
24 cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*,
bridges::cpp_uno::shared::VtableSlot,
_typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*,
void*, void**, _uno_Any**)
/home/noel/libo-tsan/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229
(libgcc3_uno.so+0xcc3c)
25 unoInterfaceProxyDispatch
/home/noel/libo-tsan/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:409
(libgcc3_uno.so+0xc1f6)

Mutex M0 acquired here while holding mutex M1 in thread T44:
3 osl::Guard<osl::Mutex>::Guard(osl::Mutex&)
/home/noel/libo-tsan/include/osl/mutex.hxx:144
(libcomphelper.so+0x1bde34)
4
comphelper::OPropertyChangeListener::setAdapter(comphelper::OPropertyChangeMultiplexer*)
/home/noel/libo-tsan/comphelper/source/property/propmultiplex.cxx:58
(libcomphelper.so+0x1bde34)
5
comphelper::OPropertyChangeMultiplexer::disposing(com::sun::lang::EventObject
const&)
/home/noel/libo-tsan/comphelper/source/property/propmultiplex.cxx:120
(libcomphelper.so+0x1bde34)
6 non-virtual thunk to
comphelper::OPropertyChangeMultiplexer::disposing(com::sun::lang::EventObject
const&)
/home/noel/libo-tsan/comphelper/source/property/propmultiplex.cxx:?
(libcomphelper.so+0x1bdf12)
7
cppu::OInterfaceContainerHelper::disposeAndClear(com::sun::lang::EventObject
const&)
/home/noel/libo-tsan/cppuhelper/source/interfacecontainer.cxx:272
(libuno_cppuhelpergcc3.so.3+0x66524)
8
cppu::OMultiTypeInterfaceContainerHelperInt32::disposeAndClear(com::sun::lang::EventObject
const&)
/home/noel/libo-tsan/cppuhelper/source/interfacecontainer.cxx:577
(libuno_cppuhelpergcc3.so.3+0x68af0)
9 cppu::OPropertySetHelper::disposing()
/home/noel/libo-tsan/cppuhelper/source/propshlp.cxx:246
(libuno_cppuhelpergcc3.so.3+0x8be45)
10 comphelper::OPropertySetAggregationHelper::disposing()
/home/noel/libo-tsan/comphelper/source/property/propagg.cxx:366
(libcomphelper.so+0x1a0321)
^^^ Mutex M1 previously acquired by the same thread here:
11 frm::OControlModel::disposing()
/home/noel/libo-tsan/forms/source/component/FormComponent.cxx:705
(libfrmlo.so+0x19eecc)
12 frm::ORichTextModel::disposing()
/home/noel/libo-tsan/forms/source/richtext/richtextmodel.cxx:295
(libfrmlo.so+0x267bdb)
13 cppu::OComponentHelper::dispose()
/home/noel/libo-tsan/cppuhelper/source/component.cxx:159
(libuno_cppuhelpergcc3.so.3+0x4504f)
14 non-virtual thunk to cppu::OComponentHelper::dispose()
/home/noel/libo-tsan/cppuhelper/source/component.cxx:?
(libuno_cppuhelpergcc3.so.3+0x45379)
15 frm::OControlModel::disposing()
/home/noel/libo-tsan/forms/source/component/FormComponent.cxx:708
(libfrmlo.so+0x19ef13)
16 frm::OBoundControlModel::disposing()
/home/noel/libo-tsan/forms/source/component/FormComponent.cxx:1340
(libfrmlo.so+0x1a507f)
17 frm::OEditModel::disposing()
/home/noel/libo-tsan/forms/source/component/Edit.cxx:301
(libfrmlo.so+0x161208)
18 cppu::OComponentHelper::dispose()
/home/noel/libo-tsan/cppuhelper/source/component.cxx:159
(libuno_cppuhelpergcc3.so.3+0x4504f)
19 non-virtual thunk to cppu::OComponentHelper::dispose()
/home/noel/libo-tsan/cppuhelper/source/component.cxx:?
(libuno_cppuhelpergcc3.so.3+0x45379)
20 SdrUnoObj::~SdrUnoObj()
/home/noel/libo-tsan/svx/source/svdraw/svdouno.cxx:214
(libsvxcorelo.so+0x6f471b)
21 FmFormObj::~FmFormObj()
/home/noel/libo-tsan/svx/source/form/fmobj.cxx:119
(libsvxcorelo.so+0x3bd8cf)
22 FmFormObj::~FmFormObj()
/home/noel/libo-tsan/svx/source/form/fmobj.cxx:112
(libsvxcorelo.so+0x3bd985)
23 SdrObject::release()
/home/noel/libo-tsan/svx/source/svdraw/svdobj.cxx:486
(libsvxcorelo.so+0x6634df)
24 rtl::Reference<SdrObject>::~Reference()
/home/noel/libo-tsan/include/rtl/ref.hxx:126 (libsvxcorelo.so+0x61610d)
25 void std::destroy_at<rtl::Reference<SdrObject>
>(rtl::Reference<SdrObject>*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
(libsvxcorelo.so+0x61610d)
26 void std::_Destroy<rtl::Reference<SdrObject>
>(rtl::Reference<SdrObject>*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
(libsvxcorelo.so+0x61610d)
27 void
std::_Destroy_aux<false>::__destroy<rtl::Reference<SdrObject>*>(rtl::Reference<SdrObject>*,
rtl::Reference<SdrObject>*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163
(libsvxcorelo.so+0x61610d)
28 void
std::_Destroy<rtl::Reference<SdrObject>*>(rtl::Reference<SdrObject>*,
rtl::Reference<SdrObject>*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:195
(libsvxcorelo.so+0x61610d)
29 void std::_Destroy<rtl::Reference<SdrObject>*,
rtl::Reference<SdrObject> >(rtl::Reference<SdrObject>*,
rtl::Reference<SdrObject>*, std::allocator<rtl::Reference<SdrObject> >&)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948
(libsvxcorelo.so+0x61610d)
30 std::vector<rtl::Reference<SdrObject>,
std::allocator<rtl::Reference<SdrObject> > >::~vector()
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:735
(libsvxcorelo.so+0x61610d)
31 SdrModel::ClearModel(bool)
/home/noel/libo-tsan/svx/source/svdraw/svdmodel.cxx:623
(libsvxcorelo.so+0x61610d)
32 SwDrawModel::~SwDrawModel()
/home/noel/libo-tsan/sw/source/core/draw/drawdoc.cxx:108
(libswlo.so+0x714650)
33 std::default_delete<SwDrawModel>::operator()(SwDrawModel*) const
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:99
(libswlo.so+0x5a3082)
34 std::__uniq_ptr_impl<SwDrawModel, std::default_delete<SwDrawModel>
>::reset(SwDrawModel*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:211
(libswlo.so+0x5a3082)
35 std::unique_ptr<SwDrawModel, std::default_delete<SwDrawModel>
>::reset(SwDrawModel*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:509
(libswlo.so+0x5a3082)
36 sw::DocumentDrawModelManager::ReleaseDrawModel()
/home/noel/libo-tsan/sw/source/core/doc/DocumentDrawModelManager.cxx:162
(libswlo.so+0x5a3082)
37 SwDoc::~SwDoc()
/home/noel/libo-tsan/sw/source/core/doc/docnew.cxx:585
(libswlo.so+0x5457c8)
38 SwDoc::release() /home/noel/libo-tsan/sw/source/core/doc/doc.cxx:129
(libswlo.so+0x4b8993)
39 rtl::Reference<SwDoc>::clear()
/home/noel/libo-tsan/include/rtl/ref.hxx:193 (libswlo.so+0x104c301)
40 SwDocShell::RemoveLink()
/home/noel/libo-tsan/sw/source/uibase/app/docshini.cxx:444
(libswlo.so+0x104c301)
41 SwDocShell::~SwDocShell()
/home/noel/libo-tsan/sw/source/uibase/app/docshini.cxx:372
(libswlo.so+0x104bf36)
42 SwDocShell::~SwDocShell()
/home/noel/libo-tsan/sw/source/uibase/app/docshini.cxx:362
(libswlo.so+0x104c469)
43 non-virtual thunk to SwDocShell::~SwDocShell()
/home/noel/libo-tsan/sw/source/uibase/app/docshini.cxx:?
(libswlo.so+0x104c469)
44 cppu::OWeakObject::release()
/home/noel/libo-tsan/cppuhelper/source/weak.cxx:230
(libuno_cppuhelpergcc3.so.3+0x105ae7)
45 rtl::Reference<SfxObjectShell>::~Reference()
/home/noel/libo-tsan/include/rtl/ref.hxx:126 (libsfxlo.so+0x5209e5)
46 IMPL_SfxBaseModel_DataContainer::~IMPL_SfxBaseModel_DataContainer()
/home/noel/libo-tsan/sfx2/source/doc/sfxbasemodel.cxx:265
(libsfxlo.so+0x5209e5)
47 void
std::destroy_at<IMPL_SfxBaseModel_DataContainer>(IMPL_SfxBaseModel_DataContainer*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88
(libsfxlo.so+0x51f4e6)
48 void
std::_Destroy<IMPL_SfxBaseModel_DataContainer>(IMPL_SfxBaseModel_DataContainer*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149
(libsfxlo.so+0x51f4e6)
49 void std::allocator_traits<std::allocator<void>
>::destroy<IMPL_SfxBaseModel_DataContainer>(std::allocator<void>&,
IMPL_SfxBaseModel_DataContainer*)
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:675
(libsfxlo.so+0x51f4e6)
50 std::_Sp_counted_ptr_inplace<IMPL_SfxBaseModel_DataContainer,
std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:613
(libsfxlo.so+0x51f4e6)
51 SfxBaseModel::dispose()
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:175
(libsfxlo.so+0x4e7c7c)
52 SwXTextDocument::dispose()
/home/noel/libo-tsan/sw/source/uibase/uno/unotxdoc.cxx:562
(libswlo.so+0x13896e1)
53 SfxBaseModel::close(unsigned char)
/home/noel/libo-tsan/sfx2/source/doc/sfxbasemodel.cxx:1526
(libsfxlo.so+0x4eed16)
54 SwXTextDocument::close(unsigned char)
/home/noel/libo-tsan/sw/source/uibase/uno/unotxdoc.cxx:575
(libswlo.so+0x138999c)
55 non-virtual thunk to SwXTextDocument::close(unsigned char)
/home/noel/libo-tsan/sw/source/uibase/uno/unotxdoc.cxx:?
(libswlo.so+0x1389ad3)
56 gcc3::callVirtualMethod(void*, unsigned int, void*,
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int,
unsigned long*, double*)
/home/noel/libo-tsan/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:87
(libgcc3_uno.so+0xd92a)

Change-Id: Ie16fc0ff7462632a591a46025a38344006d43c30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173068
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-09 16:08:42 +02:00
Noel Grandin
6d6422b3ff tdf#162772 Crash in "Target in Document" in Hyperlink dialog
regression from
    commit a6ad198d09
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Sat Aug 17 13:19:54 2024 +0200
    tdf#158556 use more comphelper::ByteReader

Change-Id: I7343159d5e3ec7619ba95a98417fd3b4e25dbf6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172906
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-05 13:51:25 +02:00
Noel Grandin
a6ad198d09 tdf#158556 use more comphelper::ByteReader
which avoids a ton of temporary uno::Sequence being created

Change-Id: I237bb69395f692bb0272ca0daec05b81af828e01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171968
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-08-27 09:10:04 +02:00
Caolán McNamara
c25bc0c046 make joinThreadsIfIdle return false if it cannot join
Change-Id: I52e22bf5e68809d6787d2d135b6a35384cf79391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168785
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit c7ff8768db58aaee5ce0acbabe97faeaf450f017)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172329
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-08-23 21:52:45 +02:00
Noel Grandin
b556351724 use less exception throwing for flow control
Change-Id: Iaf273c1f54977d4b422a327ffbc1086da991cc4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-21 19:13:44 +02:00
Caolán McNamara
a4dfd23e44 cid#1557694 COPY_INSTEAD_OF_MOVE
and

cid#1557162 COPY_INSTEAD_OF_MOVE
cid#1556896 COPY_INSTEAD_OF_MOVE
cid#1556893 COPY_INSTEAD_OF_MOVE
cid#1556873 COPY_INSTEAD_OF_MOVE
cid#1556872 COPY_INSTEAD_OF_MOVE
cid#1556789 COPY_INSTEAD_OF_MOVE
cid#1556570 COPY_INSTEAD_OF_MOVE
cid#1556519 COPY_INSTEAD_OF_MOVE
cid#1556516 COPY_INSTEAD_OF_MOVE
cid#1556451 COPY_INSTEAD_OF_MOVE
cid#1556396 COPY_INSTEAD_OF_MOVE
cid#1556237 COPY_INSTEAD_OF_MOVE
cid#1556113 COPY_INSTEAD_OF_MOVE
cid#1556094 COPY_INSTEAD_OF_MOVE
cid#1555991 COPY_INSTEAD_OF_MOVE
cid#1555982 COPY_INSTEAD_OF_MOVE
cid#1555885 COPY_INSTEAD_OF_MOVE
cid#1555702 COPY_INSTEAD_OF_MOVE
cid#1555610 COPY_INSTEAD_OF_MOVE
cid#1555450 COPY_INSTEAD_OF_MOVE
cid#1555327 COPY_INSTEAD_OF_MOVE
cid#1555145 COPY_INSTEAD_OF_MOVE

Change-Id: I38cc1a38e8cb2c33f33e0fc3afd34a0fb39e5ec1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172028
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-19 15:15:54 +02:00
Miklos Vajna
3974af7dca sfx2: fix crash in SfxObjectShell::IsHelpDocument()
Seen while running the online.git unit-quarantine testcase:

	#0  std::__uniq_ptr_impl<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::_M_ptr() const (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:191
	#1  0x00007f2f25fa398a in std::unique_ptr<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::get() const (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:462
	#2  0x00007f2f25f9fae2 in std::unique_ptr<SfxMedium_Impl, std::default_delete<SfxMedium_Impl> >::operator->() const (this=0x10) at /usr/include/c++/12/bits/unique_ptr.h:455
	#3  0x00007f2f25f8bbd2 in SfxMedium::GetFilter() const (this=0x0) at sfx2/source/doc/docfile.cxx:3272
	#4  0x00007f2f260067ce in SfxObjectShell::IsHelpDocument() const (this=0x5c6adc0) at sfx2/source/doc/objcont.cxx:589
	#5  0x00007f2f0f6991c1 in SwLayIdle::isJobEnabled(IdleJobType, SwViewShell const*) (eJob=IdleJobType::SMART_TAGS, pViewShell=0x5a573f0)
	    at sw/source/core/layout/layact.cxx:2218
	#6  0x00007f2f0f69926d in SwLayIdle::DoIdleJob(IdleJobType, IdleJobArea) (this=0x7ffc9daf4180, eJob=IdleJobType::SMART_TAGS, eJobArea=IdleJobArea::VISIBLE)
	    at sw/source/core/layout/layact.cxx:2234
	#7  0x00007f2f0f699d81 in SwLayIdle::SwLayIdle(SwRootFrame*, SwViewShellImp*) (this=0x7ffc9daf4180, pRt=0x5a8fad0, pI=0x5a58860)
	    at sw/source/core/layout/layact.cxx:2355
	#8  0x00007f2f0fdccf21 in SwViewShell::LayoutIdle() (this=0x5a573f0) at sw/source/core/view/viewsh.cxx:826

Assume that in case the object shell has no underlying medium, then
that's not a help document.

Also fix the higher level problem that the LOK AnyInput callback should
not be invoked while doing a LOK background save, as the object shell in the
forked process has no underlying medium. That fixes the failure seen
while running the online.git unit-save-torture test.

Change-Id: Idcdd62cc177ac4b7edfbcef8906da2e42610ee98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171950
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-16 18:31:27 +02:00
Caolán McNamara
c93eb54c87 cid#1557618 COPY_INSTEAD_OF_MOVE
and

cid#1557535 COPY_INSTEAD_OF_MOVE
cid#1557520 COPY_INSTEAD_OF_MOVE
cid#1557513 COPY_INSTEAD_OF_MOVE
cid#1557503 COPY_INSTEAD_OF_MOVE
cid#1557487 COPY_INSTEAD_OF_MOVE
cid#1557483 COPY_INSTEAD_OF_MOVE
cid#1557479 COPY_INSTEAD_OF_MOVE
cid#1557474 COPY_INSTEAD_OF_MOVE
cid#1557461 COPY_INSTEAD_OF_MOVE
cid#1557446 COPY_INSTEAD_OF_MOVE
cid#1557445 COPY_INSTEAD_OF_MOVE
cid#1557441 COPY_INSTEAD_OF_MOVE
cid#1557435 COPY_INSTEAD_OF_MOVE
cid#1557433 COPY_INSTEAD_OF_MOVE
cid#1557429 COPY_INSTEAD_OF_MOVE
cid#1557375 COPY_INSTEAD_OF_MOVE
cid#1557372 COPY_INSTEAD_OF_MOVE
cid#1557356 COPY_INSTEAD_OF_MOVE
cid#1557350 COPY_INSTEAD_OF_MOVE
cid#1557344 COPY_INSTEAD_OF_MOVE
cid#1557339 COPY_INSTEAD_OF_MOVE
cid#1557332 COPY_INSTEAD_OF_MOVE
cid#1557330 COPY_INSTEAD_OF_MOVE
cid#1557328 COPY_INSTEAD_OF_MOVE
cid#1557323 COPY_INSTEAD_OF_MOVE
cid#1557315 COPY_INSTEAD_OF_MOVE
cid#1557313 COPY_INSTEAD_OF_MOVE
cid#1557304 COPY_INSTEAD_OF_MOVE
cid#1557297 COPY_INSTEAD_OF_MOVE
cid#1557291 COPY_INSTEAD_OF_MOVE
cid#1557290 COPY_INSTEAD_OF_MOVE
cid#1557271 COPY_INSTEAD_OF_MOVE
cid#1557266 COPY_INSTEAD_OF_MOVE
cid#1557262 COPY_INSTEAD_OF_MOVE
cid#1557259 COPY_INSTEAD_OF_MOVE
cid#1557246 COPY_INSTEAD_OF_MOVE
cid#1557242 COPY_INSTEAD_OF_MOVE
cid#1557241 COPY_INSTEAD_OF_MOVE
cid#1557236 COPY_INSTEAD_OF_MOVE
cid#1557228 COPY_INSTEAD_OF_MOVE
cid#1557225 COPY_INSTEAD_OF_MOVE
cid#1557221 COPY_INSTEAD_OF_MOVE
cid#1557217 COPY_INSTEAD_OF_MOVE
cid#1557213 COPY_INSTEAD_OF_MOVE
cid#1557211 COPY_INSTEAD_OF_MOVE
cid#1557209 COPY_INSTEAD_OF_MOVE
cid#1557205 COPY_INSTEAD_OF_MOVE
cid#1557204 COPY_INSTEAD_OF_MOVE
cid#1557193 COPY_INSTEAD_OF_MOVE
cid#1556082 COPY_INSTEAD_OF_MOVE

Change-Id: I07f195a79a69d4bac0d14317854efc88d6fe94d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171927
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-16 09:30:37 +02:00
Caolán McNamara
06aaed0fd7 cid#1616498 COPY_INSTEAD_OF_MOVE
and

cid#1616499 COPY_INSTEAD_OF_MOVE

Change-Id: I21b089cab036902a7ba5b725a6eae0f1212f2b31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171923
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-16 09:29:43 +02:00
Miklos Vajna
a22fe103e7 Related: cool#9735 vcl lok: add an AnyInput() callback
Open the 300 pages bugdoc, paste a oneliner plain text content in a
paragraph which is part of a numbered list, observe a 274 ms hang till
layout is done for all pages, then we get an updated tile. This could be
better, there is no such hang in the desktop case.

What happens is that 1) vcl doesn't try to invoke the poll callback of
the LOK client when there was a processed timer and 2) Writer layout
doesn't try to split its work into pieces because the LOK client has no
way to inform vcl that it has pending input events.

Fix the first problem in this commit: add a new API that allows a LOK
client to inform vcl that it has pending input events and use that
SvpSalInstance::ImplYield(): if a LOK client has pending input events,
then invoke the poll callback after each processed timer. For example,
this allows the LOK client to process emitted callbacks between two idle
layout jobs, word counting, etc.

The second problem around Writer to use
comphelper::LibreOfficeKit::anyInput() is not yet fixed.

Change-Id: I2e39253bfc4d1b5546bc60eef9ff05ccdc0868b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171846
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-14 11:17:33 +02:00
HakimOttey
6aa87b23c4 Related: tdf#42982 replace IllegalTypeException with RuntimeException
Change-Id: Ibe6004e43a7553c6694d7938603023a9f95535a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170035
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2024-08-14 07:53:49 +02:00
Moritz Duge
8f9f042976 tdf#161909: make showing GPG keys only an explicit functionality
Before this change, selecting only GPG keys for ODF encrpytion relied on
the fact, that all X.509 implementations (nss+mscrypt) implement listing
public keys (getAllCertificates) as a stub.
See previous change Ia6b8ecb9

Change-Id: Icb36a4cefd60b94407129ff73fe62f9250bfbee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171639
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-08-13 01:09:01 +02:00
Sarper Akdemir
9786f8ea59 tdf#159040 tdf#162206: better the user key selection and test sign with default
fix GPG CertificateImpl::getSHA1Thumbprint not returning a
sequence of bytes as the thumbprint. (that is what the
documented API states, and what all of the code assumed.)

now /org.openoffice.UserProfile/Data/signingkey and
encryptionkey stores the key's SHA1Thumbprint for better
identification of keys. Previously on the key name was being
used.

fix annoying NSS Certificate Database password prompt
appearing on Tools->Options if the certificate database is
password protected.

improve Tools->Options->UserData user key selection and
display of information.

add a ui test for "Sign with default certificate"
interaction in the save dialog.

Change-Id: I1036856003f58f494838e0f81ca0fe18e821f528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171395
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
2024-08-05 13:15:31 +02:00
Ilmari Lauhakangas
558b20d1ac comphelper, msicreator, odk: fix issues found by Ruff linter
Change-Id: I5ef65baeb0100b9d70b5c59c1d5f6f43ab951a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171092
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-27 15:42:26 +02:00