34 : maBCs( rOther.maBCs )
36 for (
size_t n = 0;
n <
maBCs.size(); ++
n )
38 maBCs[
n]->AddListener(*
this);
62 auto it = std::find(
maBCs.begin(),
maBCs.end(), &rBroadcaster );
63 if (it !=
maBCs.end()) {
81 bool bListeningAlready =
IsListening( rBroadcaster );
87 SAL_WARN(
"svl",
"previous StartListening call came from: " << sal::backtrace_to_string(f->second.get()));
90 assert(!(bListeningAlready && eDuplicateHanding ==
DuplicateHandling::Unexpected) &&
"duplicate listener, try building with DBG_UTIL to find the other insert site.");
95 maBCs.push_back( &rBroadcaster );
97 maCallStacks.emplace( &rBroadcaster, sal::backtrace_get(10) );
99 assert(
IsListening(rBroadcaster) &&
"StartListening failed");
107 auto beginIt =
maBCs.begin();
110 auto it = std::find( beginIt,
maBCs.end(), &rBroadcaster );
111 if ( it ==
maBCs.end() )
116 beginIt =
maBCs.erase( it );
121 while ( bRemoveAllDuplicates );
129 std::vector<SfxBroadcaster*> aBroadcasters;
130 std::swap(
maBCs, aBroadcasters);
132 pBC->RemoveListener(*
this);
141 return maBCs.end() != std::find(
maBCs.begin(),
maBCs.end(), &rBroadcaster );
void RemoveListener(SfxListener &rListener)
void AddListener(SfxListener &rListener)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
Registers a specific SfxBroadcaster.
SfxBroadcaster * GetBroadcasterJOE(sal_uInt16 nNo) const
virtual ~SfxListener() COVERITY_NOEXCEPT_FALSE
std::vector< SfxBroadcaster * > maBCs
void RemoveBroadcaster_Impl(SfxBroadcaster &rBC)
bool IsListening(SfxBroadcaster &rBroadcaster) const
sal_uInt16 GetBroadcasterCount() const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
std::map< SfxBroadcaster *, std::unique_ptr< sal::BacktraceState > > maCallStacks
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
#define SAL_WARN(area, stream)