summaryrefslogtreecommitdiff
path: root/scripting
AgeCommit message (Collapse)AuthorFilesLines
2019-12-15Beanshell: Display full exception messageSamuel Mehrbrodt1-1/+1
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> (cherry picked from commit 3d54a104ae97a3218bf58eb38f28c03e26ba7e43) Reviewed-on: https://gerrit.libreoffice.org/85034 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-12-15Beanshell: Wrap long error messagesSamuel Mehrbrodt1-2/+14
Change-Id: I5e607f4b94733700810d37c289f6cc29492da5f2 Reviewed-on: https://gerrit.libreoffice.org/69798 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 3c72945de874aceb12a405c03f5b0c8b3937f5cf) Reviewed-on: https://gerrit.libreoffice.org/85033 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-11-20warn on load when a document binds an event to a macroCaolán McNamara1-4/+2
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 Reviewed-on: https://gerrit.libreoffice.org/77387 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 35fe064a67b54b0680b4845477c9b8751edda160) Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b
2019-08-27Improve check for absolute URIStephan Bergmann1-1/+1
Change-Id: I4dee44832107f72f8f3fb68554428dc1e646c346 Reviewed-on: https://gerrit.libreoffice.org/77706 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit c79efeb66f7951305d0334bc288aee1c571a8728) Reviewed-on: https://gerrit.libreoffice.org/77724 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 52f7aa318722bd17c77ee5c4fa8307936e7b53af)
2019-08-27an absolute uri is invalid inputCaolán McNamara1-0/+5
Change-Id: I392be4282be8ed67e3451b28d2c9f22acd4c87fc Reviewed-on: https://gerrit.libreoffice.org/77564 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 3c076e54f736980e208f5c27ecf179aa90aea103) Reviewed-on: https://gerrit.libreoffice.org/77572 Tested-by: Jenkins (cherry picked from commit 5445f7ffd09e891b220dabb19cd013bcf591fc08)
2019-08-13construct final url from parsed outputCaolán McNamara1-2/+10
Change-Id: Ifd733625a439685ad307603eb2b00bf463eb9ca9 Reviewed-on: https://gerrit.libreoffice.org/77373 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 87959e5deea6d33cd35dbb3b8423056f9566710e) Reviewed-on: https://gerrit.libreoffice.org/77377 (cherry picked from commit c03acb9b8a97254cfcf7c45ef920b93b7f1dd344)
2019-08-07Properly obtain locationStephan Bergmann1-2/+7
Change-Id: I9fb0d883a3623394343cd54ef61e5610544198c8 Reviewed-on: https://gerrit.libreoffice.org/77019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit a9cde2557242a0c343d99533f3ee032599c66f42) Reviewed-on: https://gerrit.libreoffice.org/77023 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 28c6af3ddc283ca9c5712359a9abcb385c1575b4)
2019-08-07keep name percent-encodedStephan Bergmann1-1/+3
Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b Reviewed-on: https://gerrit.libreoffice.org/77006 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 315c51731384230194af26b86a976bf5d06c9dcc)
2018-10-21keep pyuno script processing below base uriCaolán McNamara1-2/+28
Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7 Reviewed-on: https://gerrit.libreoffice.org/61968 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-06-15Restore binary compatibility for ClassLoaderFactoryStephan Bergmann4-9/+6
As discussed in the mail thread starting at <http://mail-archives.apache.org/ mod_mbox/openoffice-dev/201806.mbox/%3c651c8fee-b467-421c-eae1-a8710f41692c @apache.org%3e> "Just a little side note on the scripting framework ...", external code that uses the Java class com.sun.star.script.framework.provider.ClassLoaderFactory stopped working because LO changed that class in binary (and compile-time) incompatible ways over time. The class is not listed at <https://api.libreoffice.org/docs/java/ref/index.html> (and neither at <http://www.openoffice.org/api/docs/java/ref/overview-summary.html>), so it was not considered part of the stable URE interface. But it is apparently used by external code, and it indeed seems to make sense that it is used by external code that implements scripting providers. (A follow-up commit should therefore mark the class as part of the stable URE interface. I keep that separate so that it is easier to backport this functional fix.) With ScriptProviderForooRexx.oxt from https://svn.code.sf.net/p/bsf4oorexx/code@r589 installed in LO, "Tools - Macros - Organize Macros - ooRexx... - My Macros - Create... - Library1 - OK - Create... - Macro1 - OK - Edit" failed due to > warn:cui.dialogs:21768:21768:cui/source/dialogs/scriptdlg.cxx:740: Caught exception trying to invoke N3com3sun4star3uno9ExceptionE msg: [jni_uno bridge error] UNO calling Java method invoke: non-UNO exception occurred: java.lang.NoSuchMethodError: com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader(Lcom/sun/star/script/framework/container/ScriptMetaData;)Ljava/lang/ClassLoader; > java stack trace: > java.lang.NoSuchMethodError: com.sun.star.script.framework.provider.ClassLoaderFactory.getURLClassLoader(Lcom/sun/star/script/framework/container/ScriptMetaData;)Ljava/lang/ClassLoader; > at com.sun.star.script.framework.provider.oorexx.ScriptEditorForooRexx.edit(ScriptEditorForooRexx.java:305) > at com.sun.star.script.framework.browse.ScriptBrowseNode.invoke(ScriptBrowseNode.java:200) cae57d2e588a4b5a104171e022b00abcc1605775 "ClassLoader->URLClassLoader" (which this commit reverts) had changed the return type of the two getURLClassLoader overloads from ClassLoader to derived URLClassLoader (and ultimately only for cosmetic effect; it was leftover from a previous attempt at fixing a Coverity issue by using URLClassLoader.close(), but which is only available in Java 1.7, so the attempt had been reverted). That caused the above failure. And 68cd011c907d00493bf2bfde531c1e244819596b "java: reduce scope, make some methods private" (which this commit also reverts) had changed the second getURLClassLoader overload (which is not called in the above scenario) from public to private, which is also a binary-incompatible change. Other commits removed throws clauses, which is only a compile-time issue but not a binary-incompatible change. I left those changes in for now, but if need be they could also be reverted. Change-Id: I98f533d88c7c1580956c3c281e72a1c78fa3f56f Reviewed-on: https://gerrit.libreoffice.org/55872 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2018-05-09Use the . separator between sheet name and cell range instead of ! to match UITor Lillqvist1-1/+1
Also put a dollar in front of the sheet name. Change-Id: I93d610dad8ad085718b0fe389e460b588939e5d2
2018-05-05Fix typosAndrea Gelmini1-2/+2
Change-Id: Id7d66c06e18dbccd5c85ba36143bdb6cee7a5197 Reviewed-on: https://gerrit.libreoffice.org/53564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-05-04Removed executable permission on data filesAndrea Gelmini1-0/+0
chmod -x for .patch, .pptm, and .vb Change-Id: I98e1221e48df22e8b58aaf305898cbe301f187ce Reviewed-on: https://gerrit.libreoffice.org/52568 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-04-27tdf#117202 more pythonic and allow spaces as argumentLaurent Godard1-11/+13
space argument must be encapsulated in double-quotes that will be stripped Change-Id: I0387cc7f3fcb4cc48c5a94afcd481306bb4644e2 Reviewed-on: https://gerrit.libreoffice.org/53453 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-04-25tdf#117202 - parse function name to get argumentsLaurent Godard1-4/+30
they are then aggregated to the other and passed to the function Change-Id: I158a747de9c22d50716fc066074a593b4928d6bf Reviewed-on: https://gerrit.libreoffice.org/53424 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-04-25pyprov is not deprecatedLaurent Godard1-4/+4
Change-Id: I6e7af6e6178f3820a73bae6008d8046161a0d8a5 Reviewed-on: https://gerrit.libreoffice.org/53425 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-04-15use the standard name pattern for a packageDavid Tardon1-3/+3
Change-Id: I28f468b84ba0848c6af9bcc3c27971fae1e89fa7
2018-04-15remove some unused comphelper includesJochen Nitschke1-2/+0
and fix the fallout Change-Id: I5d0c2040f57a3ac354a7e277592da31d09a5f359 Reviewed-on: https://gerrit.libreoffice.org/52894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-04-03pass area param to DBG_UNHANDLED_EXCEPTIONNoel Grandin4-10/+10
and update sallogareas plugin to enforce this Change-Id: Id0782c8a1f619372e10d931aec3c6a4743a4c86a Reviewed-on: https://gerrit.libreoffice.org/52249 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-02use https links for api.libreoffice.org and opengrokdennisroczek2-6/+6
Change-Id: I74dd0142562cb8698f19b2715fa1d514f82bd749 Reviewed-on: https://gerrit.libreoffice.org/52262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2018-03-28Add mode lines and license blurbTor Lillqvist1-0/+11
Change-Id: Ifc319e6954665b71f8a98d6ec849a71bbf2b7318
2018-03-28Add DeleteNamedRange functionTor Lillqvist1-0/+11
Change-Id: I081614cb34aee704c9162f58c78dbaa6a350d30b
2018-03-28Add NamedRanges.py to the relevant MakefileTor Lillqvist1-0/+1
Change-Id: Ic2d36182795b2d27aec8fed8665d8bb9f8f12a0f Reviewed-on: https://gerrit.libreoffice.org/51975 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-28Fix class name in debug messageTor Lillqvist1-1/+1
Change-Id: I171e74a34273ddf969e49260fec487dd8cf2fb12 Reviewed-on: https://gerrit.libreoffice.org/51981 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-28Add another sample Python script, to handle named ranges in spreadsheetsTor Lillqvist1-0/+37
Change-Id: Ibe11ab2c3513a05b9aec574602b24df70270908c Reviewed-on: https://gerrit.libreoffice.org/51968 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-27Add another sample Python scriptTor Lillqvist2-0/+16
Change-Id: I542a8b36a097d8961dc76fdcc3d25a3d7b6eb526 Reviewed-on: https://gerrit.libreoffice.org/51966 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-27Filter out "SynchronMode" tooTor Lillqvist1-4/+6
Change-Id: I2c5111ee34929b9740796f5e1f08b3a8a58218e4 Reviewed-on: https://gerrit.libreoffice.org/51964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-27Bin some dead codeTor Lillqvist1-5/+0
We defined the same function member in the class PythonScriptProvider twice. The first one was some accidental leftover surely. Change-Id: I10eebab7084af790a9263176f01f7817fa5124ff Reviewed-on: https://gerrit.libreoffice.org/51965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-03-27Add a separator between two words in an exception messageTor Lillqvist1-1/+1
Change-Id: I5c2e01249058e03edfcf036036f9595b87f0a070 Reviewed-on: https://gerrit.libreoffice.org/51963 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-02-22weld native message dialogsCaolán McNamara1-2/+5
just the straight-forward MessageDialog cases first a) remove border_width from message dialog .ui so as to take the default border width b) retain 12 as default message dialog border for vcl widget case c) remove layour_style from message dialog button boxes so as to take the default mode (a no-op for vcl widget case) d) use gtk response ids (vcl builder will converts to vcl ones) Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154 Reviewed-on: https://gerrit.libreoffice.org/50143 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-30tdf#63388: use SMTP_SSL for port 465Justin Luth1-2/+5
Thanks to Jurassic Pork and prrychr (tdf#99363) for the 2016 patch. I used smtp.gmail.com as my testing server. Port 587 is the "official" port to use for encrypted email. I confirmed that 587 CANNOT use SMTP_SSL [SSL: UNKNOWN_PROTOCOL], so I limited SMTP_SSL use to common TLS port 465 only. Port 465 was temporarily recommended, but OFFICIALLY has long since been abandoned. However, LOTS of documentation and ISPs still recommend it as the port to use. I confirmed that 465 DOES NOT support STARTTLS, so it is specifically excluded. So, technically the button should say use STARTTLS instead of SSL, but only for SMTP. IMAP/POP do use SSL, so terminology gets rather confusing. This patch forces SSL without STARTTLS for port 465 regardless of the "use SSL" setting due to all the confusion. Currently we don't support ANY SSL/TLS connections. With this patch we now at least support the extremely common use case of port 465. Change-Id: I210cc307491157c1121cfffd70cbb94347ee2856 Reviewed-on: https://gerrit.libreoffice.org/48210 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-01-27Fix typosAndrea Gelmini1-1/+1
Change-Id: I8d5a8251a01af7cdf9832d98d8a6573b907f8532 Reviewed-on: https://gerrit.libreoffice.org/48683 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-01-24scripting: add missing vim modelines to python filesMiklos Vajna4-0/+8
Change-Id: Iedc3a8ab37deeb7a686fa709afb0cf350f815ec6 Reviewed-on: https://gerrit.libreoffice.org/48418 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-12More loplugin:cstylecast: scriptingStephan Bergmann1-3/+3
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I52e58aa38c600faf677e932cb3caad07547ccbb7
2018-01-10tdf#96099 Removed some trivial typedefs related to UnOrderedMap and size_t.ekuiitr1-8/+5
Change-Id: I59d3d0b2c1097b5ca96505dc99a4a104b4f8ab48 Reviewed-on: https://gerrit.libreoffice.org/47082 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-02loplugin:passstuffbyref improved return in sd,variousNoel Grandin2-2/+2
Change-Id: I4b6ea89ae2072f4389a696ea3c96d8f7a5731e7a Reviewed-on: https://gerrit.libreoffice.org/47246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11loplugin:salcall fix functionsNoel Grandin10-31/+31
since cdecl is the default calling convention on Windows for such functions, the annotation is redundant. Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d Reviewed-on: https://gerrit.libreoffice.org/46164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-05loplugin:salcall fix non-virtual methodsNoel Grandin2-3/+3
first, since those are safer to change than virtual methods Change-Id: Ie3b624019d75ee2b793cee33b3c5f64e994e8bfe Reviewed-on: https://gerrit.libreoffice.org/45798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-30mailmerge.py: Use strip in server nameXisco Fauli1-2/+2
Using spaces in the dialog might lead to incorrect server name Change-Id: I29a1ffa867d2e415338accf98bb45c7d65b14fa2 Reviewed-on: https://gerrit.libreoffice.org/44052 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-06loplugin:constparams in various(2)Noel Grandin2-2/+2
Change-Id: I533a7eb724b15e168a28dc92cd5962a39bc96e7c Reviewed-on: https://gerrit.libreoffice.org/44313 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: scriptingStephan Bergmann6-14/+14
Change-Id: I5b1280426667636703c996af8ee08ffeeffeb7e1
2017-10-23overload std::hash for OUString and OStringNoel Grandin6-16/+8
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin4-7/+6
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-27loplugin:flatten in variousNoel Grandin1-33/+31
Change-Id: I42dca691ffadbddad38a7e8f978b1da9d5d9a7b0 Reviewed-on: https://gerrit.libreoffice.org/42842 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-22loplugin:flatten in scaddins..sdNoel Grandin3-96/+83
Change-Id: I190323ce910224f883c4370b2c752644a5a35edd Reviewed-on: https://gerrit.libreoffice.org/42626 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-31inline some use-once typedefsNoel Grandin1-4/+1
and remove some dead ones Change-Id: I6946d717d3c15dc5207489ed3d56d985dd953d59 Reviewed-on: https://gerrit.libreoffice.org/41746 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-16tdf#39468 Translate German comments/termsJens Carl1-1/+1
Change-Id: I3c8d8ba10de007429b1cdf26f5e8b207f7cc5eea Reviewed-on: https://gerrit.libreoffice.org/41201 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin1-1/+1
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-02remove unnecessary use of 'this->'Noel Grandin1-1/+1
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4 Reviewed-on: https://gerrit.libreoffice.org/40671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>