From 7faa218231b7a807412feada3aa1223b43b5626e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 15 Feb 2018 14:10:30 +0000 Subject: ofz#6311 still problems with SdrEdgeObj listening to same obj at start as end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibd80b484788779b73943b28a5f36e51ebcacec30 Reviewed-on: https://gerrit.libreoffice.org/49821 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svl/source/notify/lstner.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'svl/source/notify') diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx index 9c79da9e5185..5be1e2bdffdf 100644 --- a/svl/source/notify/lstner.cxx +++ b/svl/source/notify/lstner.cxx @@ -88,20 +88,20 @@ void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBroadcaster ) Some code uses duplicates as a kind of ref-counting thing i.e. they add and remove listeners on different code paths, and they only really stop listening when the last EndListening() is called. */ -void SfxListener::StartListening( SfxBroadcaster& rBroadcaster, bool bPreventDuplicates ) +void SfxListener::StartListening(SfxBroadcaster& rBroadcaster, DuplicateHandling eDuplicateHanding) { bool bListeningAlready = IsListening( rBroadcaster ); #ifdef DBG_UTIL - if (bListeningAlready && !bPreventDuplicates) + if (bListeningAlready && eDuplicateHanding == DuplicateHandling::Unexpected) { auto f = mpImpl->maCallStacks.find( &rBroadcaster ); SAL_WARN("svl", "previous StartListening call came from: " << sal::backtrace_to_string(f->second.get())); } #endif - assert(!(bListeningAlready && !bPreventDuplicates) && "duplicate listener, try building with DBG_UTIL to find the other insert site."); + assert(!(bListeningAlready && eDuplicateHanding == DuplicateHandling::Unexpected) && "duplicate listener, try building with DBG_UTIL to find the other insert site."); - if ( !bListeningAlready || !bPreventDuplicates ) + if (!bListeningAlready || eDuplicateHanding != DuplicateHandling::Prevent) { rBroadcaster.AddListener(*this); mpImpl->maBCs.push_back( &rBroadcaster ); -- cgit