Commit Graph

4585 Commits

Author SHA1 Message Date
437412d79b cid#1557980 COPY_INSTEAD_OF_MOVE
and

cid#1557869 COPY_INSTEAD_OF_MOVE
cid#1557807 COPY_INSTEAD_OF_MOVE
cid#1557804 COPY_INSTEAD_OF_MOVE
cid#1557799 COPY_INSTEAD_OF_MOVE
cid#1557781 COPY_INSTEAD_OF_MOVE
cid#1557781 COPY_INSTEAD_OF_MOVE
cid#1557766 COPY_INSTEAD_OF_MOVE
cid#1557746 COPY_INSTEAD_OF_MOVE
cid#1557737 COPY_INSTEAD_OF_MOVE

Change-Id: I1866c576f525ea697c62e9e0a96890e5fdaa780f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171795
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-14 09:27:19 +02:00
d7056b1456 cid#1558088 COPY_INSTEAD_OF_MOVE
and

cid#1558080 COPY_INSTEAD_OF_MOVE
cid#1558077 COPY_INSTEAD_OF_MOVE
cid#1558055 COPY_INSTEAD_OF_MOVE
cid#1558043 COPY_INSTEAD_OF_MOVE
cid#1558039 COPY_INSTEAD_OF_MOVE
cid#1558015 COPY_INSTEAD_OF_MOVE
cid#1558014 COPY_INSTEAD_OF_MOVE
cid#1558009 COPY_INSTEAD_OF_MOVE
cid#1558002 COPY_INSTEAD_OF_MOVE
cid#1557998 COPY_INSTEAD_OF_MOVE
cid#1557996 COPY_INSTEAD_OF_MOVE
cid#1557990 COPY_INSTEAD_OF_MOVE
cid#1557986 COPY_INSTEAD_OF_MOVE
cid#1557980 COPY_INSTEAD_OF_MOVE
cid#1557971 COPY_INSTEAD_OF_MOVE
cid#1557968 COPY_INSTEAD_OF_MOVE
cid#1557967 COPY_INSTEAD_OF_MOVE
cid#1557961 COPY_INSTEAD_OF_MOVE
cid#1557959 COPY_INSTEAD_OF_MOVE
cid#1557958 COPY_INSTEAD_OF_MOVE
cid#1557956 COPY_INSTEAD_OF_MOVE
cid#1557953 COPY_INSTEAD_OF_MOVE
cid#1557949 COPY_INSTEAD_OF_MOVE
cid#1557947 COPY_INSTEAD_OF_MOVE
cid#1557940 COPY_INSTEAD_OF_MOVE
cid#1557931 COPY_INSTEAD_OF_MOVE
cid#1557930 COPY_INSTEAD_OF_MOVE
cid#1557915 COPY_INSTEAD_OF_MOVE
cid#1557913 COPY_INSTEAD_OF_MOVE
cid#1557910 COPY_INSTEAD_OF_MOVE
cid#1557886 COPY_INSTEAD_OF_MOVE
cid#1557884 COPY_INSTEAD_OF_MOVE
cid#1557880 COPY_INSTEAD_OF_MOVE
cid#1557875 COPY_INSTEAD_OF_MOVE
cid#1557871 COPY_INSTEAD_OF_MOVE
cid#1557862 COPY_INSTEAD_OF_MOVE
cid#1557847 COPY_INSTEAD_OF_MOVE
cid#1557845 COPY_INSTEAD_OF_MOVE
cid#1557844 COPY_INSTEAD_OF_MOVE
cid#1557843 COPY_INSTEAD_OF_MOVE
cid#1557838 COPY_INSTEAD_OF_MOVE
cid#1557835 COPY_INSTEAD_OF_MOVE
cid#1557834 COPY_INSTEAD_OF_MOVE
cid#1557828 COPY_INSTEAD_OF_MOVE
cid#1557823 COPY_INSTEAD_OF_MOVE
cid#1557817 COPY_INSTEAD_OF_MOVE
cid#1557813 COPY_INSTEAD_OF_MOVE
cid#1557812 COPY_INSTEAD_OF_MOVE

Change-Id: I55d4a920daa2d148683419169eb828325fd3c757
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171732
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-11 20:14:54 +02:00
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
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
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
7f9f32aa11 cid#1556472 COPY_INSTEAD_OF_MOVE
and

cid#1556481 COPY_INSTEAD_OF_MOVE
cid#1556486 COPY_INSTEAD_OF_MOVE
cid#1556491 COPY_INSTEAD_OF_MOVE
cid#1556507 COPY_INSTEAD_OF_MOVE
cid#1556515 COPY_INSTEAD_OF_MOVE
cid#1556518 COPY_INSTEAD_OF_MOVE
cid#1556519 COPY_INSTEAD_OF_MOVE
cid#1556533 COPY_INSTEAD_OF_MOVE
cid#1556536 COPY_INSTEAD_OF_MOVE
cid#1556559 COPY_INSTEAD_OF_MOVE
cid#1556577 COPY_INSTEAD_OF_MOVE
cid#1556581 COPY_INSTEAD_OF_MOVE

Change-Id: I2ad2f2194e2a89c7246e8742b2fc8be7580e38c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171394
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-02 17:27:10 +02:00
d5ad9c0777 cid#1556086 COPY_INSTEAD_OF_MOVE
and

cid#1556087 COPY_INSTEAD_OF_MOVE
cid#1556093 COPY_INSTEAD_OF_MOVE
cid#1556094 COPY_INSTEAD_OF_MOVE
cid#1556105 COPY_INSTEAD_OF_MOVE
cid#1556121 COPY_INSTEAD_OF_MOVE
cid#1556184 COPY_INSTEAD_OF_MOVE
cid#1556399 COPY_INSTEAD_OF_MOVE
cid#1556405 COPY_INSTEAD_OF_MOVE
cid#1556419 COPY_INSTEAD_OF_MOVE
cid#1556421 COPY_INSTEAD_OF_MOVE
cid#1556444 COPY_INSTEAD_OF_MOVE
cid#1556448 COPY_INSTEAD_OF_MOVE
cid#1556457 COPY_INSTEAD_OF_MOVE
cid#1556468 COPY_INSTEAD_OF_MOVE

Change-Id: I1f352682daebd4e3ed2e7fe669aa0943dcc33edd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171372
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-08-02 10:05:45 +02:00
8f008bf4b9 cid#1554812 COPY_INSTEAD_OF_MOVE
and

cid#1555227 COPY_INSTEAD_OF_MOVE
cid#1555329 COPY_INSTEAD_OF_MOVE
cid#1555384 COPY_INSTEAD_OF_MOVE
cid#1555387 COPY_INSTEAD_OF_MOVE
cid#1555399 COPY_INSTEAD_OF_MOVE
cid#1555400 COPY_INSTEAD_OF_MOVE
cid#1555406 COPY_INSTEAD_OF_MOVE

Change-Id: I85dc45e2686c6b3e8b97a23872cb26416edc27c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171178
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-29 14:50:38 +02:00
1bbcc3fdf3 O[U]String overloads that return view for rest parameter
Add new overloads to OUString methods that have a
"OUString* rest" style parameter.

Instead return a view, which does not require allocation.

To avoid overload ambiguity, split the methods into
different variants that do not use default parameters.

Change-Id: I1aa366115750f1f7ea4fe665804195f59f7c4b69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167632
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-07-25 13:29:11 +02:00
8a83a62410 cid#1555167 COPY_INSTEAD_OF_MOVE
and

cid#1555172 COPY_INSTEAD_OF_MOVE
cid#1555184 COPY_INSTEAD_OF_MOVE
cid#1555188 COPY_INSTEAD_OF_MOVE
cid#1555197 COPY_INSTEAD_OF_MOVE
cid#1555209 COPY_INSTEAD_OF_MOVE
cid#1555211 COPY_INSTEAD_OF_MOVE
cid#1555215 COPY_INSTEAD_OF_MOVE
cid#1555216 COPY_INSTEAD_OF_MOVE
cid#1555217 COPY_INSTEAD_OF_MOVE
cid#1555218 COPY_INSTEAD_OF_MOVE
cid#1555222 COPY_INSTEAD_OF_MOVE
cid#1556674 COPY_INSTEAD_OF_MOVE
cid#1555229 COPY_INSTEAD_OF_MOVE
cid#1555233 COPY_INSTEAD_OF_MOVE
cid#1555234 COPY_INSTEAD_OF_MOVE
cid#1555242 COPY_INSTEAD_OF_MOVE
cid#1555250 COPY_INSTEAD_OF_MOVE
cid#1555251 COPY_INSTEAD_OF_MOVE
cid#1555254 COPY_INSTEAD_OF_MOVE
cid#1555304 COPY_INSTEAD_OF_MOVE
cid#1555307 COPY_INSTEAD_OF_MOVE
cid#1555317 COPY_INSTEAD_OF_MOVE
cid#1555329 COPY_INSTEAD_OF_MOVE
cid#1555340 COPY_INSTEAD_OF_MOVE
cid#1555347 COPY_INSTEAD_OF_MOVE
cid#1555352 COPY_INSTEAD_OF_MOVE
cid#1555358 COPY_INSTEAD_OF_MOVE
cid#1555363 COPY_INSTEAD_OF_MOVE
cid#1555365 COPY_INSTEAD_OF_MOVE
cid#1555367 COPY_INSTEAD_OF_MOVE
cid#1555374 COPY_INSTEAD_OF_MOVE
cid#1555380 COPY_INSTEAD_OF_MOVE

Change-Id: I343194c10749488a1143e2517ee0638ab19da218
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170888
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-23 21:58:02 +02:00
e1a351ca19 Remove now unneeded osl/diagnose.h
followup to commit 57c228803e55ed343c6693de7d0857ad7d3cd9e3

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
68b782a279 cid#1607572 silence bogus Copy-paste error
Change-Id: Id8355a033089a47299d76e1743b7da5a1b4a5d5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170454
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-07-14 18:26:13 +02:00
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
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
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
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
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
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
a123c5b39a basic : use more OUString literals
Change-Id: I38f57c64c0d110e892982eaed2619c0915fe93b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166825
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2024-05-05 14:44:04 +02:00
7ab8d33522 basic : use std::u16string_view and new OUString literal
Change-Id: Id3cd708b98e1b0551955562afe3ac594bdc6e50a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167153
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2024-05-05 13:42:05 +02:00
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
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
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
a400c865a6 tdf#93727 Syntax Error on # in basic
Change-Id: I400a4061de580a5c91b0e4763cad40ae88a9f738
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162639
Tested-by: Jenkins
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-04-22 16:05:53 +02:00
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
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
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
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
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
d547ad7755 convert NameContainer to comphelper::WeakImplHelper
Change-Id: If89ee5bf200affc04704b7f075f25cbf599c1e62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165494
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-29 07:41:58 +01:00
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
68b73e7a29 basic : use OUstring literal for XServiceInfo implementation
Change-Id: Ic4501ec887bb3f1249ab4a8da1eae07f6b2a22ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164305
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2024-03-11 08:32:32 +01:00
1ac5353bbb Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-free
The events may be processed after the shell has been destroyed. This is
happening reliably after commit e2bfc34d146806a8f96be0cd2323d716f12cba4e
(Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable,
2024-03-11) when controlling LibreOffice from external Java scripts; but
obviously, it could happen before as well.

Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase.

Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-11 04:43:28 +01:00
60dd46ee18 Simplify a bit
Change-Id: Id9640825e117531ed1b67db9e83349c556f291c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164004
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-27 11:36:45 +01:00
dd8fc8e24b Typo: alredy->already
Change-Id: I67fa846c71cf91563c3457cec98195b1886e3fa9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164025
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-02-27 11:02:51 +01:00
8bbfbe92c0 tdf#159908: return early to avoid nullptr dereference
When aLvalue is not a variable, its GetRealVar() returns nullptr.
That was dereferenced unconditionally later in the check of the
variable after NEXT.

Change-Id: Ia46f23a7e720431bf62ace998848b684aa8449e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164002
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-27 10:33:52 +01:00
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
ff23937c34 Fix warning C4459 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717

Like these:

 C:/lo/core/oox/source/export/shapes.cxx(2411): warning C4459: declaration of 'XML_line' hides global declaration

Change-Id: I74738753254ad1c468025d25bfb0bfe21787180f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163779
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-23 01:34:45 +01:00
b3e6bec350 Fix warning C4589 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717

Like these:

 C:\libcmis\inc\libcmis/document.hxx(51): warning C4589: Constructor of abstract class 'libcmis::Document' ignores initializer for virtual base class 'libcmis::Object'
 C:\libcmis\inc\libcmis/document.hxx(51): note: virtual base classes are only initialized by the most-derived type
 C:\libcmis\inc\libcmis/folder.hxx(58): warning C4589: Constructor of abstract class 'libcmis::Folder' ignores initializer for virtual base class 'libcmis::Object'
 C:\libcmis\inc\libcmis/folder.hxx(58): note: virtual base classes are only initialized by the most-derived type

Change-Id: Icc7f94cc02796a86b47b025df69ec3db971ad11e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163777
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-23 01:34:11 +01:00
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
8318337c3e tdf#147132 tdf#154285 basic: Flatten and check param count of Is* fns
Change-Id: I6d27dd49613a5cc26f4244dadc9bdd65361a0475
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162657
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
2024-02-09 00:30:21 +01:00
942e9a79f0 Related: tdf#159458 Move variable URL re-creation to a central place
Change-Id: Ib73ae476f308b2579a15c9b2474a55e3558c134c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162786
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-31 06:56:42 +01:00
907d410789 tdf#159458: make sure to update unexpanded URL when renaming library
1. If passed new source URL is expanded (i.e., trying to expand it in
SfxLibraryContainer::checkStorageURL didn't change it), previously
aUnexpandedStorageURL was unchanged. It should be cleared - then it
will be set automatically to the URL to lib info file.

2. Try to create the "variable" path (starting with "$(USER)/basic/")
because this avoids absolute paths to the libraries, which make it
harder to move the profile.

Change-Id: Ie83ea9a32cfddf37727d238547663aeb72487ee3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162777
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-31 03:35:15 +01:00
3808ef2b27 cid#1545535 COPY_INSTEAD_OF_MOVE
and

cid#1545526 COPY_INSTEAD_OF_MOVE
cid#1545442 COPY_INSTEAD_OF_MOVE
cid#1545426 COPY_INSTEAD_OF_MOVE
cid#1545425 COPY_INSTEAD_OF_MOVE
cid#1545387 COPY_INSTEAD_OF_MOVE
cid#1545379 COPY_INSTEAD_OF_MOVE
cid#1545337 COPY_INSTEAD_OF_MOVE
cid#1545334 COPY_INSTEAD_OF_MOVE
cid#1545289 COPY_INSTEAD_OF_MOVE
cid#1545282 COPY_INSTEAD_OF_MOVE
cid#1545270 COPY_INSTEAD_OF_MOVE
cid#1545237 COPY_INSTEAD_OF_MOVE

Change-Id: Iae44a7347c85ae2e367bf672214b2013f30466f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161968
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12 20:21:35 +01:00
7e0afa422c ofz#65329 Fuzzing build failure
since:

commit 9cc8457abcae57c7f9de6e0fbca1fbc2a0cc9892
Date:   Fri Dec 15 23:09:19 2023 -0700

    tdf#128122 Updated BASIC CCur to reuse SvNumberFormatter

LibreOfficeOssFuzz.conf has --enable-ld=gold and that will just
crash on an unresolved symbol without any explanation, but building
without will give something useful, e.g.

sbxcurr.cxx:(.text._Z14ImpGetCurrencyPK9SbxValues[_Z14ImpGetCurrencyPK9SbxValues]+0x89f): undefined reference to `SbiInstance::GetNumberFormatter()'
/usr/bin/ld: sbxcurr.cxx:(.text._Z14ImpGetCurrencyPK9SbxValues[_Z14ImpGetCurrencyPK9SbxValues]+0xbf7): undefined reference to `SbiInstance::PrepareNumberFormatter(unsigned int&, unsigned int&, unsigned int&, o3tl::strong_int<unsigned short, LanguageTypeTag> const*, DateOrder const*)'

Change-Id: I4b555760a609ec04fd85f7ba9c198a3d2ac712c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161294
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-29 14:54:54 +01:00
9cc8457abc tdf#128122 Updated BASIC CCur to reuse SvNumberFormatter
Previously, BASIC CCur used a custom, single-purpose currency string
parser which did not properly accommodate the user's locale setting.
This change replaces the custom parser with SvNumberFormatter, which
does correctly respect system locale.

Change-Id: I179915eb080e876e5e550dd350fdb86d7fa2bf4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160848
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-12-23 09:12:24 +01:00
21dd05a2a2 cid#1557601 COPY_INSTEAD_OF_MOVE
and

cid#1546498 COPY_INSTEAD_OF_MOVE
cid#1546384 COPY_INSTEAD_OF_MOVE
cid#1546376 COPY_INSTEAD_OF_MOVE
cid#1546374 COPY_INSTEAD_OF_MOVE
cid#1546373 COPY_INSTEAD_OF_MOVE
cid#1546368 COPY_INSTEAD_OF_MOVE
cid#1546365 COPY_INSTEAD_OF_MOVE
cid#1546356 COPY_INSTEAD_OF_MOVE
cid#1546340 COPY_INSTEAD_OF_MOVE
cid#1546266 COPY_INSTEAD_OF_MOVE
cid#1546236 COPY_INSTEAD_OF_MOVE
cid#1546188 COPY_INSTEAD_OF_MOVE
cid#1546178 COPY_INSTEAD_OF_MOVE
cid#1546166 COPY_INSTEAD_OF_MOVE
cid#1546156 COPY_INSTEAD_OF_MOVE
cid#1546144 COPY_INSTEAD_OF_MOVE
cid#1546143 COPY_INSTEAD_OF_MOVE
cid#1546100 COPY_INSTEAD_OF_MOVE
cid#1546078 COPY_INSTEAD_OF_MOVE
cid#1546041 COPY_INSTEAD_OF_MOVE
cid#1546036 COPY_INSTEAD_OF_MOVE
cid#1546033 COPY_INSTEAD_OF_MOVE

Change-Id: Ib3586d93198992e206baf5c2de5a663d5574aa3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160979
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-19 17:18:42 +01:00
de4b3a135f cid#1545970 COPY_INSTEAD_OF_MOVE
and

cid#1545957 COPY_INSTEAD_OF_MOVE
cid#1545944 COPY_INSTEAD_OF_MOVE
cid#1545939 COPY_INSTEAD_OF_MOVE
cid#1545931 COPY_INSTEAD_OF_MOVE
cid#1545926 COPY_INSTEAD_OF_MOVE
cid#1545909 COPY_INSTEAD_OF_MOVE
cid#1545899 COPY_INSTEAD_OF_MOVE
cid#1545896 COPY_INSTEAD_OF_MOVE
cid#1545894 COPY_INSTEAD_OF_MOVE
cid#1545858 COPY_INSTEAD_OF_MOVE
cid#1545823 COPY_INSTEAD_OF_MOVE
cid#1545820 COPY_INSTEAD_OF_MOVE
cid#1545819 COPY_INSTEAD_OF_MOVE
cid#1545772 COPY_INSTEAD_OF_MOVE
cid#1545749 COPY_INSTEAD_OF_MOVE
cid#1545743 COPY_INSTEAD_OF_MOVE
cid#1545739 COPY_INSTEAD_OF_MOVE
cid#1545635 COPY_INSTEAD_OF_MOVE
cid#1545603 COPY_INSTEAD_OF_MOVE
cid#1545602 COPY_INSTEAD_OF_MOVE
cid#1545592 COPY_INSTEAD_OF_MOVE
cid#1545544 COPY_INSTEAD_OF_MOVE
cid#1545532 COPY_INSTEAD_OF_MOVE
cid#1545520 COPY_INSTEAD_OF_MOVE
cid#1545512 COPY_INSTEAD_OF_MOVE
cid#1545490 COPY_INSTEAD_OF_MOVE
cid#1545483 COPY_INSTEAD_OF_MOVE
cid#1545467 COPY_INSTEAD_OF_MOVE
cid#1545461 COPY_INSTEAD_OF_MOVE
cid#1545458 COPY_INSTEAD_OF_MOVE
cid#1545428 COPY_INSTEAD_OF_MOVE
cid#1545394 COPY_INSTEAD_OF_MOVE
cid#1545385 COPY_INSTEAD_OF_MOVE
cid#1545383 COPY_INSTEAD_OF_MOVE
cid#1545366 COPY_INSTEAD_OF_MOVE
cid#1545357 COPY_INSTEAD_OF_MOVE

Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-16 22:39:20 +01:00
6ba9e3323d loplugin:unusedfields
The sPassword field in SvtHistoryOptions became redundant
after
    commit c0fffdc36df687fe8e4eff49e5a00d3a3c1eb370
    Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
    Date:   Mon Oct 2 12:35:21 2023 +0200
    [API CHANGE] Remove deprecated Password config item

Change-Id: Ie0c4597da5cd510f405400c215110c1e357cb497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-13 18:09:16 +01:00
2b4094195e Clean up SvStream API a bit
Change-Id: Ic9847185e8f551eeb05715902374d7a9a9032f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160546
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-11 07:10:31 +01:00