summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-11-10 17:59:11 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-11-12 01:39:55 +0100
commite168e20b519885789cfafbb7d4726d5c79bd2aac (patch)
tree9dd67652d24d0e5f241fee0f5f6479569e20a90e
parent906377ef12bcf75da871b0c3dab1decaf5b20b32 (diff)
tdf#158169 take no actions in disposed incarnation
Using the described steps in the bug report it is possible to have an already disposed incarnation of ChildrenManagerImpl that gets called with notifyEvent. If exposed it is necessary not to execute actions, but to inform the caller by triggering a lang::DisposedException(). The SfxBaseModel::notifyEvent that executes this will then remove the instance from it's list. Change-Id: Ie39e37d6e55ea66f441e732b612774b18d7c3ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159306 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 23e9a4cf1eec75cdd40a695ecae2af9b952178d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159242 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 2926087060d3..93fe45a21b32 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -679,6 +679,11 @@ void SAL_CALL
ChildrenManagerImpl::notifyEvent (
const document::EventObject& rEventObject)
{
+ // tdf#158169 if we are already disposed, execute no actions, but inform the
+ // caller that we are disposed
+ if ( m_bDisposed )
+ throw lang::DisposedException();
+
if (rEventObject.EventName == "ShapeInserted")
AddShape (Reference<drawing::XShape>(rEventObject.Source, uno::UNO_QUERY));
else if (rEventObject.EventName == "ShapeRemoved")