Mike Kaganski
759c57bca1
No need to use vector here
...
Change-Id: I1345ed034e92f4576e62ada2e85f1fd78d457fa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185593
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-05-22 06:07:49 +02:00
Razvan Degeratu
7744d3134b
tdf#162986 Restrict ending of Property Let and Set to only End Property
...
Change-Id: I023dc6399f97dc5ff1ca6503dbbc0cc7a30eea95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185249
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-05-13 12:45:58 +02:00
Alexandru Diaconu
047c84f431
tdf#162983 Restrict closure of Function and Sub to only End Function and Sub.
...
Change-Id: Ib08b5961e61d7a151fa7c67666b0f5e31a7828b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185185
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-05-12 16:05:27 +02:00
Mike Kaganski
33434f1620
tdf#166342: refactor SbxValue::Format again, to handle date/time strings
...
Commit 81e1e0a2a6 changed string-to-number
procedure from SvNumberFormatter to only use SbxValue::ScanNumIntnl. But
the latter can only handle strings with simple numbers, not with dates,
times and the like.
This change restores use of SvNumberFormatter to convert input strings
to number, when SbxValue::ScanNumIntnl fails. The code is re-structured
for performance, to avoid creating SvNumberFormatter twice, and repeated
calls to GetOUString.
Change-Id: I89a4fc041fe24fe00b099ab4fbee371d1f6b5567
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185047
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-05-08 17:42:21 +02:00
Mike Kaganski
5a9c784cba
tdf#136112: return 'Date' type from Time()
...
Change-Id: Id21a4c378ddf9888740b3201f109e1897b722ded
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185046
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-05-08 15:15:36 +02:00
Ahmed Khaled
b710ba4850
tdf#154285 Check upper bound of arguments in SbRtl_FindObject &
...
SbRtl_FindPropertyObject function
Change-Id: I49b56f0231c5a19871a4a007a0bc21598920b72c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183052
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
Tested-by: Jenkins
2025-05-07 07:41:52 +02:00
Simon Chenery
50cf101df5
tdf#145614 Convert #define JMP_TABLE_SIZE to constexpr
...
Change-Id: Iedc40d790a4822d0cb65480e1e4b64439de39db5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183496
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
2025-04-24 06:45:35 +02:00
Nam Bui
0fbe68c63b
tdf#147132 Flatten Basic function implementations
...
Flattened SbRtl_RmDir() and SbRtl_FuncCaller()
Change-Id: I28168d88209b0d72333849633a64f269735591f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183690
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-04-23 19:44:11 +02:00
Noel Grandin
fbe05bc89a
loplugin:bufferadd extend it to find some more places
...
where we can simplify *StringBuffer usage
Change-Id: Ic2005b886b486a6627a43f8dcfba3258cb168921
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184428
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
Tested-by: Jenkins
2025-04-22 11:53:07 +02:00
Mike Kaganski
080198e691
Reorder checks for clarity
...
Change-Id: I3b18f2dab7b4d7e874548c252730566b2df12798
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184077
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-04-12 12:02:50 +02:00
Gabor Kelemen
530e3ae320
Remove obsolete fw declarations from avmedia, basctl, basic, binaryurp
...
found with bin/find-unneeded-includes --fwdecl
Change-Id: Ia9eb16d95b02b5e8c13a98b6cc4b06a6315f2311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183878
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de >
Tested-by: Jenkins
2025-04-11 10:52:47 +02:00
FerMeza
f3c89726d2
tdf#163691 Replace memcpy with std::copy in basmgr.cxx
...
Change-Id: I88558282937fe9c4dfb2f102309583f932a4617c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183827
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
2025-04-08 17:24:05 +02:00
Ilmari Lauhakangas
f336fc1835
Revert "tdf#163691 Replace memcpy with std::copy in basmgr.cxx and image.cxx"
...
This reverts commit fa357e4a0a .
Reason for revert: no license statement submitted
Change-Id: I45f473c3185df5593a55017fcbaefd03dc5f43e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183790
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
Tested-by: Jenkins
2025-04-07 17:59:19 +02:00
Noel Grandin
6845b8a926
loplugin:constparam in various
...
Change-Id: I874a95777aed3471675bf03acfcf05ecfcb4f830
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183531
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2025-03-31 13:18:12 +02:00
Simon Chenery
45ff93aea2
tdf#154285 Check too many arguments to BASIC WEEKDAY function
...
Change-Id: I8f3044f1c8ebf12d4654b5ad173563e09897ccc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183494
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-03-31 06:48:33 +02:00
Mike Kaganski
ec5bbc9a98
Simplify Val function implementation
...
Use o3tl::toInt64 instead of strtol, which required string conversion.
Change-Id: Ie7571834e8a126963899f340230baa14e3353b4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183489
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-03-29 21:10:37 +01:00
Mike Kaganski
4409dbbdbc
Use osl_getEnvironment instead of getenv
...
Avoids the need to convert between OUString and OString;
and resolves a pressing Win16 compatibility issue.
Change-Id: I4cf5b6962050181a66a33c1261c9440ac7a39b82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183487
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-03-29 17:56:22 +01:00
Mike Kaganski
bb57fa601a
Avoid useless OUString -> OString -> OUString conversion
...
Change-Id: I938d13d91bc83b9fd0c018e676923c27a7cad637
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183484
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-03-29 17:03:00 +01:00
Haokun Wu
fa357e4a0a
tdf#163691 Replace memcpy with std::copy in basmgr.cxx and image.cxx
...
Change-Id: I19714fd28f0a859586a4699d0ff01673b5e7e42f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183284
Reviewed-by: Hossein <hossein@libreoffice.org >
Tested-by: Jenkins
2025-03-27 01:22:41 +01:00
Akshay Kumar Dubey
90490e7436
tdf#163691 Use std::copy() instead of memcpy().
...
Change-Id: I4fbbb4f53542c2b5b86722f7721c51fb8dacd83b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183038
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org >
2025-03-18 14:26:14 +01:00
Noel Grandin
09e2627a83
use more concrete UNO types in some local vars
...
found by a little plugin I created.
Plugin parked into store/ folder because it needs hand-holding
when run.
Change-Id: I2b4da7378f0becbc5f020ac9e78cd765aa0119b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181768
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
Tested-by: Jenkins
2025-02-26 16:56:56 +01:00
Arnaud VERSINI
9fddd34834
basic : use more OUString literals in basic comp
...
Change-Id: Ib67bee7e4ba85602be266bb7acc23c52251548b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177611
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me >
2025-02-26 07:58:16 +01:00
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
Simon Chenery
1fc03eaed2
tdf#158237 Use C++20 contains() instead of find() and end()
...
Change-Id: I0efe76b814035aad9faa86c9dfed447759a4448b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182015
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org >
2025-02-23 22:25:40 +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
7daf54c93d
avoid uno casting cost, and simplify
...
these are always XStorageBasedLibraryContainers, so transport
around as that and can avoid casting and some expensive throw/catches
Change-Id: I772efceea3bb4f38d70be0497345f5f81173494c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181156
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com >
2025-02-05 14:01:39 +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
Mike Kaganski
f071292a5a
tdf#160578: do not modify procedure argument type based on its use
...
Since the initial import, there is a code in SbiExpression::Term, that
checks if the defined symbol is used as object (e.g., dot notation to
access its members), and then, if its defined type is Variant, then it
is corrected to Object. There is no rationale for this in comments; so
I have no way to know what could break if that core is dropped.
It's obvious that at least for procedure arguments, such correction is
wrong: the argument definition is the procedure's API; and the actual
use of the symbol should not unexpectedly change what is advertised.
This change limits the application of the correction to non-arguments.
If it should be dropped completely is a separate question.
Change-Id: Ia902afa3f744d0d51510ba6903be45f78e2f6429
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180665
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-01-23 20:14:51 +01:00
Mike Kaganski
63e7a70ad1
tdf#164811: swap the "if IsCompatibility()" branches to match other places
...
Commit 9cdb73ff28 (INTEGRATION: CWS jl5vba
(1.25.94); FILE MERGED, 2004-03-17) has introduced handling of decimal,
currency, and date for VBASupport mode in sbunoobj.cxx. However, in
getUnoTypeForSbxBaseType, it changed the behavior for date type in the
non-VBASupport mode, obviously by mistake. This change swaps the code
in the 'if' branches, to what appears to be the original intention.
Change-Id: I88cddf7cec1a980f56de96ae1c5e64d8e7630b77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180637
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-01-23 20:14:46 +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
f8ac9d3311
tdf#164599: Allow space between sign and number in VBASupport mode
...
Change-Id: Ib9e8c8770f8c2d1b348ff032502467915829c4f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179865
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2025-01-08 06:02:43 +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
Mike Kaganski
bb86627216
tdf#154284: check if ImpScan found a number at all
...
Change-Id: Iddc87bd0d04f9b0212b03d63f3177b17bb07d278
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179863
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2025-01-08 06:02:30 +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
Mike Kaganski
b01e697b53
tdf#164446: fix internationalized FP input in Basic IDE Watch
...
Now that tdf#97983 fix made the default conversion internationalized,
the special handling of the Watch window input needs to do it in the
other direction. Additionally, move ImpConvStringExt to the single
place that uses it.
Change-Id: I18a4043511f4a1b32f79410447e96c7679329886
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179302
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2024-12-24 12:03:02 +01:00
Mike Kaganski
a3b43e95ba
Simplify ImpScan
...
Change-Id: I8928d3c7f0fc6884a75c05e77908df7f482c9e44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179246
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2024-12-23 20:36:11 +01:00
Mike Kaganski
a3a7927408
Simplify a bit
...
The previous code made sure that cNonIntntlDecSep is always equal to
IntntlDecSep (in the code handling bOnlyIntntl). Frop the redundancy,
and make the variable names simpler.
Change-Id: I31c994cd49bdbf007e110f593297acf112cc420b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179198
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Tested-by: Jenkins
2024-12-23 11:22:11 +01:00
Mike Kaganski
e40b541d7a
Fix a copypasta
...
From commit 9e9f39d171 (resolved
rhbz#919020 Basic CDbl() and CSng() scan localized number, 2013-03-19)
Change-Id: I871d7fb06ccb5d15723f7acfb57701890607055f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179197
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2024-12-23 11:21:56 +01:00
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