271 Commits
Author SHA1 Message Date
Neil Roberts be27055b34 tdf#172532 basprov: Use new concrete interfaces for optional methods
Instead of using XInvocation and XPropertySet to expose the optional
edit method, the BASIC script provider now uses the new concrete
interface XEditableBrowseNode.

Change-Id: I7a99a1c335f408da9b0ac26c741577eb449e63c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207348
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:08:17 +02:00
Noel Grandin a27dcf22cd fix SbxArrayRef leak
found by running

    make CppunitTest_sc_macros_test CPPUNIT_TEST_NAME=testTdf133889

under ASAN with detect_leaks=1

We end up with a cycle here, between the SbxArrayRef and one of its children.
Clear the SbxArray to break the cycle.

Change-Id: Ia996eca6da7d9f39821305514b456b7aba799cf1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2608
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ff5487aaab39aa8b862da1cf0b3f41e8fb1f8d7d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206324
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-10 22:28:40 +02:00
Mike Kaganski d59fed102e Move BasicScriptImpl to use OPropertyContainerImplHelper
Simplifies the implementation, removing boilerplate.

Change-Id: I5ec16fee95fa7180e8551b7eeca3d80b829e044b
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/245
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 834e3df39cf1abe87957f9a589916fb90783ec37)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205664
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 14:33:46 +02:00
Mike Kaganski ca02ecc4f6 Move BasicMethodNodeImpl to use OPropertyContainerImplHelper
Simplifies the implementation, removing boilerplate.

Change-Id: Idf7ca45d428c09ad18c6af2663f18f306a14bad1
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/244
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 122cecfefb8302f43d4dc6fa8911b96c4d18be3c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205663
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-25 14:33:29 +02:00
Noel Grandin 22f46bd89f use more concrete UNO classes
Change-Id: Id10786bbf7985adbb251224b45f9dabcc84d0a3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-03-10 14:18:35 +01:00
Noel Grandin 5c76b36437 loplugin:ostr in scripting
Change-Id: Idde1ec2254cebc9acd8aab092e52632b1625877f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-13 14:43:49 +02:00
Mike Kaganski ea93670372 Drop some uses of css::uno::Sequence::getConstArray ...
where it was obsoleted by commits 2484de6728
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd19 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).

Change-Id: I4ccc647bb794515c8c11f8dfd9a26563f4aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166819
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-04-30 06:20:50 +02:00
Gabor Kelemen 098f366895 tdf#146619 Drop unused 'using namespace' in: scripting/
Change-Id: I84194df451ea990c515ae914741078c80e53e45b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165694
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-04-09 18:53:50 +02:00
Noel Grandin 8e048c3c57 convert BasicScriptImplodNodeImpl to comphelper::WeakImplHelper
and remove OBroadcastHelperHolder, since nothing uses it anymore

Change-Id: Id07b4589e0893950974c6bf41e0d4f2d8dc7ee81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165491
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-29 07:42:23 +01:00
Noel Grandin 6e8fb02d75 convert BasicMethodNodeImpl to comphelper::WeakImplHelper
Change-Id: I568800deabc82185afafc4415efd55bbe762901c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165444
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 19:08:39 +01:00
Mike Kaganski 4541614e5f tdf#159412: make sure to keep the value while changing the type
SbxValue::SetType clears the original value. We need to use the Get/Put
cycle, asking for a specific type in Get, and then making sure that the
variable is not fixed on Put.

Change-Id: I0a6c106d511e8491c89a5a2153f47a708f83ee1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162664
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-29 03:34:21 +01:00
Stephan Bergmann 7c59c59a0b Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: scripting
Change-Id: I74516d08ed48f2c9f4a0d4e105c96f95c127485b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158218
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 18:42:47 +02:00
Noel Grandin 7ffa7e56c0 loplugin: new global analysis locking2
look for methods where we don't need to guard access
to the field, because the field is never modified

Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-19 17:40:47 +02:00
Mike Kaganski 00f6c36b60 Fix/simplify some vnd.sun.star.expand: handling
The vnd.sun.star.expand: payload must be URL-decoded prior to passing
it to expandMacros; the protocol must be checked case-insensitively.
Use startsWithIgnoreAsciiCase for that.

Change-Id: I2be993a0400a27cb7dc57207cd0824b4505afd2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146855
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-13 11:29:34 +00:00
Noel Grandin c7c2f6b37a clang-tidy modernize-pass-by-value in scripting
Change-Id: I95e2a391a984905cac5cbf3f1bb640e1157fafd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136338
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-23 18:24:07 +02:00
Noel Grandin f2c02331a7 new loplugin:unnecessary locking
off by default, since each warning needs careful inspection

Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20 08:03:27 +02:00
Noel Grandin cde416fea1 in SetGlobalUNOConstant, only retrieve old value if we need it
removes some unnecessary Find() work

Change-Id: I6af9c4d9a043d4361fcca1a034b2025fe7c10c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134200
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11 21:55:11 +02:00
Stephan Bergmann 5fc8f8620d Just use Any ctor instead of makeAny in scripting
Change-Id: I611640a6fb7061fbb6a239034f75e006db075989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133786
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 06:55:38 +02:00
Andreas Heinisch 6a0f00d3b9 tdf#146742 - Move the initialization code of a method to SbMethod::Call
Change-Id: I516bacdcd22ed094a0e9b6e125e941f32fe88c82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129238
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-03 09:43:37 +01:00
Mike Kaganski 822998f1dc tdf#143582: Avoid error on clearing leftover return value of a method
SbxValue::Clear happens to not error out on clearing string and some
other types of objects, but for the rest, it calls SbxValue::Put, and
the latter errors out if not CanWrite(). The original test implemented
in commit 24d24debef only checked string
return value, so happened to miss this problem.

See similar code in SbiRuntime::FindElement.

Change-Id: I7c17137cc9e7ee3133ee86a9f701559df66e53b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127248
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-22 16:39:32 +01:00
Noel Grandin 1d83453ce3 use more cppu::BaseMutex
Change-Id: I679e9027f9550fefc0b4ced555f8ffb89bc9491a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127079
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18 19:50:07 +01:00
Mike Kaganski 22ba855d1a Prepare for removal of non-const operator[] from Sequence in scripting
Change-Id: Ia85fe6de38674c7982b0f983a798a4d99ec1fb70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124384
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 22:04:01 +02:00
Mike Kaganski 8a017d25a6 Avoid COW overhead using css::uno::Sequence
The scenarios are:

1. Calling sequence's begin() and end() in pairs to pass to algorithms
   (both calls use getArray(), which does the COW checks)
2. In addition to #1, calling end() again when checking result of find
   algorithms, and/or begin() to calculate result's distance
3. Using non-const sequences in range-based for loops, which internally
   do #1
4. Assigning sequence to another sequence variable, and then modifying
   one of them

In many cases, the sequences could be made const, or treated as const
for the purposes of the algorithms (using std::as_const, std::cbegin,
and std::cend). Where algorithm modifies the sequence, it was changed
to only call getArray() once. For that, css::uno::toNonConstRange was
introduced, which returns a struct (sublclass of std::pair) with two
iterators [begin, end], that are calculated using one call to begin()
and one call to getLength().

To handle #4, css::uno::Sequence::swap was introduced, that swaps the
internal pointer to uno_Sequence. So when a local Sequence variable
should be assigned to another variable, and the latter will be modified
further, it's now possible to use swap instead, so the two sequences
are kept independent.

The modified places were found by temporarily removing non-const end().

Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14 06:00:49 +02:00
Andreas Heinisch 24d24debef tdf#143582 - Clear return value of the method before calling it
Otherwise the function keeps a copy of its return value, which may be
used in an upcoming call.

Change-Id: I4977c39e1ce48cfd5ab067a4df4783f10505a9ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119905
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-08-04 00:17:01 +02:00
Noel Grandin 1597cc5b3e convert #defines to OUStringLiteral
mostly by doing

$ git grep -l '#define.*\"' -- *.cxx
    | xargs perl -pi -e
's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 =
u\2;/g'

Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-02 14:43:58 +02:00
Vincent LE GARREC 24552a0b5b tdf#124176 Use pragma once in s*
sc, scaddins, sccomp, scripting

Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-23 13:39:56 +01:00
Mike Kaganski fbaf865ffc Drop "32" from names of SbxArray methods taking 32-bit indices
... a leftover from times when there were methods for 16-bit
as well as for 32-bit indices. 16-bit indices were removed in
commit 62f3f3d92a.

Change-Id: Idf8b1160e68e8b303cf75ea79dd7dbb3bd00275d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112187
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-09 13:22:18 +01:00
tushar 61d2014254 tdf#133889 Upcasting the type of actual parameter.
Type of actual parameter is made same as formal parameter.This is done to undo the conversions made in sbxToUnoValueImpl.

Change-Id: I8c7a880503d927eb43ad38eac4bf01451442834b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109773
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2021-01-22 19:05:49 +01:00
tushar 3b3591d3c1 tdf#133887 Set flag of variable when formal parameter is not expecting variant.
If there is no param info for formal paramter then type of formal parameter and actual parameter will be same
and there is no need to set the flag in that case.

Change-Id: I12af64f82fc5b2d6d7fb920bde1cb96f8c7bd51b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109070
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-18 12:44:05 +01:00
Gabor Kelemen 107399d684 tdf#42949 Fix new IWYU warnings in directories s*
Except recently checked sc, sd, svx, sw

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: Ice1b86628e4f22a39f307b9c5fa567b6ab9d5acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106917
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-01 14:56:43 +01:00
Noel c967a7f013 loplugin:reducevarscope in scripting
Change-Id: I214f58c9d0bd8e574e8882234c84f595605d2fe7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105331
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-05 14:10:12 +01:00
Andrea Gelmini dd2b321012 Fix typos
Change-Id: Ibe3cd52117f7f47e1806bde76114cb1644d78763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100969
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-08-19 15:37:24 +02:00
Noel Grandin e78b16632f scripting/basprov: create instances with uno constructors
See tdf#74608 for motivation.

Change-Id: Id4a312df7b3ed4c4c81f7f1b42b8e8697d4bb784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98742
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-15 10:10:54 +02:00
Stephan Bergmann 9c6100c26a Upcoming improved loplugin:staticanonymous -> redundantstatic: scripting
Change-Id: Iee244e5b7f3f768d2e58165ae438824a1f1a0d0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97654
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-07-01 23:43:58 +02:00
Gabor Kelemen 2c0906bcee tdf#42949 Fix IWYU warnings in scripting/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I014631ec79242d9a5f735d7401fe0f5e323c69a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95649
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-09 14:55:24 +02:00
Stephan Bergmann 9e07acf3a9 Upcoming loplugin:elidestringvar: scripting
Change-Id: Ib900f42b41bf6a3b8f65132dd4c6eb46fb1e5171
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-05 08:53:18 +02:00
Noel Grandin 32097c33d7 Revert "loplugin:constfields in scripting"
This reverts commit 383a4f883d.

Now that we know that making fields has negative side effects
like disabling assignment operator generation.

Change-Id: I9fc04024b12a977481d010950244cff05e18bd74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90368
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-12 09:22:31 +01:00
Noel Grandin 1376f86f3f sal_Char->char in scaddins..sdext
Change-Id: If2456800ace3696c2582e19a4c8612fee7d77f90
Reviewed-on: https://gerrit.libreoffice.org/85700
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-22 19:27:42 +01:00
Mike Kaganski 62f3f3d92a SbxArray: drop 16-bit indices
Change-Id: I43b478187636b9bb53fdf7ab938436ae364bd7a7
Reviewed-on: https://gerrit.libreoffice.org/84733
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-09 14:18:25 +01:00
Noel Grandin f656547d4d remove some useless comment lines
which merely announce that the next declaration is a class

Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc
Reviewed-on: https://gerrit.libreoffice.org/84229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-03 12:46:27 +01: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
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
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
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
Mike Kaganski cfbd830e9c tdf#120703 PVS: remove redundant static casts
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-12 09:04:54 +01:00
Arkadiy Illarionov b38e690296 Simplify containers iterations in scaddins, sccomp, scripting
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-20 08:15:54 +01:00
Jan-Marek Glogowski c846e85f03 Guard listener cleanup of BasicProviderImpl
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-12 15:37:26 +01:00
Mike Kaganski ba796f2cdd tdf#121143: don't send OnCloseApp twice; properly cleanup AppBasicManager
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-11-05 20:06:58 +01:00
Noel Grandin 76dd28afc9 loplugin:staticvar in various
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-22 12:47:37 +02:00