Caolán McNamara
7e22869694
cid#1473732 Untrusted loop bound
...
and
cid#1474044 Untrusted loop bound
Change-Id: If30dc454d60adca11fd1a53ecf472555e328bd42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113441
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-04-01 11:35:14 +02:00
Caolán McNamara
a69ad67504
fix some --disable-scripting warnings
...
Change-Id: I0fa5ec5e0fc7a08f5558f013ec75fd7d4fe5c1a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113379
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-03-30 21:23:28 +02:00
Caolán McNamara
b80fc56c89
cid#1474044 Untrusted loop bound
...
Change-Id: I9f060fe0b56905def7b81a9b7da0b504367eb36c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113337
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-03-30 12:34:39 +02:00
Alain Romedenne
08151f4827
TypeName, VarType, TypeLen Basic QA test cases
...
1- exhibiting array type names
2- highlighting supplemental libO Basic constants
3- precising data types internal representations
I intend to document in help:
1- primitive data types array names: Boolean(), Byte(), … as IsArray() function does not provide such info
2- Publish extra Basic constants for already published values:
- V_OBJECT=9, V_BOOLEAN=11, V_VARIANT=12, V_BYTE=17
- not necessarily V_ARRAY=8192, V_ERROR=10
The latter is conditioned to the creation of an enhancement request.
FYI, published Vartype() values and constants for VBA and other Basic-like languages:
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/vartype-function
https://docs.xojo.com/VarType
https://help.hcltechsw.com/dom_designer/9.0.1/appdev/LSAZ_DATATYPE_FUNCTION.html
Change-Id: I51bac3caf555d94e91de7c6d624b3fca9e73a673
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111042
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-29 15:29:39 +02:00
Caolán McNamara
e96b6f8a8c
cid#1474044 Untrusted loop bound
...
Change-Id: Ibb20ffc2219c25add421cd4803e80b15b131c93b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113306
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-03-29 15:02:46 +02:00
Noel
b624b13b3d
loplugin:flatten
...
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-03-26 18:02:19 +01:00
Mike Kaganski
a0656ec6fc
const OUString -> const OUStringLiteral
...
Mostly automated rewrite
Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-25 10:06:26 +01:00
Hossein
c16158772d
Using .md extension/Markdown syntax for modules README
...
Renaming all README files for all top level modules to README.md,
applying no content change at this stage to be able to track history
of the files. These files should be edited to use correct Markdown
syntax later.
Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com >
2021-03-24 11:46:14 +01:00
John
b80069e133
tdf#88442 SBasic: Don't double-initialize a Global ... As New ...
...
"As New" variables use lazy instantiation, but that should not re-apply each
time one re-enters the module. If the object is still there, don't replace it.
Change-Id: Ic568a56b93db9bc9139d434d97a4a4deb05840df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112018
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-21 21:54:11 +01:00
arpit1912
54b3ada2e5
tdf#141050 Accept CCur with negative strings
...
the ImpStringToCurrency now increment the pointer on finding a '+' or '-' in sbxcurr.cxx file
Change-Id: I4a1093ae0b4e52b6a61dc412bd5e7b95b1309e7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112734
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de >
2021-03-20 11:57:48 +01:00
Andreas Heinisch
ac0b6fb384
tdf#141045 - fixed copy paste error in the replace function
...
Change-Id: Id68670fed89e4cc700c5eea395139914bebdb657
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112509
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de >
2021-03-15 15:16:57 +01:00
Noel Grandin
c880d3e304
check for quit when calling Yield in loop
...
so we don't get stuck threads when the main application
quits
Change-Id: Id36e99267ceb4154873b6ef8ef494622fff6c19a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112409
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com >
2021-03-14 08:20:53 +01:00
Mike Kaganski
fbaf865ffc
Drop "32" from names of SbxArray methods taking 32-bit indices
...
... a leftover from times when there were methods for 16-bit
as well as for 32-bit indices. 16-bit indices were removed in
commit 62f3f3d92a .
Change-Id: Idf8b1160e68e8b303cf75ea79dd7dbb3bd00275d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112187
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-09 13:22:18 +01:00
Mike Kaganski
083900f88c
Make sal/config.h the first in pch
...
By convention, it should be the first include in C/CXX files;
so use of pch should not break that.
Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-09 06:51:51 +01:00
ViKrAm-Bais
394ad7fa73
tdf#42982: improve UNO API error reporting
...
Change-Id: I20080d81e0b08e6e0dcd421bd75cb7d796e97ea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112149
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de >
2021-03-08 11:08:06 +01:00
Arnaud Versini
08cb09c092
BASIC : use standard mutex from std.
...
Change-Id: Ie9abb32124b8718bbfde076f090180794c64f90e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108629
Tested-by: Mike Kaganski <mike.kaganski@collabora.com >
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2021-03-07 13:37:19 +01:00
Noel
568b4e8d7a
loplugin:refcounting in basic
...
Change-Id: Idbee5b35215f794e6785925dafb6f160caa24a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111541
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-02-26 09:59:21 +01:00
Noel
1571fd8bfd
loplugin:refcounting in basic
...
Change-Id: I0c1e41436ddae176695a90c120303727aa3bc2ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111306
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-02-22 17:32:28 +01:00
shubham656
30ca77c43b
tdf#130677 Write new tests for literals
...
Change-Id: I22607fdcaab840ca1512abf534712d36d4b5ee9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109964
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de >
Tested-by: Jenkins
2021-02-17 15:34:22 +01:00
vipbuoy
1775cd844b
tdf#42982 updated RunTimeException with 2nd argument(pointer)
...
Change-Id: I52dd9b9808e5fd61d07d4f8a6642124230ede23f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110971
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de >
2021-02-17 13:24:30 +01:00
Noel
7874cba970
loplugin:referencecasting in basctl..binaryurp
...
Change-Id: I3fbc287cf76e453e2c464837d2431ff19501fde3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110968
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-02-16 08:57:02 +01:00
Caolán McNamara
c950dedc9b
update pches
...
Change-Id: Icf55ddda055d11b649e7607c2cdd8b6d6ddfefbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110483
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-02-08 12:11:17 +01:00
Stephan Bergmann
0ce7c84cc7
Revert "Fix typo in code"
...
This reverts commit 3ed9bba283 . osl_Pos_Absolut
(include/osl/file.h) is part of the stable URE interface; it must not be changed.
Change-Id: I1f49923a9351e4be5aee39b10720d38b424feb9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110435
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
2021-02-05 15:01:48 +01:00
Andrea Gelmini
3ed9bba283
Fix typo in code
...
Change-Id: Ib8b306a27d25a34e784aeeb72708b0d5d1511f3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110394
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net >
2021-02-04 22:56:54 +01:00
Arnaud Versini
f6a38df16c
basic : remove useless class pre declaration
...
Change-Id: Iba78fb4d28651b298ed6ec5e53b30b2afebb28a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110203
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-02-01 07:27:41 +01:00
Noel
1250aecd71
loplugin:stringviewparam extend to new..
...
O[U]StringBuffer methods
Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-29 09:25:12 +01:00
Noel
9430608363
simplify code, use more subView()
...
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-28 17:32:18 +01:00
Noel
c83166ce71
loplugin:passstuffbyref
...
Change-Id: I330e0ab6c9955939dad313f9d472f93e39dbd313
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109924
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-26 08:30:42 +01:00
Andreas Heinisch
0426748927
tdf#136755, tdf#124008 - delete the variable beforehand REDIM
...
If an array of objects is passed as an argument to ReDim, delete the
variable beforehand, otherwise the construction of the new variable
fails, because the old one is still on the stack.
Change-Id: Ic863a36f5f2aca658df369f95d275aa287edf795
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106832
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de >
2021-01-25 07:57:59 +01:00
Noel
bca1b74c07
improve some IllegalArgumentException messages
...
Change-Id: Id88f2a82bf2651e8b5895aa330f32b71ff5b0e48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109546
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-20 09:03:45 +01:00
Caolán McNamara
117ecc9870
fix coverity parse errors
...
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-01-10 21:01:05 +01:00
Noel Grandin
8f453c674f
static_cast after dynamic_cast
...
Change-Id: I3792ddadad9582a7e6f4740829c081d9571ddaff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109049
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-10 14:59:31 +01:00
Caolán McNamara
ac396f2f6b
fix coverity parse errors
...
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com >
2021-01-09 13:01:49 +01:00
Stephan Bergmann
c34e8bd713
loplugin:stringviewparam: operator +=
...
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
2021-01-04 15:29:54 +01:00
Arnaud Versini
60ac2acd4c
BASIC : simplify SbxVariable constructors and remove impl class
...
Change-Id: Iff37e71389594b313a3a3d12998dbbdbf0c85d05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108539
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2021-01-02 15:29:53 +01:00
Mike Kaganski
97c3280afb
Fix build after 042033f1e6
...
Change-Id: Ifca32f434442f7838aae6f47dc2831dfa6a3f5db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108496
Tested-by: Stephan Bergmann <sbergman@redhat.com >
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
2020-12-30 14:55:44 +01:00
Tomaž Vajngerl
3482f59030
vcl: remove {Read,Write}ImpGraphic and ImplExportNative from Graphic
...
ReadImpGraphic and WriteImpGraphic have been reimplemented in the
TypeSerializer some time ago, but the code has not yet been moved
to use that class. This commits does that and changes all the code
using those 2 methods and removes them. With this implemented in
the TypeSerializer, it is easier to handle
In addition it also removes ImplExportNative (and the method on
the Graphic interface). This was really used only in one method,
and it could be implemented in the mthod itself.
Change-Id: I0982429d1c1d5ed7ef07627d87ed9a08df43f040
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108256
Tested-by: Tomaž Vajngerl <quikee@gmail.com >
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com >
2020-12-30 08:25:11 +01:00
Stephan Bergmann
042033f1e6
loplugin:stringviewparam: operator +
...
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
2020-12-29 16:42:33 +01:00
Arnaud Versini
71af8fc010
BASIC : simplify SbiSymDef and SbiSymPool initlialization
...
Change-Id: I5e7a34330592855aae3ec57d4b90edfa376fbacf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108370
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2020-12-28 07:27:43 +01:00
Arnaud Versini
4be5308c05
BASIC : SbiRuntime static data should be const
...
Change-Id: If8c221a2bfb249a6625df4b466fe5247b7a8ae72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108355
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2020-12-27 07:52:20 +01:00
Arnaud Versini
a5c1a64555
BASIC : simplify SbiExpression initialization
...
Change-Id: I3a1cca2f6ea3b6d3fef2e10e2ae4d0674cfe205a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108324
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2020-12-26 19:23:00 +01:00
Arnaud Versini
61749b473d
BASIC : remove useless using namespace
...
Change-Id: Ic491f69e7bb098a03f9cdbd8913c4b4be4a570b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108326
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org >
2020-12-26 15:24:19 +01:00
Stephan Bergmann
a3d0091d18
New loplugin:stringliteralvar
...
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.
(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)
Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
2020-12-26 14:51:15 +01:00
Mike Kaganski
f7de7de118
Initialize method mapping table at compile time
...
This removes the need to calculate hashes for the table at runtime.
Also this introduces a static assertion to make sure that the table
has correct structure, and fixes some methods that had wrong argument
counts:
CreateUnoListener: 1 -> 2
MIRR: 2 -> 3
SLN: 2 -> 3
SYD: 2 -> 4
Changes in basic/source/classes/sb.cxx are related to the change of
SbxVariable::MakeHashCode into constexpr function taking string view.
Change-Id: I2fec4994e976f36c4b647c30b51a9e879a815775
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108220
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2020-12-23 15:42:46 +01:00
Mike Kaganski
8f0a57d076
Drop RTLNAME obfuscating macro
...
which only purpose is to make "git grep SbRtl_Foo" a kind of IQ test.
Change-Id: I47cfc2ecd1cc4a5ecf2e348465554fa2caeaccf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108218
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2020-12-23 05:31:30 +01:00
Mike Kaganski
66b135fa80
Related: tdf#84098 Unify tests
...
Shorten the tools module name; use TestUtil.AssertEqual where applicable;
remove unnecessary variables that only made noise and masked what was
actually asserted; add missing licence headers.
Change-Id: If891ed8ceb38fed18335aad061b2b09d341264f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108118
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2020-12-22 06:18:50 +01:00
Noel Grandin
803cef388d
fix for Windows x86-64 build
...
...after 46c5de8328 "make *String(string_view)
constructors explicit"
Change-Id: I85138de39d7d7f9fa4ce3c14acf60b770c2f1d4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108059
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2020-12-21 07:29:49 +01:00
Stephan Bergmann
21cd30ddaa
Blind fix for Windows x86-64 build
...
...after 46c5de8328 "make *String(string_view)
constructors explicit"
Change-Id: I6a1d54e8dbcd98027122d33e6b6544ce00b09624
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108052
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
Reviewed-by: Stephan Bergmann <sbergman@redhat.com >
Tested-by: Jenkins
2020-12-20 20:46:28 +01:00
George Bateman
73ba462935
tdf#84098 kill copy+paste in VBA tests
...
Move repeated code into _test_asserts.vb
Change-Id: Idfe124a8dbab4925309fa5f1322e0cce5f097b7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107860
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com >
2020-12-19 23:40:13 +01:00
Noel Grandin
46c5de8328
make *String(string_view) constructors explicit
...
to make it more obvious when we are constructing heap OUStrings
code and potentially inadvertently throwing away performance.
And fix a handful of places so revealed.
Change-Id: I0cf390f78026f8a670aaab53424cd31510633051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk >
2020-12-19 17:53:06 +01:00