Commit graph

2461 commits

Author SHA1 Message Date
Andrea Gelmini
f597c88103 Fix typo
Change-Id: Ia19534f38ed01a44262b47ad04e98dde6948669b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167601
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2024-05-16 02:00:23 +02:00
Noel Grandin
5c76b36437 loplugin:ostr in scripting
Change-Id: Idde1ec2254cebc9acd8aab092e52632b1625877f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-13 14:43:49 +02:00
Mike Kaganski
ccdb98c0e5 Drop some uses of css::uno::Sequence::getConstArray
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I64683093afc48ddf2307dc1dee2302cf0b3cbecc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167110
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-05-12 05:04:57 +02:00
Caolán McNamara
e6981b99ac WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: Ic2c2e227a50994298377485e9e807cd9142cc386
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166949
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-01 10:50:11 +02:00
Mike Kaganski
ea93670372 Drop some uses of css::uno::Sequence::getConstArray ...
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I4ccc647bb794515c8c11f8dfd9a26563f4aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166819
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-04-30 06:20:50 +02:00
Gabor Kelemen
098f366895 tdf#146619 Drop unused 'using namespace' in: scripting/
Change-Id: I84194df451ea990c515ae914741078c80e53e45b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165694
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-09 18:53:50 +02:00
Caolán McNamara
c6d8778bfa cid#1596251 Dereference null return value
and

cid#1596249 Dereference null return value

Change-Id: I2d50e8be5ec20001527c20ccd46a9a0336792d8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165871
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-07 17:10:21 +02:00
Stephan Bergmann
58c4457a90 Update to latest Rhino 1.7.14
...at the expense of losing, at least for now, the script editor for it (which
had been hacked into the old upstream sources in a hard-to-maintain way).

rhino-1.7.14.zip is taken from
<https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.zip>.
Building it would now use Gradle, but instead just hack together an invocation
of javac and jar in external/rhino/ExternalProject_rhino.mk that effectively
generates the same jar as the upstream-built jar available at
<https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.jar>.

All the various patches are no longer necessary:
* external/rhino/rhino1_5R5.patch and external/rhino/OfficeScriptInfo.java were
  mostly for the hacked-in script editor, which has been abandoned at least for
  now (see above).
* external/rhino/rhino1_5R5-find_swing.patch (originally from
  0a7f934650 "ause109: #i106296# make build.xml
  aware of TARFILE_LOCATION") appears to be obsolete.
* external/rhino/rhino1_5R5-updateToolTip.patch is covered by
  <ab20a73b16>
  "Fix bug 414869: Rhino debugger fails to launch due to updates in mac os x
  leopard".
* external/rhino/rhino-classpath.patch.1 from
  bb58293296 "rhino: unbreak build on Fedora 34"
  was only relevant when building with Ant.

Change-Id: I5fca5915d785716f7aaf313ff2469a20f55f707a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165190
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-02 18:56:13 +02:00
Noel Grandin
8e048c3c57 convert BasicScriptImplodNodeImpl to comphelper::WeakImplHelper
and remove OBroadcastHelperHolder, since nothing uses it anymore

Change-Id: Id07b4589e0893950974c6bf41e0d4f2d8dc7ee81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165491
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-29 07:42:23 +01:00
Noel Grandin
6e8fb02d75 convert BasicMethodNodeImpl to comphelper::WeakImplHelper
Change-Id: I568800deabc82185afafc4415efd55bbe762901c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165444
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 19:08:39 +01:00
Noel Grandin
02b5bf515d convert EventListener to comphelper::WeakComponentImplHelper
Change-Id: I3c83fabae8e2fc6a32fe92a596ed93ebc00140fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165443
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 17:44:07 +01:00
LeSasse
845dbe3884 tdf#158803 remove unused imports
Change-Id: If5b9a627d807f8bd6310ca1cc9753f331f012345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165385
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 08:46:39 +01:00
LeSasse
9f4e04b258 tdf#158803 remove unused imports
Change-Id: Id3e4434294386e0ca2a0971cf7e30aeface7b665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165384
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 08:46:23 +01:00
Mike Kaganski
4541614e5f tdf#159412: make sure to keep the value while changing the type
SbxValue::SetType clears the original value. We need to use the Get/Put
cycle, asking for a specific type in Get, and then making sure that the
variable is not fixed on Put.

Change-Id: I0a6c106d511e8491c89a5a2153f47a708f83ee1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-29 03:34:21 +01:00
Caolán McNamara
f1dc4e0d2a cid#1546414 COPY_INSTEAD_OF_MOVE
and

cid#1546408 COPY_INSTEAD_OF_MOVE
cid#1546367 COPY_INSTEAD_OF_MOVE
cid#1546283 COPY_INSTEAD_OF_MOVE
cid#1546268 COPY_INSTEAD_OF_MOVE

Change-Id: I8b6067f70bc0e8cce7117bb3f366227add279887
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12 14:52:08 +01:00
Caolán McNamara
e8248b5e4b cid#1545222 COPY_INSTEAD_OF_MOVE
and

cid#1545241 COPY_INSTEAD_OF_MOVE
cid#1545303 COPY_INSTEAD_OF_MOVE
cid#1545315 COPY_INSTEAD_OF_MOVE
cid#1545319 COPY_INSTEAD_OF_MOVE
cid#1545322 COPY_INSTEAD_OF_MOVE

Change-Id: I284ba6e395f72abd7939667a8367ac99ab64194d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160955
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-19 09:42:03 +01:00
Caolán McNamara
5d3d7cd656 cid#1546281 COPY_INSTEAD_OF_MOVE
and

cid#1546278 COPY_INSTEAD_OF_MOVE
cid#1546276 COPY_INSTEAD_OF_MOVE
cid#1546247 COPY_INSTEAD_OF_MOVE
cid#1546244 COPY_INSTEAD_OF_MOVE
cid#1546243 COPY_INSTEAD_OF_MOVE
cid#1546220 COPY_INSTEAD_OF_MOVE
cid#1546209 COPY_INSTEAD_OF_MOVE
cid#1546207 COPY_INSTEAD_OF_MOVE
cid#1546206 COPY_INSTEAD_OF_MOVE
cid#1546205 COPY_INSTEAD_OF_MOVE
cid#1546197 COPY_INSTEAD_OF_MOVE
cid#1546180 COPY_INSTEAD_OF_MOVE
cid#1546172 COPY_INSTEAD_OF_MOVE
cid#1546165 COPY_INSTEAD_OF_MOVE
cid#1546164 COPY_INSTEAD_OF_MOVE
cid#1546158 COPY_INSTEAD_OF_MOVE
cid#1546151 COPY_INSTEAD_OF_MOVE
cid#1546135 COPY_INSTEAD_OF_MOVE
cid#1546132 COPY_INSTEAD_OF_MOVE
cid#1546129 COPY_INSTEAD_OF_MOVE
cid#1546128 COPY_INSTEAD_OF_MOVE
cid#1546122 COPY_INSTEAD_OF_MOVE
cid#1546117 COPY_INSTEAD_OF_MOVE
cid#1546113 COPY_INSTEAD_OF_MOVE
cid#1546106 COPY_INSTEAD_OF_MOVE
cid#1546099 COPY_INSTEAD_OF_MOVE
cid#1546091 COPY_INSTEAD_OF_MOVE
cid#1546085 COPY_INSTEAD_OF_MOVE
cid#1546069 COPY_INSTEAD_OF_MOVE
cid#1546063 COPY_INSTEAD_OF_MOVE
cid#1546062 COPY_INSTEAD_OF_MOVE
cid#1546058 COPY_INSTEAD_OF_MOVE
cid#1546056 COPY_INSTEAD_OF_MOVE
cid#1546051 COPY_INSTEAD_OF_MOVE
cid#1546040 COPY_INSTEAD_OF_MOVE
cid#1546030 COPY_INSTEAD_OF_MOVE
cid#1546028 COPY_INSTEAD_OF_MOVE
cid#1546015 COPY_INSTEAD_OF_MOVE
cid#1546001 COPY_INSTEAD_OF_MOVE

Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10 11:57:12 +01:00
Caolán McNamara
d516400618 cid#1546422 COPY_INSTEAD_OF_MOVE
and

cid#1546416 COPY_INSTEAD_OF_MOVE
cid#1546415 COPY_INSTEAD_OF_MOVE
cid#1546391 COPY_INSTEAD_OF_MOVE
cid#1546390 COPY_INSTEAD_OF_MOVE
cid#1546317 COPY_INSTEAD_OF_MOVE
cid#1546252 COPY_INSTEAD_OF_MOVE
cid#1546251 COPY_INSTEAD_OF_MOVE
cid#1546249 COPY_INSTEAD_OF_MOVE
cid#1546243 COPY_INSTEAD_OF_MOVE
cid#1546195 COPY_INSTEAD_OF_MOVE
cid#1546193 COPY_INSTEAD_OF_MOVE
cid#1546137 COPY_INSTEAD_OF_MOVE
cid#1545738 COPY_INSTEAD_OF_MOVE
cid#1545782 COPY_INSTEAD_OF_MOVE

Change-Id: I10d5091aa72b682371764b8a18cc5062e272c031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160285
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-04 10:48:59 +01:00
Michael Stahl
8e46dd9599 scripting: PyMailServiceProvider: implement AllowInsecureProtocols
The "ehlo" calls look redundant, smtplib will do these implicitly if
required (checked in Python 3.5.9); it will also check that the STARTTLS
is successful which very old versions of Python didn't do.

Change-Id: Ice8b24bc2c9773c1171e856f1aefb191b1e2e947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159078
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-09 16:55:18 +01:00
Noel Grandin
cb982f1479 'new Float' is deprecated in Java
replace with Float.valueOf

Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-02 12:00:24 +01:00
Stephan Bergmann
7c59c59a0b Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: scripting
Change-Id: I74516d08ed48f2c9f4a0d4e105c96f95c127485b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158218
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 18:42:47 +02:00
Noel Grandin
3c7a35dd28 no need to use UNO_QUERY_THROW here
Change-Id: I01b4e401fec1792829fc2efaad5a74a035a418f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156476
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-02 22:49:12 +02:00
Noel Grandin
87db52ab1e Revert "use more Reference::query instead of UNO_QUERY_THROW"
This reverts commit 7fc6063914.

sberg noticed that there is a difference now:

there's a subtle difference now, in that if  y  was null originally, it would have thrown a (caught) exception, whereas now it will crash in the  y.query<X>()  call.

Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-25 14:15:56 +02:00
Noel Grandin
7ffa7e56c0 loplugin: new global analysis locking2
look for methods where we don't need to guard access
to the field, because the field is never modified

Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-19 17:40:47 +02:00
Noel Grandin
7fc6063914 use more Reference::query instead of UNO_QUERY_THROW
since querying with exceptions is consideably more expensive

Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-18 11:03:02 +02:00
Thorsten Behrens
d7b8dc9f3f Log SSL default verification path for mailmerge debug
related: follow python recommendation and pass SSL contexts

Change-Id: I992535a7fbe0bd21ff1de8241715babc0cb5cdc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155050
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-30 21:59:19 +02:00
Caolán McNamara
e3d28846c2 follow python recommendation and pass SSL contexts
i.e. https://docs.python.org/3/library/ssl.html#security-considerations

Change-Id: I67a0f9e1c25abc6644412b014f30933a7e681da2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155016
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-29 02:30:34 +02:00
Mike Kaganski
d74c010192 Use getXWeak in scripting
Change-Id: I4370c0bfaa75b150bd05f03a5961e7152ac41e7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150864
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-30 20:35:05 +02:00
Stephan Bergmann
4b3308a8c2 Avoid NullPointerException
...when dispose is called without a preceding call to initialize (as would
happen with an improved CppunitTest_services)

Change-Id: Ic632d736ecb27509b092ef526cf0dfc964023663
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150576
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-18 16:31:04 +02:00
Noel Grandin
e7dbef922a rtl::Static to thread-safe-static
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-23 19:49:25 +00:00
Damjan Jovanovic
d015989279 Fix some errors in the scripting module's XInputStreamImpl:
- Check the loop termination in readBytes() properly: currently it increments
totalBytesRead while also decrementing nBytesToRead, so when compared to
each other, the loop terminates when the buffer is half full. Only check
for nBytesToRead instead.
- Deal with the possibility of available() returning 0 in readSomeBytes().

Patch by: me

Cherry-picked from
7e29bacc90
"Fix some errors in the scripting module's XInputStreamImpl:"

Change-Id: I951dc10565afa3519b0ddf98de559a7b585b1627
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149156
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2023-03-20 14:43:13 +00:00
Mike Kaganski
00f6c36b60 Fix/simplify some vnd.sun.star.expand: handling
The vnd.sun.star.expand: payload must be URL-decoded prior to passing
it to expandMacros; the protocol must be checked case-insensitively.
Use startsWithIgnoreAsciiCase for that.

Change-Id: I2be993a0400a27cb7dc57207cd0824b4505afd2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146855
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-13 11:29:34 +00:00
Mike Kaganski
12896c9ed6 tdf#153571: properly unquote (URL-decode) vnd.sun.star.expand payload
Similar to what is done in bootstrap_expandUri, expandUnoRcUrl,
UrlReference::expand, JavaLoader.expand_url, and is documented
in XVndSunStarExpandUrl interface.

Change-Id: I65349b52734f212e6a04e615d39fa2563f62d472
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146840
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-12 23:55:08 +00:00
Caolán McNamara
1726c27e0d check SfxObjectShell::Current()
SfxObjectShell::Current() can return null, it's based on the equally
vile SfxViewFrame::Current()

Change-Id: Ia5c7783680e9d8e5d3075078f16a2c15cb6f7a47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144339
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-12-16 21:17:15 +00:00
Noel Grandin
c91ec113a2 loplugin:unusedfields
Change-Id: I4a7276ffc36b4f954fe1fa39fb5666fa184e66e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143016
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-22 05:39:20 +01:00
Noel Grandin
8cbc179ace use more TempFileFastService in scripting
Change-Id: Ic04abad55e655fa0e0434bd09f797c6f1b2cc245
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141649
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-22 09:11:21 +02:00
Noel Grandin
425255567e use more string_view
Change-Id: Ie826234aa9064b08b8f0647738b57c47ac0ed91a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141369
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-17 10:39:11 +02:00
Rafael Lima
84e9a00569 tdf#151076 Create callable Python script using InsertText
As reported by the user, if you go to Tools - Macro - Run Macro and select the InsertText macro (under Application Macros), you'll get an error.

The reason for this is that the InsertText macro is not meant to be called from the Macro Selector since it requires 1 positional argument.

Therefore, this patch creates a simple callable Python macro that uses the InsertText funcion, so that this error message no longer happens.

Change-Id: I63f766795bda2d2ae1b95a7c0d8110f41f9fbea2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140384
Tested-by: Jenkins
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2022-10-07 15:13:27 +02:00
Stephan Bergmann
91ba9654ba Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxx
...so that its TOOLS_WARN_EXCEPTION can be used in
comphelper/source/misc/logging.cxx in a follow-up commit.  (And while at it,
rename from diangose_ex.h to the more appropriate diagnose_ex.hxx.  The
comphelper module is sufficiently low-level for this immediate use case, so use
that at least for now; o3tl might be even more suitable but doesn't have a
Library until now.  Also, for the immediate use case it would have sufficed to
only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION,
TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of
include/tools/diagnose_ex.h into an additional new
include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move
the complete include file as is.)

Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18 17:10:19 +02:00
Noel Grandin
c7c2f6b37a clang-tidy modernize-pass-by-value in scripting
Change-Id: I95e2a391a984905cac5cbf3f1bb640e1157fafd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-23 18:24:07 +02:00
Mert Tumer
d952df361a LanguageTool Grammar Checker implementation
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I275cbea668afc5beb5147370119631df8b6a2d46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135178
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2022-06-10 13:52:17 +02:00
Noel Grandin
f71606c920 new loplugin:moveit
look for local variables that can be std::move'd to parameters

off by default, since it doesn't do proper data flow analysis

Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-10 13:13:15 +02:00
Stephan Bergmann
2a263cbdaf tdf#145527 Revert "Related tdf#116767: Call URLClassLoader.close"
This reverts commit 418533f0af.  Turned out that
closing the given URLClassLoader once the script's main class has been loaded
prevents the script from loading further classes located next to that main
class.  So abandon the Coverity suggestion that such class loaders should be
closed promptly to avoid resource leaks.

Change-Id: I1bcf83117836cfe317eac9850d413f2c3767bd8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135158
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-31 14:51:57 +02:00
Noel Grandin
f2c02331a7 new loplugin:unnecessary locking
off by default, since each warning needs careful inspection

Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20 08:03:27 +02:00
Noel Grandin
d03e7a8fba speed up simple use of NamedValueCollection
where instantiating and allocating a whole map just to extract a single
key is way inefficient

Change-Id: I55248bc71a9e8826cab9b76fa6916bfa888efa0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134226
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-12 18:03:46 +02:00
Noel Grandin
cde416fea1 in SetGlobalUNOConstant, only retrieve old value if we need it
removes some unnecessary Find() work

Change-Id: I6af9c4d9a043d4361fcca1a034b2025fe7c10c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134200
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11 21:55:11 +02:00
Stephan Bergmann
5fc8f8620d Just use Any ctor instead of makeAny in scripting
Change-Id: I611640a6fb7061fbb6a239034f75e006db075989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133786
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 06:55:38 +02:00
Noel Grandin
d3849255b7 use more string_view in INetURLObject
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29 08:53:22 +02:00
Noel Grandin
33bd16b344 loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr()

Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-17 10:27:33 +02:00
Noel Grandin
c898611bd5 loplugin:stringviewparam convert methods using compareTo
which converts to compare

Change-Id: If03c790ea113a7caedbe89f926b29055c9ec1e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02 16:55:36 +02:00