summaryrefslogtreecommitdiff
path: root/scripting
AgeCommit message (Collapse)AuthorFilesLines
2019-03-05scripting: copy python/InsertText.py to the Scripts directoryAshod Nakashian1-0/+1
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>
2018-10-20keep pyuno script processing below base uriCaolán McNamara1-2/+28
Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7 Reviewed-on: https://gerrit.libreoffice.org/61969 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit b1c85cdb37a47998f8ab135fbc96f186334b171c)
2018-09-12python: add sample python script to insert/replace textAshod Nakashian1-0/+61
Change-Id: Idde3cd22ecc1f1bd34f7519acedc85584ed2deaf Reviewed-on: https://gerrit.libreoffice.org/58160 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-27Restore 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/55873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 9a1d26e3d9c9c02932e083cec9914e399eaf5d9c)
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 (cherry picked from commit 79fa6ac73caeae089d255c6b8629075364b4a477)
2018-04-03Add mode lines and license blurbTor Lillqvist1-0/+11
Change-Id: Ifc319e6954665b71f8a98d6ec849a71bbf2b7318 (cherry picked from commit 850b401ebad13d20481f3ed01990c8070a33f6f1) Reviewed-on: https://gerrit.libreoffice.org/52096 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52319
2018-04-03Add DeleteNamedRange functionTor Lillqvist1-0/+11
Change-Id: I081614cb34aee704c9162f58c78dbaa6a350d30b (cherry picked from commit f21e341d0fbfb39f7d5d976f89f00f844e201576) Reviewed-on: https://gerrit.libreoffice.org/52095 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52318
2018-04-03Add 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> (cherry picked from commit a260eabf5c228567fc64e99ca72d332f7ebaf0d4) Reviewed-on: https://gerrit.libreoffice.org/52094 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52317
2018-04-03Fix 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> (cherry picked from commit 8329f4541e27402d19729ae1588af8bfe61f7b49) Reviewed-on: https://gerrit.libreoffice.org/52093 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52316
2018-04-03Add 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> (cherry picked from commit e32b4c8a079e4b51b1028d2467b872ff5b8cdd3a) Reviewed-on: https://gerrit.libreoffice.org/52092 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52315
2018-04-03Add 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> (cherry picked from commit aa27a25d152ab70f60fedcea3bd4cd99d68103a0) Reviewed-on: https://gerrit.libreoffice.org/52090 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52313
2018-04-03Filter 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> (cherry picked from commit 2147cbf6204ebca8fb5a306ad5d81215b1175ac2) Reviewed-on: https://gerrit.libreoffice.org/52089 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52312
2018-04-03Bin 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> (cherry picked from commit e25b905106598578449d5b2864654d0f58c3147f) Reviewed-on: https://gerrit.libreoffice.org/52088 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52311
2018-04-03Add 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> (cherry picked from commit 7e16966d517f1c25e673ddbb88e72cf418f5aeaa) Reviewed-on: https://gerrit.libreoffice.org/52087 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/52310
2017-12-02mailmerge.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> (cherry picked from commit 55ad93f29b1be106a7b475f92202ece3589584d8) Reviewed-on: https://gerrit.libreoffice.org/45694
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>
2017-07-31loplugin:constparams in extensions,scripting,sdextNoel Grandin5-7/+7
Change-Id: I3d47e144db17358bf6e2e5e3f4ad29de888c01b1 Reviewed-on: https://gerrit.libreoffice.org/40583 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31loplugin:oncevarNoel Grandin4-29/+16
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21de-hrc various thingsCaolán McNamara1-1/+0
e.g. helpid[s].hrc -> helpids.h and insert include guards where missing move "ordinary" defines into .hxx files remove .hrc entries that are used as arguments to dialog factory when a dedicated method can be added instead Change-Id: I792fb8eb0adfaa63cf354e6e57401fc943e9196e
2017-07-21migrate to boost::gettextCaolán McNamara1-14/+12
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-14 use more OUString::operator== in scaddins..sdextNoel Grandin2-8/+5
Change-Id: I8bc5c925f940283bc54698bbcba77efcca883273 Reviewed-on: https://gerrit.libreoffice.org/39937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13loplugin:oncevar: empty strings: scriptingStephan Bergmann1-2/+1
Change-Id: I5f9df200e0b221670c1646dec011c2647804b9e0
2017-07-11simplify some OUString::concat usageNoel Grandin5-29/+14
Change-Id: Ifa150dc9d694981ffe03c254ea8c3fd820c99795 Reviewed-on: https://gerrit.libreoffice.org/39812 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-11use more range-for on uno::SequenceNoel Grandin1-3/+2
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759 Reviewed-on: https://gerrit.libreoffice.org/39763 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-06use more begin()/end() for SequenceNoel Grandin1-4/+2
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
2017-07-05new loplugin unnecessaryparenNoel Grandin1-1/+1
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-04loplugin:casttovoidStephan Bergmann1-3/+1
...cases that were initially missed due to the broken containsProcessingConditionalInclusion() Change-Id: Ib7d801ab5173ee590ef35a9e075d3ce4d4aa06da
2017-07-02loplugin:casttovoid: scriptingStephan Bergmann6-42/+12
Change-Id: I9f77eca5a80ad4e9d3cee8f7400a245f5fa78bbb
2017-06-26loplugin:oncevar in scaddins..sotNoel Grandin3-40/+17
Change-Id: I657a131374b9f1153135e00ed429889518b91427 Reviewed-on: https://gerrit.libreoffice.org/39258 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21s/ERRCODE_SBX_OK/ERRCODE_NONENoel Grandin1-2/+2
adds no value Change-Id: Iedf7a6a7be28fed4059b576312890be8cbb980d7 Reviewed-on: https://gerrit.libreoffice.org/39056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke5-6/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-12cleanup unused css/frame/* includesJochen Nitschke2-1/+1
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-12clang-tidy readability-delete-null-pointerNoel Grandin3-20/+9
which in turn triggered some loplugin:useuniqueptr Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64 Reviewed-on: https://gerrit.libreoffice.org/38281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/resource/ includesJochen Nitschke1-1/+0
Change-Id: I1e2c795cef64799d5e28e5fafec6cd72f621abba Reviewed-on: https://gerrit.libreoffice.org/37853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/uri/ includesJochen Nitschke1-1/+0
Change-Id: I08c7981ecce45e343ff9e98277dd3aea4ed68ab9 Reviewed-on: https://gerrit.libreoffice.org/37860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-20cleanup unused css/script/ includesJochen Nitschke6-6/+2
but keep exception includes in headers for now Change-Id: I826828675a2d14b906e57068cbced2e790e12bce Reviewed-on: https://gerrit.libreoffice.org/37846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-16loplugin:checkunusedparams variousNoel Grandin1-2/+2
Change-Id: I5d1cc807134230d86e0226a12fada204004312d3 Reviewed-on: https://gerrit.libreoffice.org/37675 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-12remove unused uno::Reference varsNoel Grandin1-1/+1
found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07revert OSL_ASSERT changesChris Sherlock1-1/+1
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert scripting module away from OSL_ASSERT to assertChris Sherlock1-1/+1
Change-Id: I6276488e930b60855053747828547e2ed659c060