diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-05 12:11:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-05-05 14:39:58 +0200 |
commit | 2361718a34ee4ef47901846cb35eea4552bca46b (patch) | |
tree | 37e0e2da41cda45476209209e99c8b734131100c /comphelper | |
parent | b10417eb1e5a4a6959e7fc1cdd9819e5b09d39a4 (diff) |
tdf#155149 Crash when exiting cell edit mode
regression from
commit 2dc240a82646fc23c673a6fd5a29ade934dd5b67
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Tue May 2 14:47:43 2023 +0200
improve AccessibleEventNotifier::addEvent
and
commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Thu May 4 10:06:14 2023 +0200
tdf#105404 [API CHANGE] add index to accessiblity change event
(*) Send better index hints
(*) Error check the index hints better
(*) Convert asserts to warnings and fall back to old code when
index hint is wrong.
Change-Id: I8e752fc26e729c9c8926beb2c7b196f5418a147e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151419
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/accessiblecomponenthelper.cxx | 3 | ||||
-rw-r--r-- | comphelper/source/misc/accessibleeventnotifier.cxx | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/comphelper/source/misc/accessiblecomponenthelper.cxx b/comphelper/source/misc/accessiblecomponenthelper.cxx index 816b3b69ee0c..07d05d31a31d 100644 --- a/comphelper/source/misc/accessiblecomponenthelper.cxx +++ b/comphelper/source/misc/accessiblecomponenthelper.cxx @@ -113,7 +113,7 @@ namespace comphelper void OCommonAccessibleComponent::NotifyAccessibleEvent( const sal_Int16 _nEventId, - const Any& _rOldValue, const Any& _rNewValue ) + const Any& _rOldValue, const Any& _rNewValue, sal_Int32 nIndexHint ) { if ( !m_nClientId ) // if we don't have a client id for the notifier, then we don't have listeners, then @@ -126,6 +126,7 @@ namespace comphelper aEvent.EventId = _nEventId; aEvent.OldValue = _rOldValue; aEvent.NewValue = _rNewValue; + aEvent.IndexHint = nIndexHint; // let the notifier handle this event AccessibleEventNotifier::addEvent( m_nClientId, aEvent ); diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx index d146d11812ba..37c9edda2625 100644 --- a/comphelper/source/misc/accessibleeventnotifier.cxx +++ b/comphelper/source/misc/accessibleeventnotifier.cxx @@ -246,8 +246,21 @@ void AccessibleEventNotifier::addEvent( const TClientId _nClient, const Accessib return; // since we're synchronous, again, we want to notify immediately - aClientPos->second.notifyEach(aGuard, &XAccessibleEventListener::notifyEvent, _rEvent); - + OInterfaceIteratorHelper4 aIt(aGuard, aClientPos->second); + // no need to hold lock here, and we don't want to hold lock while calling listeners + aGuard.unlock(); + while (aIt.hasMoreElements()) + { + try + { + aIt.next()->notifyEvent(_rEvent); + } + catch (Exception&) + { + // no assertion, because a broken access remote bridge or something like this + // can cause this exception + } + } } } // namespace comphelper |