summaryrefslogtreecommitdiff
path: root/scripting
AgeCommit message (Collapse)AuthorFilesLines
2019-08-19Improve check for absolute URIStephan Bergmann1-1/+1
Change-Id: I4dee44832107f72f8f3fb68554428dc1e646c346 Reviewed-on: https://gerrit.libreoffice.org/77712 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 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/77571 Tested-by: Jenkins
2019-08-15warn 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 Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b Reviewed-on: https://gerrit.libreoffice.org/77386 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> 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 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/77379
2019-08-06Properly 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/77021 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-06keep name percent-encodedStephan Bergmann1-1/+3
Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b Reviewed-on: https://gerrit.libreoffice.org/77005 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-21tdf#97635 Added unindentation using shift-tab (mimicked eclipse behavior)Andreas Heinisch1-2/+2
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 Heinisch1-5/+8
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 Heinisch1-0/+22
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 Grandin6-10/+10
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 Illarionov4-8/+8
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 McNamara4-7/+7
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 Grandin1-3/+0
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 Grandin1-2/+1
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 Kelemen1-0/+1
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 Kelemen1-0/+1
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 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>
2019-03-27Beanshell: 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>
2019-03-27tdf#123586 Set minimum size for beanshell editorkushagrakasliwal11-0/+2
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 Kelemen1-0/+1
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 Shah5-3/+51
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 Grandin1-1/+0
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-SHREIF1-3/+1
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 Grandin1-10/+0
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 Bergmann1-3/+3
...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 Mehrbrodt2-2/+2
Change-Id: I35ac8f6ad54c7990bd5fb24dc0a30ebb8e1e8254 Reviewed-on: https://gerrit.libreoffice.org/67949 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-02-12tdf#120703 PVS: remove redundant static castsMike Kaganski3-4/+7
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I5fee1c4bebd1972fbb5e43da37149d4e2ff6ce0d Reviewed-on: https://gerrit.libreoffice.org/67664 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-02-11new loplugin writeonlyvarsNoel Grandin1-2/+0
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in sdNoel Grandin1-1/+1
Change-Id: I8ce307b8c467ac1e3f19faca1df15a079bc14169 Reviewed-on: https://gerrit.libreoffice.org/67563 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-28o3tl::make_unique -> std::make_unique in sax...svtools (except sc)Gabor Kelemen1-3/+2
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I6eea0877eaa1886b64c0cce06a43b8088cbccd8e Reviewed-on: https://gerrit.libreoffice.org/66751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-20Restore original behavior of MasterScriptProvider::hasByNameMike Kaganski1-1/+2
Commit f3ce30ec75a4d7116b9cd4d7b21d9aaa0e237eeb changed this to return after first non-throwing XNameContainer::hasByName, regardless if it returned true or false. This changes it back, to iterate over all the providers again. Change-Id: I74fa4d4aa8760cad509442226601ab4842312b80 Reviewed-on: https://gerrit.libreoffice.org/65471 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-20Simplify containers iterations in scaddins, sccomp, scriptingArkadiy Illarionov4-67/+55
Use range-based loop or replace with STL functions Change-Id: I21ec2eea8f322e2792097d352fc352dc6099c7b7 Reviewed-on: https://gerrit.libreoffice.org/65461 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-19use unique_ptr in StringResourceImplNoel Grandin2-26/+20
Change-Id: Id7a44c4ac5643aae96cb707d2cca217f8535ee63 Reviewed-on: https://gerrit.libreoffice.org/65404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-09Fixed typo, deleted whitespaceMatthias Seidel1-34/+35
(cherry picked from commit 31df7841adbd74c9f32cc5cfce86c148d365e01f) Change-Id: I0f7575544f24142cf27edd4002c09b316f679367 Reviewed-on: https://gerrit.libreoffice.org/64850 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-12-07loplugin:singlevalfields extend to all static varsNoel Grandin1-1/+1
Change-Id: Ic238bb5291539fd1b7e98cb4afc9b25f37e7d528 Reviewed-on: https://gerrit.libreoffice.org/64710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek1-1/+1
Change-Id: I651b7f202fa52ff5f5357a11aa72c43eb7dc7f95 Reviewed-on: https://gerrit.libreoffice.org/64102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-29remove unnecessary "if (!empty()" checks before loopsNoel Grandin1-12/+9
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-22improve function-local statics in scripting..svtoolsNoel Grandin1-6/+5
Change-Id: Idf3785a1fbc6fc5b8efbdc4cd363047709f3af91 Reviewed-on: https://gerrit.libreoffice.org/63782 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-12Guard listener cleanup of BasicProviderImplJan-Marek Glogowski1-0/+2
Otherwise JunitTest_sfx2_complex dbgutil asserts especially on Windows with: ucrtbased!get_wide_winmain_command_line+0x296 ucrtbased!get_wide_winmain_command_line+0xe4 ucrtbased!wassert+0x1a vcllo!ImplDbgTestSolarMutex+0x43 tllo!DbgTestSolarMutex+0x11d svllo!SfxBroadcaster::RemoveListener+0x2e svllo!SfxListener::~SfxListener+0x8f basprovlo!basprov::BasicProviderImpl::~BasicProviderImpl+0x8f ... Change-Id: Ia183436a92bc70ed5208364987b3e97e27b5bd6e Reviewed-on: https://gerrit.libreoffice.org/63289 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2018-11-05tdf#121143: don't send OnCloseApp twice; properly cleanup AppBasicManagerMike Kaganski2-1/+21
The OnCloseApp event is being sent twice: first time in SfxTerminateListener_Impl::notifyTermination (in Desktop::terminate), and the second time in Desktop::doShutdown. The second event happens after application's Basic manager already was destroyed in SfxApplication::Deinitialize. The Basic provider, which holds a pointer to the manager, doesn't properly cleanup upon the manager's destruction, thus trying to use it after free. This removes the second (duplicate) generated OnCloseApp event, and makes BasicProviderImpl inherit from SfxListener to allow receiving the manager's SfxHintId::Dying notification. Change-Id: Iabf1432c41b1925b11b5a89e5fd8a6ae8249831e Reviewed-on: https://gerrit.libreoffice.org/62810 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-28tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski1-22/+0
Change-Id: I1e5098e11f1e5e2f7c5518ea05c57512f58b585b Reviewed-on: https://gerrit.libreoffice.org/62464 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24clang-tidy performance-unnecessary-copy-init in sdNoel Grandin1-1/+1
Change-Id: I4a494aebdae9b9cba3794e5eee1f3a29eb3ec838 Reviewed-on: https://gerrit.libreoffice.org/62250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22loplugin:staticvar in variousNoel Grandin2-2/+2
looks for variables that can be declared const and static i.e. they can be stored in the read-only linker segment and shared between different processes Change-Id: I8ddc6e5fa0f6b10d80c75d5952df8ddd311cf892 Reviewed-on: https://gerrit.libreoffice.org/61591 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22pvs-studio: V728 An excessive check can be simplifiedCaolán McNamara1-2/+2
for... "The '(A && !B) || (!A && B)' expression is equivalent to the 'bool(A) != bool(B)' expression" subcases, where the args are already bool Change-Id: Ica8b5c4974c513f7f7ad8acf17ca931e85ebc8af Reviewed-on: https://gerrit.libreoffice.org/62146 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-19keep pyuno script processing below base uriCaolán McNamara1-2/+28
Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7 Reviewed-on: https://gerrit.libreoffice.org/61957 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin2-10/+10
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin1-5/+7
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann1-4/+4
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-09loplugin:constfields in scriptingNoel Grandin9-19/+19
Change-Id: I1484d920649817680f70de4ca00a3d46e1faf42a Reviewed-on: https://gerrit.libreoffice.org/61554 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>