summaryrefslogtreecommitdiff
path: root/sw/source/uibase/wrtsh/navmgr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/wrtsh/navmgr.cxx')
-rw-r--r--sw/source/uibase/wrtsh/navmgr.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/uibase/wrtsh/navmgr.cxx b/sw/source/uibase/wrtsh/navmgr.cxx
index e2adc872ebbe..021c6be512b3 100644
--- a/sw/source/uibase/wrtsh/navmgr.cxx
+++ b/sw/source/uibase/wrtsh/navmgr.cxx
@@ -62,14 +62,12 @@ void SwNavigationMgr::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
// m_entries if that happens
if (typeid(rHint) == typeid(sw::UnoCursorHint))
{
- for (auto it = m_entries.begin(); it != m_entries.end(); ++it)
+ auto it = std::find_if(m_entries.begin(), m_entries.end(),
+ [&rBC](const sw::UnoCursorPointer& rItem) { return !rItem || &rBC == &rItem.get()->m_aNotifier; });
+ if (it != m_entries.end())
{
- if (!*it || &rBC == &it->get()->m_aNotifier)
- {
- EndListening(rBC);
- m_entries.erase(it);
- break;
- }
+ EndListening(rBC);
+ m_entries.erase(it);
}
}
}