summaryrefslogtreecommitdiff
path: root/sw/source/core/access/accmap.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-04-27 19:08:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-04-28 12:33:55 +0200
commit08c09017bfa5c72ba2b9614237fcf0c0f9738037 (patch)
tree4bfeef97512f0805d1b724d366b96511c6c28585 /sw/source/core/access/accmap.cxx
parente8c265d06a9f34fec382d67c65c38189f16ee323 (diff)
fix regression in "tdf#119388 add new UNO listener/broadcaster"
Upon further inspection, I note that part of the the code I added in commit ec940941e0bd7db15c5cf7d43df82226e0d849dc Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Aug 20 17:03:13 2019 +0200 tdf#119388 add new UNO listener/broadcaster would never have been able to be hit. Re-arrange a little to fix that. Change-Id: I537102d768591e5fa0ec2fb4b52b05dad4d26f29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151140 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/access/accmap.cxx')
-rw-r--r--sw/source/core/access/accmap.cxx30
1 files changed, 17 insertions, 13 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 5d21e969311c..b7f00ffea291 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -196,18 +196,32 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
// are no shapes that need to know about them.
if (rHint.GetId() != SfxHintId::ThisIsAnSdrHint)
return;
- const SdrHint *pSdrHint = static_cast<const SdrHint*>( &rHint );
- if (pSdrHint->GetObject() )
- return;
OSL_ENSURE( mpDrawModel, "draw model listener is disposed" );
if( !mpDrawModel )
return;
+ const SdrHint *pSdrHint = static_cast<const SdrHint*>( &rHint );
+
document::EventObject aEvent;
if( !SvxUnoDrawMSFactory::createEvent( mpDrawModel, pSdrHint, aEvent ) )
return;
+
+ // right now, we're only handling the specific event necessary to fix this performance problem
+ if (pSdrHint->GetKind() == SdrHintKind::ObjectChange)
+ {
+ auto pSdrObject = const_cast<SdrObject*>(pSdrHint->GetObject());
+ uno::Reference<drawing::XShape> xShape(pSdrObject->getUnoShape(), uno::UNO_QUERY);
+ std::unique_lock aGuard(maListenerMutex);
+ auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
+ for (auto it = itBegin; it != itEnd; ++it)
+ it->second->notifyShapeEvent(aEvent);
+ }
+
+ if (pSdrHint->GetObject() )
+ return;
+
{
std::unique_lock g(maListenerMutex);
::comphelper::OInterfaceIteratorHelper4 aIter( g, maEventListeners );
@@ -224,16 +238,6 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
}
}
- // right now, we're only handling the specific event necessary to fix this performance problem
- if (pSdrHint->GetKind() == SdrHintKind::ObjectChange)
- {
- auto pSdrObject = const_cast<SdrObject*>(pSdrHint->GetObject());
- uno::Reference<drawing::XShape> xShape(pSdrObject->getUnoShape(), uno::UNO_QUERY);
- std::unique_lock aGuard(maListenerMutex);
- auto [itBegin, itEnd] = maShapeListeners.equal_range(xShape);
- for (auto it = itBegin; it != itEnd; ++it)
- it->second->notifyShapeEvent(aEvent);
- }
}
void SwDrawModellListener_Impl::Dispose()