diff options
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 383030b7b726..2a679be30730 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -679,13 +679,15 @@ throw (css::uno::RuntimeException, std::exception) { if (evt.PropertyName == PROPERTY_NAME) { ::osl::MutexGuard aGuard( m_rMutex ); - OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue)); - if (i != m_aMap.end() && i->second == evt.Source) - { - css::uno::Reference<css::uno::XInterface> xCorrectType(i->second); - m_aMap.erase(i); - m_aMap.insert(::std::pair<const OUString, css::uno::Reference<css::uno::XInterface> >(::comphelper::getString(evt.NewValue),xCorrectType)); - } + auto range = m_aMap.equal_range(::comphelper::getString(evt.OldValue)); + for (auto it = range.first; it != range.second; ++it) + if (it->second == evt.Source) + { + css::uno::Reference<css::uno::XInterface> xCorrectType(it->second); + m_aMap.erase(it); + m_aMap.insert(::std::pair<const OUString, css::uno::Reference<css::uno::XInterface> >(::comphelper::getString(evt.NewValue),xCorrectType)); + break; + } } } |