better fix for tdf#103830
the first fix in commit 3a404ea870
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>
This commit is contained in:
@@ -661,13 +661,15 @@ void OInterfaceContainer::propertyChange(const PropertyChangeEvent& evt) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user