summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-28 17:09:06 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-28 17:30:11 +0200
commit90b42251633db498505bc8906aefe5d08edbb5c6 (patch)
tree5f1e23c603e924c7c66d1e134e6a4e5b8a4ed942
parentofz#3160 Direct-leak (diff)
downloadcore-90b42251633db498505bc8906aefe5d08edbb5c6.tar.gz
core-90b42251633db498505bc8906aefe5d08edbb5c6.zip
svx: fix assert in SdrEdgeObj::ConnectToNode()
When loading ooo68143-1.sxw we get an assert: Assertion `!(bListeningAlready && !bPreventDuplicates) && "duplicate listener, try building with DBG_UTIL to find the other insert site."' The connector is connected to the same SdrObject on both ends: <draw:connector ... draw:start-shape="id13" draw:start-glue-point="2" draw:end-shape="id13" draw:end-glue-point="2"> Change-Id: Ia0dd140b7c2ca948ace3fbf93d8c4abd4331399d
-rw-r--r--svx/source/svdraw/svdobj.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 947f70a29f4e..e1257be84517 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -585,7 +585,11 @@ void SdrObject::AddListener(SfxListener& rListener)
{
ImpForcePlusData();
if (pPlusData->pBroadcast==nullptr) pPlusData->pBroadcast=new SfxBroadcaster;
- rListener.StartListening(*pPlusData->pBroadcast);
+
+ // SdrEdgeObj may be connected to same SdrObject on both ends so allow it
+ // to listen twice
+ SdrEdgeObj const*const pEdge(dynamic_cast<SdrEdgeObj const*>(&rListener));
+ rListener.StartListening(*pPlusData->pBroadcast, pEdge != nullptr);
}
void SdrObject::RemoveListener(SfxListener& rListener)