From 90b42251633db498505bc8906aefe5d08edbb5c6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 28 Aug 2017 17:09:06 +0200 Subject: 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: Change-Id: Ia0dd140b7c2ca948ace3fbf93d8c4abd4331399d --- svx/source/svdraw/svdobj.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(&rListener)); + rListener.StartListening(*pPlusData->pBroadcast, pEdge != nullptr); } void SdrObject::RemoveListener(SfxListener& rListener) -- cgit