Commit Graph
2315 Commits
Author SHA1 Message Date
Stephan Bergmann c8eaadb5d7 Remaining loplugin:bufferadd
...that had been missing because the plugin didn't implement postRun, so it
didn't report anything when run as part of the shared plugin.  (But did report
the expected warnings when run as a standalone plugin during
CompilerTest_compilerplugins_clang.)

Most fixes are straightforward.  A noteworthy one is PreparedStatement::setBytes
in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx:  The old
preallocation of a 20 character OStringBuffer might have prevented

  buf.append( reinterpret_cast<char *>(escapedString), len -1 );

from potentially throwing std::bad_alloc, which would have caused escapedString
to be leaked.  Even though that 20-character preallocation was likely just
random junk and not meant to address the potential leak, lets address it now.

Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900
Reviewed-on: https://gerrit.libreoffice.org/80925
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 09:03:53 +02:00
Noel Grandin 3ee177a14d loplugin:stringadd look through a couple more known-good methods
Change-Id: Ifbdb3e41eae665f7dcaf5301aaba2b6e4662cf48
Reviewed-on: https://gerrit.libreoffice.org/80855
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-16 07:57:45 +02:00
Noel Grandin 6eb7870aa1 loplugin:stringadd in sc
Change-Id: Idab16f785ca5e8954f8e50132938f6329106c927
Reviewed-on: https://gerrit.libreoffice.org/79891
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01 08:26:52 +02:00
Andrea Gelmini f4a07458fb Fix typos
Change-Id: I8a93a6ed49661ddfae390a0302fca1fab5c95f14
Reviewed-on: https://gerrit.libreoffice.org/79795
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-29 00:09:20 +02:00
Noel Grandin bdc8fda4be loplugin:constmethod in sc
Change-Id: I78c4fb4acf21756f91582caee5e30e3ad1fc2ae4
Reviewed-on: https://gerrit.libreoffice.org/79543
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26 10:15:00 +02:00
Andrea Gelmini c12c84e6d8 Fixing "...."
Change-Id: I3424e17cfdfb563fdc5882942031deafae8689fe
Reviewed-on: https://gerrit.libreoffice.org/78678
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06 09:13:38 +02:00
Andrea Gelmini bec318a4ac Fix typos
Change-Id: Iac08e415f84741ecdb151788776ee15e7364fae1
Reviewed-on: https://gerrit.libreoffice.org/77762
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-31 14:38:58 +02:00
Noel Grandin 2fd083579d loplugin:returnconstval in various
Change-Id: Ib5d293417b1faeb7ef63a8df99fc1ba644989cdc
Reviewed-on: https://gerrit.libreoffice.org/78079
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 08:18:10 +02:00
Noel Grandin ff6e8c73ad loplugin:constvars in sccomp..sd
Change-Id: Ic4b2a1d23da80a5b0976692f490c29a7169be3ef
Reviewed-on: https://gerrit.libreoffice.org/77793
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20 13:05:02 +02:00
Stephan Bergmann c79efeb66f Improve check for absolute URI
Change-Id: I4dee44832107f72f8f3fb68554428dc1e646c346
Reviewed-on: https://gerrit.libreoffice.org/77706
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-19 12:47:59 +02:00
Julien Nabet c5be21da50 tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
in scaddins, scripting

Change-Id: I92e6380f535aec12c1f1c5c51d8b544c8a7d9611
Reviewed-on: https://gerrit.libreoffice.org/77650
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17 22:16:38 +02:00
Caolán McNamara 9a97a26511 member 'Context' of struct type 'uno.Exception' not given a value
Change-Id: Ie80f729e5c1dbf3214f9532dcb935b239bac7997
Reviewed-on: https://gerrit.libreoffice.org/77566
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-16 13:05:52 +02:00
Caolán McNamara 700c8ec978 AttributeError on getMessage
Change-Id: If0bd315fe605b850ec397eb2267b08ad8039355c
Reviewed-on: https://gerrit.libreoffice.org/77565
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-16 13:04:52 +02:00
Caolán McNamara 3c076e54f7 an absolute uri is invalid input
Change-Id: I392be4282be8ed67e3451b28d2c9f22acd4c87fc
Reviewed-on: https://gerrit.libreoffice.org/77564
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-16 12:20:03 +02:00
Noel Grandin f23f9d38db loplugin:sequenceloop in scaddins..scripting
Change-Id: I25044332e107b630b257e48d95ee9272145ed344
Reviewed-on: https://gerrit.libreoffice.org/77524
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15 20:22:18 +02:00
Caolán McNamara a1140054b4 revert part of 'warn on load when a document binds an event to a macro'
i.e.
commit b3edf85e0f
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Wed Aug 7 17:37:11 2019 +0100

because then extensions that add a entry to menus results in menu
entries that cannot run in the start center where there is no document.

If allowed when there is no document, it would still result in the
odd behaviour that such menu entries would not work in a document which
contained macros or macro-calls if permission was denied to run them

Add a similar check instead to SfxEvents_Impl::Execute

Change-Id: I8084ab2dc66bb95e2562a3dba188c721d44a5676
Reviewed-on: https://gerrit.libreoffice.org/77465
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-14 17:52:29 +02:00
Caolán McNamara b3edf85e0f warn on load when a document binds an event to a macro
a) treat shared/Scripts equivalently to document scripts

This doesn't automatically warn/block running those scripts when used in a
freshly loaded document on its own however

because DocumentMacroMode::checkMacrosOnLoading will see at...

if ( m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() )

that the document contains no macros and flip the allow macros flag to true so
that potentially new uses of macros added by the user during the edit are
allowed to run

b) so, add an additional flag to indicate existence of use of macros in a document

c) for odf import, set it when a script:event-listener tag is encountered
d) for html import when registerScriptEvents or SwFormatINetFormat::SetMacroTable is called
e) for doc import when Read_F_Macro or StoreMacroCmds is called as well for good measure
f) for xls import when registerScriptEvent or ScMacroInfo::SetMacro is called
g) for oox import when VbaProject::attachMacros is called

Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b
Reviewed-on: https://gerrit.libreoffice.org/77131
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-13 13:26:15 +02:00
Caolán McNamara 87959e5dee construct final url from parsed output
Change-Id: Ifd733625a439685ad307603eb2b00bf463eb9ca9
Reviewed-on: https://gerrit.libreoffice.org/77373
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-13 10:10:56 +02:00
Andrea Gelmini 1a75143159 Fix typos
Change-Id: I3e6b96f4ea341130e98ee54ed8c124209b05d343
Reviewed-on: https://gerrit.libreoffice.org/77291
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-12 10:56:06 +02:00
Matthias Seidel b9a7768374 Fixed typo
(cherry picked from commit 1f21ba2f2a1bc287cd869b0a03eac6e8a90eb21f)

Change-Id: I286d0e6b04d6505f0728d6f84d34239be060dc27
Reviewed-on: https://gerrit.libreoffice.org/77268
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-11 17:04:14 +02:00
Stephan Bergmann 418533f0af Related tdf#116767: Call URLClassLoader.close
...which required the return type of
com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader to
be changed.  (In theory, there could be 3rd-party scripting providers that hook
into the framework and are affected by that incompatible change, but,
practically, chances should be low.)

Change-Id: I083c398726aaf62df7286d6da86b9d2056a5a8c1
Reviewed-on: https://gerrit.libreoffice.org/77146
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-08 13:27:52 +02:00
Stephan Bergmann 664eea94a2 Remove unused NoSuitableClassLoaderException
It was introduced with 980aa9b06c "#i19331#" (or
at least moved to its current place there, with older traces lost to history),
but its only actual use in the code has since been removed with
8087d5389f "Java new cannot return null".

(In theory, there could be 3rd-party scripting providers that hook into the
framework and use that class, but, practically, chances should be low.)

Change-Id: I8586fccf120c93391308ede547bbeec6fabf2743
Reviewed-on: https://gerrit.libreoffice.org/77142
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-08 11:06:35 +02:00
Stephan Bergmann c4bb20a479 Remove odd catch of ArrayStoreException
...(which is a RuntimeException) around a call of
com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader.
The catch block was introduced in 3076ea9dc6
"INTEGRATION: CWS scriptingf2 (1.2.2); FILE MERGED", for no apparent reason.  It
was introduced along with catch blocks for MalformedURLException and
NoSuitableClassLoaderException, but which have already been removed with
616b3ad504 "java: remove exceptions from throws
clauses that are not".

Change-Id: I8d2890aed1b0f50fe817002cb6f1610c550568f1
Reviewed-on: https://gerrit.libreoffice.org/77140
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-08 10:21:31 +02:00
Stephan Bergmann a9cde25572 Properly obtain location
Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8
Reviewed-on: https://gerrit.libreoffice.org/77019
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-06 14:21:14 +02:00
Stephan Bergmann c30da2b46b keep name percent-encoded
Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b
Reviewed-on: https://gerrit.libreoffice.org/76892
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-06 12:25:00 +02:00
Stephan Bergmann f5a219c3ac Improved loplugin:stringconstant (now that GCC 7 supports it): scripting
Change-Id: I60519d5f0663ab244468f10cbc79a8fc80771726
Reviewed-on: https://gerrit.libreoffice.org/76651
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31 12:55:24 +02:00
Arkadiy Illarionov 5ba84c3c70 Simplify Sequence iterations in scaddins, sccomp, scripting
Use range-based loops, STL and comphelper functions

Change-Id: I836422a1c81a3dc9585687ed2e506eb59bb4ec91
Reviewed-on: https://gerrit.libreoffice.org/76484
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-07-30 11:16:00 +02:00
Caolán McNamara cb1c937ef6 cid#1448376 SIC: Inner class could be made static
Change-Id: Id9923031c1fe91ba71dfe8d68cbe23b72e9637b5
Reviewed-on: https://gerrit.libreoffice.org/76143
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-23 09:34:53 +02:00
Caolán McNamara 51a596866d cid#1448526 RANGE: Range checks
Change-Id: I3b9d9c648151b2a5b9cc6a015b88a59fa7ec4e53
Reviewed-on: https://gerrit.libreoffice.org/76003
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-20 19:02:59 +02:00
Noel Grandin b1ef3c043d loplugin:referencecasting in scripting
Change-Id: I056ae11c6cda0a1550a8fe363b069359feafcd59
Reviewed-on: https://gerrit.libreoffice.org/75996
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-20 17:59:06 +02:00
Andreas Heinisch 1223bede82 tdf#123587 Beanshell editor: Show current file name as window title
Change-Id: I7a817d19cfadc46b1f35a4e42e5a6177c1910a4b
Reviewed-on: https://gerrit.libreoffice.org/75869
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19 18:30:06 +02:00
Andreas Heinisch 60f7236293 tdf#125355 Beanshell Editor: Corrected indentation when Enter is pressed
Change-Id: Ife96256da02c4b21e2649040c53b7d16f236e3a0
Reviewed-on: https://gerrit.libreoffice.org/73371
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-09 09:51:59 +02:00
Julien Nabet 04fbd174cb cid#1448470: perf inefficient map iterator
Change-Id: If7dd6455ca02d6c78ac997bd9c2924863db1d906
Reviewed-on: https://gerrit.libreoffice.org/75059
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-03 22:54:07 +02:00
Noel Grandin 4583911575 improve loplugin:simplifyconstruct
Change-Id: If863d28c6db470faa0d22273020888d4219e069e
Reviewed-on: https://gerrit.libreoffice.org/74559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25 13:53:21 +02:00
Noel Grandin b2a574ec54 simplify some getSupportedServiceNames
Change-Id: I81195505d6006b6587f7b98c1545919083f0e588
Reviewed-on: https://gerrit.libreoffice.org/74497
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-21 13:43:11 +02:00
Noel Grandin f41a55474c loplugin:logexceptionnicely in scripting..sdext
Change-Id: Ib08f41bb0bed494e7ed00f5bae92eae2b8e80d93
Reviewed-on: https://gerrit.libreoffice.org/74113
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-17 08:18:51 +02:00
Ashod Nakashian 71aef0504b scripting: copy python/InsertText.py to the Scripts directory
Change-Id: I55e367f8fc3bbd2aa65ca9cdef2e97a3dfa3d117
Reviewed-on: https://gerrit.libreoffice.org/68762
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/73486
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-06-12 09:46:46 +02:00
Ashod Nakashian c7c188c745 python: add sample python script to insert/replace text
Change-Id: Idde3cd22ecc1f1bd34f7519acedc85584ed2deaf
Reviewed-on: https://gerrit.libreoffice.org/58160
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/73477
Tested-by: Jenkins
2019-06-05 11:28:37 +02:00
Andreas Heinisch d7f1ca8219 tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)
Restored java 6 compatibility

Change-Id: I550920457874b9261bdde07040aad8f7b67773d8
Reviewed-on: https://gerrit.libreoffice.org/72671
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-21 12:39:43 +02:00
Andreas Heinisch 9ee0a1f166 tdf#97635 Added unindentation using shift-tab (mimicked eclipse's behavior)
Moved shift+tab check to the keyPressed function to provide continuous insertion
and compiled tab-pattern only once

Change-Id: Iffe847fea07295075dc1a280f0697e8c798e8d6f
Reviewed-on: https://gerrit.libreoffice.org/72580
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-20 15:44:41 +02:00
Andreas Heinisch e875a317c4 tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)
Change-Id: Iaf64451c92f3465751032dde9c283141e548b3ca
Reviewed-on: https://gerrit.libreoffice.org/72228
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-16 11:32:06 +02:00
Noel Grandin a361231b13 fix wrong SET/QUERY flags passed to uno::Reference
By creating deleted methods for the wrong calls.

Avoids the compiler needing to construct a temporary

Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a
Reviewed-on: https://gerrit.libreoffice.org/72103
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13 08:15:27 +02:00
Arkadiy Illarionov 038e4b3b1e Use hasElements to check Sequence emptiness in sax..sdext
Similar to clang-tidy readability-container-size-empty

Change-Id: If6a567708d3c59355d54933fad23c85195846624
Reviewed-on: https://gerrit.libreoffice.org/71763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-12 14:18:12 +02:00
Caolán McNamara fbc038cc4f an uno -> a uno
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d
Reviewed-on: https://gerrit.libreoffice.org/72105
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-10 14:50:59 +02:00
Noel Grandin 22f2cf3ccc implement std::hash for css::uno::Reference and rtl::Reference
The declaration in BarChart.cxx is particularly suspicious, because it
was using a < for the KeyEqual template parameter.
Been there since:
    commit b2c3233e5f
    Date:   Thu Dec 21 20:08:33 2017 +0900
    chart2: suspend/resume setting rects dirty for 3D shapes

comphelper::OInterfaceCompare is no longer necessary

Change-Id: I8278c4a3d9113a18570ca237cd05d553ec8f3975
Reviewed-on: https://gerrit.libreoffice.org/71537
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-30 08:43:04 +02:00
Noel Grandin 8b663bc830 loplugin:sequentialassign in sd
Change-Id: I7d592b8929ca46c64a622551b039af0d6a7911db
Reviewed-on: https://gerrit.libreoffice.org/70716
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19 13:19:45 +02:00
Gabor Kelemen 368f20001c tdf#42949 Fix IWYU warnings in comphelper
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Also re-evaluate some blacklisted headers and recheck include/comphelper/

Change-Id: Ib7eea5951e849c07cea2e2782be4e8945f71ad96
Reviewed-on: https://gerrit.libreoffice.org/70899
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-19 11:31:19 +02:00
Gabor Kelemen 80152c8c5e tdf#42949 Fix IWYU warnings in include/sfx2/[sS]*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I4a3baffa8944b522b16b50975185759081662020
Reviewed-on: https://gerrit.libreoffice.org/69945
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-01 10:39:44 +02:00
Samuel Mehrbrodt 3d54a104ae Beanshell: Display full exception message
Useful to see where exactly the error occured

Change-Id: I716f54c4b1286d705b52f19a58f36f28a801e1d0
Reviewed-on: https://gerrit.libreoffice.org/69799
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-27 12:45:19 +01:00
Samuel Mehrbrodt 3c72945de8 Beanshell: Wrap long error messages
Change-Id: I5e607f4b94733700810d37c289f6cc29492da5f2
Reviewed-on: https://gerrit.libreoffice.org/69798
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-27 12:37:17 +01:00