Commit graph

5184 commits

Author SHA1 Message Date
Mike Kaganski
4b9bf0a2b9 SfxLibraryContainer: use std::mutex, and pass it to NameContainer
... to avoid own mutexes in own name container implementation.

Change-Id: I29ff6ef987154359c35d0628d529b0606ef08c5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177637
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 08:48:53 +01:00
Mike Kaganski
0f3f371028 NameContainer need not be an UNO object itself
Change-Id: I56f07a62ed3d2388eede16a85e673027cfed8158
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177616
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-01 22:44:38 +01:00
Mike Kaganski
297b7a7676 Optimize SfxLibrary / SfxLibraryContainer memory layout a bit
Change-Id: I63ba583ef990dd2bbfb7f44af613fce1d8d1b411
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177608
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-01 16:06:31 +01:00
Mike Kaganski
d91eca950e Simplify SfxLibrary hierarchy
For some reason, SfxLibrary's own interfaces were used outside of
WeakComponentImplHelper; and derived classes didn't use inheritance
helper.

Change-Id: Ib0b6cf5cfa559fe5eedc4d05247655aca1bfc4b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177607
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-01 16:06:24 +01:00
Mike Kaganski
ac334d5c76 Simplify a bit
Change-Id: Ia48a24d1696aaf2ee7e49f5e8c9f9dcc0ae9e8e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177606
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-01 16:06:17 +01:00
Mike Kaganski
ea2a974386 Simplify NameContainer
Having a map, two vectors, and a counter for what is a job for a single
map is a bit too much.

Change-Id: I50d29f03a2463e6f63ed8e645c36b4c77aa1413a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177604
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-01 12:27:02 +01:00
Mike Kaganski
e413d962ac Drop unneeded indirection and unused argument
The extra complexity was introduced for #i94994# in commit
3266965986 (CWS-TOOLING: integrate CWS
ab61, 2009-02-11).

Change-Id: If5a69984e3c2c963d4eea2824373fbf1e8a47fef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177603
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-01 10:27:16 +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
Noel Grandin
78693c376e tdf#108189 inspection of object hangs LO
There is no general solution to this that I am aware of, so just
implement a rather specific solution that will need periodic extending
to check for other dangerous properties

Change-Id: Ie09d89416fea5b7cdf782319ed9921657faa5a5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176593
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-14 18:02:03 +01:00
Stephan Bergmann
16e3b84d2e Improve loplugin:dyncastvisibility to check for non-inline key functions
This would have caught the issue discussed in
709b1f3ddb "Make sure VCLXPopupMenu has unique
RTTI".  (The commit message talks about RTTI there, while what Clang actually
compared for an optimized implementation of a dynamic_cast to a final class is
vtable pointers, but the overall picture remains the same.  Both RTTI and
vtables are emitted along the key function, and if that is missing or inline,
they are emitted for each dynamic library individually, and as internal symbols
on macOS.)

This commit also addresses all the issues found by the improved
loplugin:dyncastvisibility on Linux.  See the newly added TODO in
compilerplugins/clang/dyncastvisibility.cxx and
86b86ac87e "Give DocumentEventHolder (aka
EventHolder<DocumentEvent>) a key function" for an issue with key functions for
class template instantiations.

Change-Id: Ia19155efb1d23692c92b9c97ff17f18ae7a1f3ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176576
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-11-14 12:49:22 +01:00
Bogdan Buzea
354dc28282 tdf#163486: PVS: Identical branches
Change-Id: Ic54a8e009f68ab992831ba849ae1349a6235bedd
V1037: Two or more case-branches perform the same actions. Check lines: 1276 and 1408, 1434 and 1510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175149
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-12 01:35:14 +01:00
Noel Grandin
cc70c63f8f clang-tidy: performance-unnecessary-copy-initialization in basic
Change-Id: I38bc2711bdec2bdaf998401083ff9b62a5595616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176389
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-11 15:46:52 +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
Noel Grandin
cc9b55e8a8 loplugin:reftotemp in basic
Change-Id: I41385d279cc81de9b5b2e9ff55b0b5c2f40aba66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176244
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-08 08:41:06 +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
Noel Grandin
d5b55513cd loplugin:passstuffbyref in basic
Change-Id: I1aee08f0ff2a3dabcedc49a31e7ff4de9428007e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-06 15:45:14 +01:00
Noel Grandin
5de73f04f3 new loplugin:staticconstexpr
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-04 08:51:00 +01:00
Mike Kaganski
4f1c88bb57 Simplify a bit
Change-Id: I2e4635c660a57abefa57b046e3f0da411939cf1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175953
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-11-02 18:27:22 +01:00
Noel Grandin
cf14352cd8 no need to heap allocate these
Change-Id: I28127f5943a80aca1689d5982cd1f6e6e11eb2c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175863
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-01 07:27:27 +01:00
Mike Kaganski
de4ef35350 tdf#163680: fix fixed-length strings assignment
Change-Id: I4aa8144df5dfb836ad0689c7855301b8b04da485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175878
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-31 20:46:09 +01:00
Mike Kaganski
298feac9c4 No need to heap-allocate it
Change-Id: Ia6bbf6d3f5b9af2a5b52b8c6baec85bdcb579275
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175847
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-31 12:14:18 +01:00
Caolán McNamara
6f1508f4de cid#1555767 COPY_INSTEAD_OF_MOVE
and

cid#1555770 COPY_INSTEAD_OF_MOVE
cid#1555788 COPY_INSTEAD_OF_MOVE
cid#1555789 COPY_INSTEAD_OF_MOVE
cid#1555798 COPY_INSTEAD_OF_MOVE
cid#1555816 COPY_INSTEAD_OF_MOVE
cid#1555822 COPY_INSTEAD_OF_MOVE
cid#1555835 COPY_INSTEAD_OF_MOVE
cid#1555845 COPY_INSTEAD_OF_MOVE
cid#1555859 COPY_INSTEAD_OF_MOVE
cid#1555864 COPY_INSTEAD_OF_MOVE
cid#1555868 COPY_INSTEAD_OF_MOVE
cid#1555892 COPY_INSTEAD_OF_MOVE
cid#1555896 COPY_INSTEAD_OF_MOVE
cid#1555921 COPY_INSTEAD_OF_MOVE
cid#1555932 COPY_INSTEAD_OF_MOVE
cid#1555935 COPY_INSTEAD_OF_MOVE
cid#1555944 COPY_INSTEAD_OF_MOVE
cid#1555952 COPY_INSTEAD_OF_MOVE
cid#1555985 COPY_INSTEAD_OF_MOVE
cid#1556024 COPY_INSTEAD_OF_MOVE
cid#1556038 COPY_INSTEAD_OF_MOVE
cid#1556042 COPY_INSTEAD_OF_MOVE
cid#1556044 COPY_INSTEAD_OF_MOVE
cid#1556060 COPY_INSTEAD_OF_MOVE
cid#1556083 COPY_INSTEAD_OF_MOVE
cid#1556085 COPY_INSTEAD_OF_MOVE
cid#1556090 COPY_INSTEAD_OF_MOVE
cid#1556136 COPY_INSTEAD_OF_MOVE
cid#1556157 COPY_INSTEAD_OF_MOVE
cid#1556159 COPY_INSTEAD_OF_MOVE
cid#1556172 COPY_INSTEAD_OF_MOVE
cid#1556179 COPY_INSTEAD_OF_MOVE
cid#1556187 COPY_INSTEAD_OF_MOVE
cid#1556255 COPY_INSTEAD_OF_MOVE
cid#1556256 COPY_INSTEAD_OF_MOVE
cid#1556266 COPY_INSTEAD_OF_MOVE
cid#1556275 COPY_INSTEAD_OF_MOVE
cid#1556290 COPY_INSTEAD_OF_MOVE
cid#1556294 COPY_INSTEAD_OF_MOVE
cid#1556301 COPY_INSTEAD_OF_MOVE
cid#1556311 COPY_INSTEAD_OF_MOVE
cid#1556318 COPY_INSTEAD_OF_MOVE
cid#1556326 COPY_INSTEAD_OF_MOVE
cid#1556369 COPY_INSTEAD_OF_MOVE
cid#1556374 COPY_INSTEAD_OF_MOVE
cid#1556387 COPY_INSTEAD_OF_MOVE
cid#1556388 COPY_INSTEAD_OF_MOVE
cid#1556417 COPY_INSTEAD_OF_MOVE
cid#1556425 COPY_INSTEAD_OF_MOVE
cid#1556435 COPY_INSTEAD_OF_MOVE
cid#1556495 COPY_INSTEAD_OF_MOVE
cid#1556497 COPY_INSTEAD_OF_MOVE
cid#1556501 COPY_INSTEAD_OF_MOVE
cid#1556503 COPY_INSTEAD_OF_MOVE
cid#1556520 COPY_INSTEAD_OF_MOVE
cid#1556523 COPY_INSTEAD_OF_MOVE
cid#1556562 COPY_INSTEAD_OF_MOVE
cid#1556573 COPY_INSTEAD_OF_MOVE
cid#1556576 COPY_INSTEAD_OF_MOVE
cid#1556598 COPY_INSTEAD_OF_MOVE
cid#1556615 COPY_INSTEAD_OF_MOVE
cid#1556626 COPY_INSTEAD_OF_MOVE
cid#1556671 COPY_INSTEAD_OF_MOVE
cid#1556689 COPY_INSTEAD_OF_MOVE
cid#1556701 COPY_INSTEAD_OF_MOVE
cid#1556713 COPY_INSTEAD_OF_MOVE
cid#1556758 COPY_INSTEAD_OF_MOVE
cid#1556759 COPY_INSTEAD_OF_MOVE
cid#1556788 COPY_INSTEAD_OF_MOVE
cid#1556811 COPY_INSTEAD_OF_MOVE
cid#1556821 COPY_INSTEAD_OF_MOVE
cid#1556824 COPY_INSTEAD_OF_MOVE
cid#1556825 COPY_INSTEAD_OF_MOVE
cid#1556862 COPY_INSTEAD_OF_MOVE

Change-Id: I4925a79688a983bb07252600430039ec0bcb75b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175678
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-26 19:25:03 +02:00
Caolán McNamara
7cf8cffcb8 cid#1633347 COPY_INSTEAD_OF_MOVE
and

cid#1633346 COPY_INSTEAD_OF_MOVE
cid#1633344 COPY_INSTEAD_OF_MOVE
cid#1633343 COPY_INSTEAD_OF_MOVE
cid#1633340 COPY_INSTEAD_OF_MOVE
cid#1608137 COPY_INSTEAD_OF_MOVE
cid#1608131 COPY_INSTEAD_OF_MOVE
cid#1607860 COPY_INSTEAD_OF_MOVE
cid#1607432 COPY_INSTEAD_OF_MOVE
cid#1607394 COPY_INSTEAD_OF_MOVE
cid#1607310 COPY_INSTEAD_OF_MOVE
cid#1607156 COPY_INSTEAD_OF_MOVE
cid#1607093 COPY_INSTEAD_OF_MOVE
cid#1607090 COPY_INSTEAD_OF_MOVE
cid#1607039 COPY_INSTEAD_OF_MOVE
cid#1606709 COPY_INSTEAD_OF_MOVE
cid#1558053 COPY_INSTEAD_OF_MOVE
cid#1558052 COPY_INSTEAD_OF_MOVE
cid#1558042 COPY_INSTEAD_OF_MOVE
cid#1558038 COPY_INSTEAD_OF_MOVE
cid#1558037 COPY_INSTEAD_OF_MOVE
cid#1558034 COPY_INSTEAD_OF_MOVE
cid#1558031 COPY_INSTEAD_OF_MOVE
cid#1558027 COPY_INSTEAD_OF_MOVE
cid#1557994 COPY_INSTEAD_OF_MOVE
cid#1557977 COPY_INSTEAD_OF_MOVE
cid#1557970 COPY_INSTEAD_OF_MOVE
cid#1557966 COPY_INSTEAD_OF_MOVE
cid#1557957 COPY_INSTEAD_OF_MOVE
cid#1557954 COPY_INSTEAD_OF_MOVE
cid#1557941 COPY_INSTEAD_OF_MOVE
cid#1557933 COPY_INSTEAD_OF_MOVE
cid#1557918 COPY_INSTEAD_OF_MOVE
cid#1557907 COPY_INSTEAD_OF_MOVE
cid#1557890 COPY_INSTEAD_OF_MOVE
cid#1557883 COPY_INSTEAD_OF_MOVE
cid#1557881 COPY_INSTEAD_OF_MOVE
cid#1557861 COPY_INSTEAD_OF_MOVE
cid#1557842 COPY_INSTEAD_OF_MOVE
cid#1557840 COPY_INSTEAD_OF_MOVE
cid#1557830 COPY_INSTEAD_OF_MOVE
cid#1557830 COPY_INSTEAD_OF_MOVE

Change-Id: If5ee3396eafdb8b338d9e6cf0705be6e2b431fd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175577
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-25 10:48:12 +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
Caolán McNamara
2bafc7384b cid#1545605 COPY_INSTEAD_OF_MOVE
and

cid#1545841 COPY_INSTEAD_OF_MOVE
cid#1554682 COPY_INSTEAD_OF_MOVE
cid#1554686 COPY_INSTEAD_OF_MOVE
cid#1554715 COPY_INSTEAD_OF_MOVE
cid#1554750 COPY_INSTEAD_OF_MOVE
cid#1554759 COPY_INSTEAD_OF_MOVE
cid#1554770 COPY_INSTEAD_OF_MOVE
cid#1554779 COPY_INSTEAD_OF_MOVE
cid#1554794 COPY_INSTEAD_OF_MOVE
cid#1554800 COPY_INSTEAD_OF_MOVE
cid#1554826 COPY_INSTEAD_OF_MOVE
cid#1554836 COPY_INSTEAD_OF_MOVE
cid#1554862 COPY_INSTEAD_OF_MOVE
cid#1554865 COPY_INSTEAD_OF_MOVE
cid#1554872 COPY_INSTEAD_OF_MOVE
cid#1554883 COPY_INSTEAD_OF_MOVE
cid#1554906 COPY_INSTEAD_OF_MOVE
cid#1554921 COPY_INSTEAD_OF_MOVE
cid#1554926 COPY_INSTEAD_OF_MOVE
cid#1554946 COPY_INSTEAD_OF_MOVE
cid#1554956 COPY_INSTEAD_OF_MOVE
cid#1554970 COPY_INSTEAD_OF_MOVE
cid#1554986 COPY_INSTEAD_OF_MOVE
cid#1554991 COPY_INSTEAD_OF_MOVE
cid#1555013 COPY_INSTEAD_OF_MOVE
cid#1555037 COPY_INSTEAD_OF_MOVE
cid#1555050 COPY_INSTEAD_OF_MOVE
cid#1555057 COPY_INSTEAD_OF_MOVE
cid#1555066 COPY_INSTEAD_OF_MOVE
cid#1555067 COPY_INSTEAD_OF_MOVE
cid#1555083 COPY_INSTEAD_OF_MOVE
cid#1555097 COPY_INSTEAD_OF_MOVE
cid#1555135 COPY_INSTEAD_OF_MOVE
cid#1555140 COPY_INSTEAD_OF_MOVE
cid#1555146 COPY_INSTEAD_OF_MOVE
cid#1555148 COPY_INSTEAD_OF_MOVE
cid#1555149 COPY_INSTEAD_OF_MOVE
cid#1555155 COPY_INSTEAD_OF_MOVE
cid#1555157 COPY_INSTEAD_OF_MOVE
cid#1555168 COPY_INSTEAD_OF_MOVE
cid#1555195 COPY_INSTEAD_OF_MOVE
cid#1555196 COPY_INSTEAD_OF_MOVE
cid#1555237 COPY_INSTEAD_OF_MOVE

Change-Id: I90531c19c28dca77fe99c72efdfc0972c311da98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175377
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-22 11:56:02 +02:00
Jim Raykowski
8816296222 Resolves tdf#163515 - Basic Macro Organizer: After renaming a
document macro library the original library also remains

Change-Id: Ife89e1e164d288702d30e6b79f5e703ab9467e4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175182
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-10-21 14:09:32 +02:00
Bogdan Buzea
c2308be747 tdf#163486: PVS: Identical branches
Change-Id: I01aae9395213eb09c8bea990b2b6a811f7ab2ee2
V1037: Two or more case-branches perform the same actions. Check lines: 1249, 1277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175150
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-10-19 19:52:19 +02:00
Mike Kaganski
ff3791f67a tdf#163219: only create local With variable for function results
The problem is, that having a local variable referring the same value
as the original expression 'foo' is not the same as referencing 'foo'
itself. After 'foo' is re-assigned, the local variable still refers
to the original value, not the new one.

It seems impossible to implement the reference using existing codegen
primitives, to imitate the true reference to 'foo', not to its value.
If we implement it by changing the runtime, the bytecode won't work
identically in older versions; if we introduce a new bytecode, that
would be an incompatible change.

As a workaround, only create the local With variable, when the block
variable is created using some function (as much as known by parser).
I think that there would be cases when this would still not work as
intended: an example is a property implemented using getter function;
the parser would likely treat the property as a variable, and avoid
creation of the local variable; and the getter would be called every
time a dot access will happen (which was the essence of tdf#132064).
However, this seems a better alternative to the bug fixed here.

Change-Id: I50bf679762fd2e73f215a000fa0ab60fd6ae7453
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174564
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-07 09:38:38 +02:00
Mike Kaganski
fe40a5ca03 Simplify assignment of Nothing
In commits f3f46b5fe7 (tdf#132064: make
With statement only evaluate its argument once, 2024-04-18) and
40d0e6f4c4 (tdf#162962: always create a
local "Nothing" for the "WITH" variable, 2024-09-16), I used hacks to
emulate the global Nothing.

This change implements it properly, I think, It makes sure to use the
RTL's Nothing; this saves compile-time checks, strings in pool, and
makes code cleaner.

Change-Id: I3d007c5aa187e9aa61c1c369511be969b8cf57f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174553
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-06 16:40:42 +02:00
Noel Grandin
f65b204942 no need to do UNO_QUERY here
Change-Id: I52d13a7e4806d8fc34c4ff6f4cc5ab1e785a8b76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-20 19:12:27 +02:00
Andreas Heinisch
4506cd04c7 tdf#162431 - Check for missing parameters
Don't silently convert missing parameters including their error code to the request target typen when the target type can't handle the conversion.

Change-Id: I2300aa594ae3cc1045a6397c1195718b6662aa61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172593
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
2024-09-20 16:56:34 +02:00
Stephan Bergmann
c54b8e5682 Avoid -Werror,-Wunused-function
Change-Id: I95ca13db07a778fc260cbb78364916cc7400e378
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173590
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-09-18 20:12:09 +02:00
Noel Grandin
f48c9d59cc use more concrete UNO in basic
Change-Id: I6606008d9b45e00295cf441a7321a677d62317f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173581
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-09-18 15:02:58 +02:00
Mike Kaganski
539856dbb7 Fix formatting of dates
Redression after commit 81e1e0a2a6
(Refactor SbxValue::Format, 2024-09-13).

Change-Id: Ie7eb50c32f3c1a3aec73fc882dc33cce42734747
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173449
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-17 05:55:13 +02:00
Mike Kaganski
71ea7520eb Related: i#109051 There's no "Exit Let/Get/Set"
Before, these incorrect combinations were allowed, together with
the correct "Exit Property", which had been implemented in commit
5ed103d2dd (mib16: contributed
bugfixes and various new symbols in VBA compatibility
implementation, 2010-06-15).

Change-Id: Ic132c0860bb04007766977975a6ce9c8887138dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173427
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-17 05:54:24 +02:00
Mike Kaganski
196c89fc9d i#109051: also handle Exit Property for Property Set
An omission from commit 5ed103d2dd
(mib16: contributed bugfixes and various new symbols in VBA
compatibility implementation, 2010-06-15)

Change-Id: I1e08406eb1dcb64eeef5d925d22475f1b9f74de0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173426
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-17 05:54:15 +02:00
Mike Kaganski
40d0e6f4c4 tdf#162962: always create a local "Nothing" for the "WITH" variable
Other "WITH" blocks create the symbol that can be found by pPool->Find,
but can be not accessible at the call site.

Change-Id: I85ecc763a1bb3fd692c2c98e674047fdbde3f8f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173417
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-16 12:58:52 +02:00
Mike Kaganski
47a348bb0f tdf#162935: use PUTC for WITH variable assignment: it doesn't copy value
SbiRuntime::StepPUT, SbiRuntime::StepSET, SbiRuntime::StepVBASET call
checkUnoStructCopy eventually, which copies the UNO struct by value.
This is not what we need. On the other hand, SbiRuntime::StepPUTC only
makes the by-ref assignment, and makes the reference const; but Basic
code never assigns anything to the internal variable itself, only to
its members.

I hope that this time, I get it right.

Change-Id: I2b4a51a2dca9e7106e14e03360ef0d5a50b60079
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173305
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-13 01:55:07 +02:00
Mike Kaganski
81e1e0a2a6 Refactor SbxValue::Format
Change-Id: I1a55f2c6148246733699c1ff1086436af9d450b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173254
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-13 00:23:09 +02:00
Balazs Varga
b6775ce2b3 Temporarily skip unit tests on native arm64 build
which indicating unit test fails.

Change-Id: I2689b0dda888e15e52ca60cc18e1705a1aefe968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173143
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
2024-09-12 09:37:26 +02:00
Mike Kaganski
f24cf13f0e Related: tdf#158092 add a comment to avoid symbols localization
The localizable string is to allow different position/precision of the
components; but the localization of the symbols themselves (decimal
and thousand separator, currency) happens in code.

This comment is shown in Weblate UI.

Change-Id: Ib2f62fc8edf12ad3b182b40e3a8981c43b7ed67f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173104
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-11 17:01:09 +02:00
Mike Kaganski
b2257d1f78 Improve run-time Currency type support in Basic
Change-Id: I1e04c6022944034a30ef896b8cd24050ebe3bbd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173042
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-09 17:46:41 +02:00
Noel Grandin
ac9eaf5d11 use less dynamic_cast when broadcasting SfxHint
Change-Id: If4d33cbbf36a9ad495b80a7347b39d0f4bc0405e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172857
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-05 08:10:26 +02:00
Mike Kaganski
bb169c209c Fix ImpCurrencyToString to handle SAL_MIN_INT64
It can't be negated; so avoid the negation, and skip the minus in the
string result. Also, avoid needless creation of OUString.

Change-Id: If867c189b2ffd2794a58f66fd2511004ed4fc25a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172733
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-02 12:53:32 +02:00
Mike Kaganski
7bbf1f2a7d Refactor ImpCurrencyToString for simplicity
Change-Id: Ie7acafb3c81348f03340f1aaa53b3849c8dae4a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172694
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-01 04:06:52 +02:00
Mike Kaganski
a795fddafa tdf#162724: use localized decimal separator in ImpCurrencyToString
Same as in ImpCvtNum

Change-Id: Icbaa237e944a39309b01fdb18e668d054ff61c60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172693
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-01 04:06:40 +02:00
Mike Kaganski
712bddcec5 Move variables into their usage scope
Change-Id: I8d708ecdc94c19069d955b19daf1a5c5c4bc2f45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172584
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-08-31 08:04:37 +02:00
Mike Kaganski
1ecde0f5d1 Simplify default ImpScan usage
Drop LibreOffice6FloatingPointMode, and move the check introcuced in
commit 47aabde053 (Make the tdf#97983
changes to BASIC optional) into a simplified ImpScan overload.

Change-Id: Ibef723878179113a5403d2a3c55ded9df9cb292d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172595
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-30 07:34:31 +02:00
Caolán McNamara
2b4734c8a4 SbClassModuleObject never take a non-null arg
Change-Id: I1be4710a32355c104ba25005ec4f46c6f650b9c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172443
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-27 09:41:48 +02:00
Caolán McNamara
740194221e use a shared_ptr for SbiBreakpoints pBreaks as well
Change-Id: I3dec5ffe5fdf937d761c902970a94b73878a2cd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172441
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-27 09:41:41 +02:00