Commit Graph
1459 Commits
Author SHA1 Message Date
Mike Kaganski 37216049f1 tdf#165420: handle empty arguments correctly
Change-Id: Ib30cce816b2af8a780e09fa04a2129afd91fafe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182118
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-25 07:35:20 +01:00
Rahul Anand b3ae7a16b5 tdf#147132: Flatten Basic function implementations
Change-Id: Iac462f843bb1437027d2e7a5b6b856d2f00deb8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181317
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-15 09:15:57 +01:00
Simon Chenery 6586dbe956 tdf#154285 Check too many arguments to SbRtl_Abs() for BASIC ABS function
Change-Id: I82f1df998afca37f5e14baacc9c36339596724ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181447
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-02-12 07:41:21 +01:00
Simon Chenery b22f9843e6 tdf#154285 Check correct number of arguments to SbRtl_Now function
If BASIC function NOW is called with the wrong number of arguments,
then return error code 5 (Invalid procedure call).

Change-Id: I123f316e36e6726a2cfc9d1e53664ce632af1289
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181303
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-02-09 08:56:38 +01:00
Caolán McNamara c14614439b disable SbRtl_Shell by default in kit-mode
Change-Id: I645c776bf59a718f4946c2c70edd9194f039e471
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181071
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-04 10:33:00 +01:00
Manish Bera d8f405ccf6 tdf#147132 Flatten Basic function implementations
Change-Id: I3a9fe3c74b869195ffa9b34f180e8e58c841d9ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180312
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2025-02-03 12:49:54 +01:00
bruh 623521289e tdf#145614 Convert #define to enum
Change-Id: I146b65cc931dfc3ce2785ccb5c921e6385fbb4a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180015
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-19 15:58:40 +01:00
bruh c67bd0a332 tdf#147132 Flatten Basic function implementations.
Change-Id: I5e5d01c43b39f68f38290ce04b26730af362b43e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180282
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-16 12:42:11 +01:00
Alin Andrei Abahnencei 8e48c41a21 tdf#154285 Check upper bound of arguments in SbRtl_Second function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Ib3a97f9acb7778c90aa1c172ca82cf450a1e792f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179249
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-09 13:20:06 +01:00
Alin Andrei Abahnencei 7419fc569f tdf#154285 Check upper bound of arguments in SbRtl_Hour function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Ib372b4dfde77961e7982bd0d8f1f8598be7da726
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179252
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-01-09 13:19:13 +01:00
Alin Andrei Abahnencei 73dc528db8 tdf#154285 Check upper bound of arguments in SbRtl_Month function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Ifc27af0f091c75c02d3816b83b3717fc435ad31b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179250
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-01-09 13:18:16 +01:00
Alin Andrei Abahnencei 633a787707 tdf#154285 Check upper bound of arguments in SbRtl_Day function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Ic22d420f0f5596ea3a4ff9cd7e540e6c51a559ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179254
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-09 13:17:02 +01:00
Alin Andrei Abahnencei e08ed1d92f tdf#154285 Check upper bound of arguments in SbRtl_Year function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Iffffe3988afdc91068e85beaafc5ff1580210ec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179253
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-09 13:15:32 +01:00
Mike Kaganski b76d703382 tdf#164600: Return true from IsNumeric for booleans in VBASupport mode
Change-Id: Ib68f237001389c8f7b9d2771d5162a583b544b83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179866
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-01-08 06:02:48 +01:00
Mike Kaganski 20db60030e Use sal_Int32 for string length
Change-Id: Ie069c20b7d91631cb3b5d39e1a52f09cc13e8a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179864
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2025-01-08 06:02:37 +01:00
Alin Andrei Abahnencei 022e95d39d tdf#154285 Check upper bound of arguments in SbRtl_Minute function
Signed-off-by: Alin Andrei Abahnencei <alinandrei2004@gmail.com>
Change-Id: Ic861d453395a10d484614e29b5a491800ddb7a25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179251
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-01-05 16:00:08 +01:00
Bogdan Buzea 8787408cd8 tdf#147132 Flatten Basic function
Change-Id: I7dfec2da7ee3982255cd5be11d350c343331ed0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177459
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-12-27 14:44:38 +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 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
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
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
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 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
Mike Kaganski af15f1eb66 Simplify a bit
Change-Id: Ibe34a1c17d856146d191e784af06b8cb6301b912
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172007
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-08-18 10:53:25 +02:00
Mike Kaganski afb46ee880 tdf#150458: evaluate for loop's end and step once in VBA support mode
As required by [MS-VBAL], and actual VBA implementation.
It is a question if we also need to change it likewise in other
modes (normal, compatible) - see tdf#150460.

Change-Id: I1e83d57fe4be3bf264a64fe977909cf7684bc798
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172005
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-18 09:08:49 +02:00
Caolán McNamara 1b61a652c1 cid#1556583 COPY_INSTEAD_OF_MOVE
and

cid#1556585 COPY_INSTEAD_OF_MOVE
cid#1556588 COPY_INSTEAD_OF_MOVE
cid#1556593 COPY_INSTEAD_OF_MOVE
cid#1556597 COPY_INSTEAD_OF_MOVE
cid#1556605 COPY_INSTEAD_OF_MOVE
cid#1556617 COPY_INSTEAD_OF_MOVE
cid#1556635 COPY_INSTEAD_OF_MOVE
cid#1556790 COPY_INSTEAD_OF_MOVE
cid#1556792 COPY_INSTEAD_OF_MOVE
cid#1556796 COPY_INSTEAD_OF_MOVE
cid#1556799 COPY_INSTEAD_OF_MOVE
cid#1556815 COPY_INSTEAD_OF_MOVE
cid#1556836 COPY_INSTEAD_OF_MOVE
cid#1556840 COPY_INSTEAD_OF_MOVE
cid#1556842 COPY_INSTEAD_OF_MOVE
cid#1556859 COPY_INSTEAD_OF_MOVE
cid#1556860 COPY_INSTEAD_OF_MOVE
cid#1556866 COPY_INSTEAD_OF_MOVE
cid#1556869 COPY_INSTEAD_OF_MOVE
cid#1556870 COPY_INSTEAD_OF_MOVE

Change-Id: I3df8698a4aecbb03999c084517e37e12ff46ee97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171435
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-04 15:38:31 +02:00
Mike Kaganski 45290d41fb Clarify MsgBox buttons handling code
Change-Id: I0095b4b5312c851f1f64ec013c64f26e1b24ce09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171454
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-08-04 06:45:14 +02:00
Mike Kaganski b76af7f488 Refactor basic methods representing constants
Makes them more comprehensible; uses semantic names instead of magic
numbers. Added comments to the constants that are unclear.

Change-Id: Ifcb8a0d93ce057b8af08859b87ad3af8c67479e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171443
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-08-03 21:00:23 +02:00
Gabor Kelemen e1a351ca19 Remove now unneeded osl/diagnose.h
followup to commit 57c228803e

Change-Id: Iebfb23bb65e2bf898bf27f367cc9641f47a14cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167998
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
2024-07-20 10:20:31 +02:00
Andrea Gelmini 102cbf4626 Fix "lets" -> "let's"
Change-Id: I01968fc18b093dbbc27213f01c3da38ae151c62c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169748
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Tested-by: Jenkins
2024-06-29 17:22:12 +02:00
Andrea Gelmini 431e3d8a52 Fix typo
Change-Id: Ib6bfd1938d8d2da3d3aa9ccbb7b80750c4671f39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169279
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2024-06-20 19:22:44 +02:00
Stephan Bergmann 321284dde9 -Werror,-Wunused-function
Change-Id: I11af8dfbcdda6bbb77f2ccfaf2c994492bc3f807
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169282
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-06-20 18:32:31 +02:00
Andreas Heinisch 8730575016 tdf#161469 - Basic: align implementation now with the now function in calc
Align the implementation of the now function in basic with the now function in calc to include the also nanoseconds. The precision is limited to milliseconds to avoid comparision inaccuracies.

Change-Id: Ia85b653898f5849f67a171749725faab976b2a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168706
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-06-20 14:36:50 +02:00
Andreas Heinisch 84e8758d42 tdf#160321 - Don't execute jump statement if the expression is out of range
Don't execute On expression GoSub Statement; On expression GoTo
Statement if the expression lies out of range.

Change-Id: I5c1de25918b5e812d7ec82034f8d56351374d56a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165960
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
2024-06-10 13:52:00 +02:00
Noel Grandin 7d6e751faa loplugin:ostr basic
Change-Id: Ie5fc4676bd1cab2c0417b479bf08dda00936469a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06 13:56:49 +02:00
Caolán McNamara 41590e7d1f WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I8edb1fefe1b2b8a3db3ee8f3a0eed59c7f08a36e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166863
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-05-02 09:24:11 +02:00
Noel Grandin 6c4760f89c use more OUString literal in getBasicTypeName
Change-Id: I6e307e4387cbecac6391000b9ca7e632b2152b24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166979
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-02 08:18:59 +02:00
Stephan Bergmann 8d775b9259 Use Windows dllmgr-x64 also for aarch64
At least, CppunitTest_basic_macros CPPUNIT_TEST_NAME=Coverage::Coverage_Iterator
(which exercises it in basic/qa/basic_coverage/test_declare_from_dll.bas)
succeeds.

Change-Id: Ife90d5b84d5fb7bb4948cfeaf48180a6929a1dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166695
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-04-26 12:43:59 +02:00
Tuukka Orava f3d0a184c4 tdf#147132 Flatten Basic function implementations
Change-Id: I077e042c82cbefd1d46db5ca8d5983a0870a296c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165903
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-09 10:51:14 +02:00
AmandaQuaresmaCoutinho bb89fe7ab6 tdf#147132 Flatten Basic function implementations
Change-Id: Ife7a94cdfa8b31ba2a2bcbdf28c9620bbc5348ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165641
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-04-08 19:29:34 +02:00
Mike Kaganski f2482fd96e Simplify VBALikeToRegexp a bit
This cleans up some unnecessary escaping both
inside and outside [] groups.

Change-Id: I5abcf0fce634f0d8809bf4d318f61b8c8f69a318
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165703
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-03 04:35:10 +02:00
Mike Kaganski 38f731ff67 tdf#160478: fix Basic LIKE operator
1. The regex must match the whole input. Thus, the ^ and $ metacharacters
   must be replaced with \A and \z, which only match beginning and end of
   input, not any line start / end.
2. The * and ? metacharacters of LIKE must match newline character; thus,
   search flags must include UREGEX_DOTALL. To avoid changing TextSearch
   implementation, I use icu::RegexMatcher directly.

The direct use of icu::RegexMatcher also allowed to simplify the code by
calling icu::RegexMatcher::matches method.  This may perform better than
general-purpose utl::TextSearch::SearchForward.

Change-Id: I75776498b36f236da294462362ed5b36ed8cdf68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165700
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-02 19:47:35 +02:00
Gabor Kelemen 49a6a81965 tdf#146619 Drop unused 'using namespace' in: basic/
Change-Id: I55bd0c89880dd97307dde5a5b670e63f3ea66355
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165536
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-02 08:32:46 +02:00
U-Aarons_Laptop\Aaron 26c30fd77b tdf#147132: Flatten Basic function implementations
Change-Id: I9fcbc87b7ce01d96ffb45ddd3a525831c7cdcdaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165357
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-03-27 11:48:19 +01:00
Mike Kaganski d37df8fd1a Fix warning C4312 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717

Like these:

 C:/lo/core/sw/source/ui/dbui/addresslistdialog.cxx(426): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size

Change-Id: Idbfbe8add89c8e219bdabcf28b741e2e31a5e345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163781
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-23 01:35:14 +01:00
Adam Seskunas 95dace2eb1 tdf#154285 Check upper bound of arguments in SbRtl_CurDir
The LibreOffice Basic specification says CurDir should accept one
argument and in the case of a non-Windows system, ignore that argument
and simply return the current directory. So check that SbRtl_CurDir
accepts a maximum of two arguments.

Change-Id: Ia60114fac31aa4261c8251e26ef172a0370e6abc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163150
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-02-13 05:51:04 +01:00