summaryrefslogtreecommitdiff
path: root/scripting
AgeCommit message (Collapse)Author
2019-08-20loplugin:constvars in sccomp..sdNoel Grandin
Change-Id: Ic4b2a1d23da80a5b0976692f490c29a7169be3ef Reviewed-on: https://gerrit.libreoffice.org/77793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-19Improve check for absolute URIStephan Bergmann
Change-Id: I4dee44832107f72f8f3fb68554428dc1e646c346 Reviewed-on: https://gerrit.libreoffice.org/77706 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-17tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorJulien Nabet
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-16member 'Context' of struct type 'uno.Exception' not given a valueCaolán McNamara
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-16AttributeError on getMessageCaolán McNamara
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-16an absolute uri is invalid inputCaolán McNamara
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-15loplugin:sequenceloop in scaddins..scriptingNoel Grandin
Change-Id: I25044332e107b630b257e48d95ee9272145ed344 Reviewed-on: https://gerrit.libreoffice.org/77524 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-14revert part of 'warn on load when a document binds an event to a macro'Caolán McNamara
i.e. commit b3edf85e0fe6ca03dc26e1bf531be82193bc9627 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-13warn on load when a document binds an event to a macroCaolán McNamara
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-13construct final url from parsed outputCaolán McNamara
Change-Id: Ifd733625a439685ad307603eb2b00bf463eb9ca9 Reviewed-on: https://gerrit.libreoffice.org/77373 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-12Fix typosAndrea Gelmini
Change-Id: I3e6b96f4ea341130e98ee54ed8c124209b05d343 Reviewed-on: https://gerrit.libreoffice.org/77291 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-11Fixed typoMatthias Seidel
(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-08Related tdf#116767: Call URLClassLoader.closeStephan Bergmann
...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-08Remove unused NoSuitableClassLoaderExceptionStephan Bergmann
It was introduced with 980aa9b06ca521363ae4175f349becd4cdd501aa "#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 8087d5389f8d1133f119a9e6db88f91229831b61 "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-08Remove odd catch of ArrayStoreExceptionStephan Bergmann
...(which is a RuntimeException) around a call of com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader. The catch block was introduced in 3076ea9dc6677dcf0f65c53c8f205d870dc27d53 "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 616b3ad50404f35d84708b3feeb8c66f2f23f1b1 "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-06Properly obtain locationStephan Bergmann
Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8 Reviewed-on: https://gerrit.libreoffice.org/77019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-06keep name percent-encodedStephan Bergmann
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-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): scriptingStephan Bergmann
Change-Id: I60519d5f0663ab244468f10cbc79a8fc80771726 Reviewed-on: https://gerrit.libreoffice.org/76651 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-30Simplify Sequence iterations in scaddins, sccomp, scriptingArkadiy Illarionov
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-23cid#1448376 SIC: Inner class could be made staticCaolán McNamara
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-20cid#1448526 RANGE: Range checksCaolán McNamara
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-20loplugin:referencecasting in scriptingNoel Grandin
Change-Id: I056ae11c6cda0a1550a8fe363b069359feafcd59 Reviewed-on: https://gerrit.libreoffice.org/75996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19tdf#123587 Beanshell editor: Show current file name as window titleAndreas Heinisch
Change-Id: I7a817d19cfadc46b1f35a4e42e5a6177c1910a4b Reviewed-on: https://gerrit.libreoffice.org/75869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-09tdf#125355 Beanshell Editor: Corrected indentation when Enter is pressedAndreas Heinisch
Change-Id: Ife96256da02c4b21e2649040c53b7d16f236e3a0 Reviewed-on: https://gerrit.libreoffice.org/73371 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-03cid#1448470: perf inefficient map iteratorJulien Nabet
Change-Id: If7dd6455ca02d6c78ac997bd9c2924863db1d906 Reviewed-on: https://gerrit.libreoffice.org/75059 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-21simplify some getSupportedServiceNamesNoel Grandin
Change-Id: I81195505d6006b6587f7b98c1545919083f0e588 Reviewed-on: https://gerrit.libreoffice.org/74497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-17loplugin:logexceptionnicely in scripting..sdextNoel Grandin
Change-Id: Ib08f41bb0bed494e7ed00f5bae92eae2b8e80d93 Reviewed-on: https://gerrit.libreoffice.org/74113 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-12scripting: copy python/InsertText.py to the Scripts directoryAshod Nakashian
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-05python: add sample python script to insert/replace textAshod Nakashian
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-05-21tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)Andreas Heinisch
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-20tdf#97635 Added unindentation using shift-tab (mimicked eclipse's behavior)Andreas Heinisch
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-16tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)Andreas Heinisch
Change-Id: Iaf64451c92f3465751032dde9c283141e548b3ca Reviewed-on: https://gerrit.libreoffice.org/72228 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin
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-12Use hasElements to check Sequence emptiness in sax..sdextArkadiy Illarionov
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-10an uno -> a unoCaolán McNamara
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-04-30implement std::hash for css::uno::Reference and rtl::ReferenceNoel Grandin
The declaration in BarChart.cxx is particularly suspicious, because it was using a < for the KeyEqual template parameter. Been there since: commit b2c3233e5f267b5d244d722a94424a3b224b3314 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-19loplugin:sequentialassign in sdNoel Grandin
Change-Id: I7d592b8929ca46c64a622551b039af0d6a7911db Reviewed-on: https://gerrit.libreoffice.org/70716 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19tdf#42949 Fix IWYU warnings in comphelperGabor Kelemen
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-01tdf#42949 Fix IWYU warnings in include/sfx2/[sS]*Gabor Kelemen
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-03-27Beanshell: Display full exception messageSamuel Mehrbrodt
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-27Beanshell: Wrap long error messagesSamuel Mehrbrodt
Change-Id: I5e607f4b94733700810d37c289f6cc29492da5f2 Reviewed-on: https://gerrit.libreoffice.org/69798 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-27tdf#123586 Set minimum size for beanshell editorkushagrakasliwal1
Change-Id: I49e2ca387de5d520efdda0c964203c530fe016c4 Reviewed-on: https://gerrit.libreoffice.org/69394 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-03-25tdf#42949 Fix IWYU warnings in include/sfx2/[a-D]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444cb71bc3d045072a4b1f9eed279ed7e425a0d4 Reviewed-on: https://gerrit.libreoffice.org/69481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-13tdf#123588 Beanshell editor to indicate whether script is savedSainal Shah
Beanshell to enable save button only upon modification of script. Save button disables after script is successfully saved. Also, save button will be disabled when there are no undoable changes. ScriptEditorForBeanShell registers listener for unsaved changes. PlainSourceView triggers listener calls upon modification of script or after a successful save, which lets to enable/ disable the save button accordingly. Change-Id: I32a2fc473924a7c85cdd6004637ab6a0b60acf38 Reviewed-on: https://gerrit.libreoffice.org/69046 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-24tdf#123589 Removing close button from toolbar in Beanshell editorEL-SHREIF
The Beanshell Editor has a "Close" button in the toolbar.This button can be removed as the window already has a close button.so i remove it from ScriptEditorForBeanShell.java easly . Change-Id: Icf2e56f664df56a01a2cf1935700ebe1888a7156 Reviewed-on: https://gerrit.libreoffice.org/68273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-23loplugin:unusedfields in scNoel Grandin
Change-Id: I5e9842970821d0ae61e06e3ad35c9f571b43632c Reviewed-on: https://gerrit.libreoffice.org/68224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-19More loplugin:simplifyboolStephan Bergmann
...found with GCC 9, where the standard library iterator implementations are apparently sufficiently different to older versions of GCC to find more cases of !(... == ...) vs. ... != ... Change-Id: Ibe7c5140049a69d2c5318b4b2371f2e66bd05028 Reviewed-on: https://gerrit.libreoffice.org/68012 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-18Fix product nameSamuel Mehrbrodt
Change-Id: I35ac8f6ad54c7990bd5fb24dc0a30ebb8e1e8254 Reviewed-on: https://gerrit.libreoffice.org/67949 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>