summaryrefslogtreecommitdiff
path: root/svl/source/notify
diff options
context:
space:
mode:
authorTobias Lippert <drtl@fastmail.fm>2015-06-09 21:25:40 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-06-29 15:55:12 +0000
commitb014150e64cdc23dfd999061bc210f0ad701f0a2 (patch)
tree78f852588bf002983beda79d81d89e4fce9443bd /svl/source/notify
parente03a5f5e8303668cb68844b6df9ec53a561792bc (diff)
tdf#68016 Write fixture for current behaviour of SfxListener
Also: Make destructor of SfxListener more robust, so that it can be used in tests. Change-Id: I02b273ca8e527705c2d3ea3295ed0dec1c4f83ae Reviewed-on: https://gerrit.libreoffice.org/16483 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'svl/source/notify')
-rw-r--r--svl/source/notify/lstner.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index ee0809cd0db7..4fc3426b8bd4 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -68,7 +68,10 @@ SfxListener::~SfxListener()
void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBroadcaster )
{
- mpImpl->maBCs.erase( std::find( mpImpl->maBCs.begin(), mpImpl->maBCs.end(), &rBroadcaster ) );
+ auto it = std::find( mpImpl->maBCs.begin(), mpImpl->maBCs.end(), &rBroadcaster );
+ if (it != mpImpl->maBCs.end()) {
+ mpImpl->maBCs.erase( it );
+ }
}