summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-24 11:24:46 +0200
committerAndras Timar <andras.timar@collabora.com>2017-02-27 11:25:00 +0100
commitae9a093683fc5176a0b6dfd848bcd2901a45b601 (patch)
treef17cea5234acecd183f7eaf6bf2e95405384dcef
parent3196278cb0dba5d6cee22ffac86d00c6e96949c0 (diff)
better fix for tdf#103830
the first fix in commit 3a404ea870f1eed86f9765447ce0a364d39ae8f8 did not take into account that this a multimap, not a map. Thanks to Aron Budea for spotting that. Change-Id: I86d2d2a9d6cb08fd3cee3965a5b787d5691f0352 Reviewed-on: https://gerrit.libreoffice.org/34604 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e146741ec96292ef092c6eebfd7fe18fa5ca3cc0) Reviewed-on: https://gerrit.libreoffice.org/34606 (cherry picked from commit 46885644fe87a6e9f86a79b7fd1eafbe3ea0e5a6) Reviewed-on: https://gerrit.libreoffice.org/34611 (cherry picked from commit 1f3ce5a00b2a85374204f3f05433d3cfd3292fe7)
-rw-r--r--forms/source/misc/InterfaceContainer.cxx16
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;
+ }
}
}