diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-09-29 14:09:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-29 17:06:24 +0200 |
commit | 725b51044b955946c6528ca08a8a36dc44f09cd8 (patch) | |
tree | 1613f7e92cfbb4177e8b66532a8036385077f774 /extensions/source | |
parent | 66eedce71f10c30712f34732157e4dcdfcb49090 (diff) |
tdf#127863: fix crash when trying to edit assigned macro to a button
see bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=154638
Let's avoid iterator use here to avoid invalid iterator in debug mode
+ slight formatting
Change-Id: I40b42201ad299aee33275b2c961e1e0233f86ad4
Reviewed-on: https://gerrit.libreoffice.org/79812
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/propctrlr/eventhandler.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 83bbef32496b..3a9a6d147cc5 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -303,7 +303,7 @@ namespace pcr { private: typedef std::unordered_map< OUString, ScriptEventDescriptor > EventMap; - typedef std::map< EventId, EventMap::iterator > EventMapIndexAccess; + typedef std::map< EventId, OUString > EventMapIndexAccess; EventMap m_aEventNameAccess; EventMapIndexAccess m_aEventIndexAccess; @@ -349,7 +349,7 @@ namespace pcr std::pair< EventMap::iterator, bool > insertionResult = m_aEventNameAccess.emplace( _rEventName, _rScriptEvent ); OSL_ENSURE( insertionResult.second, "EventHolder::addEvent: there already was a MacroURL for this event!" ); - m_aEventIndexAccess[ _nId ] = insertionResult.first; + m_aEventIndexAccess[ _nId ] = _rEventName; } ScriptEventDescriptor EventHolder::getNormalizedDescriptorByName( const OUString& _rEventName ) const @@ -409,7 +409,7 @@ namespace pcr // appear in the property browser UI. for (auto const& elem : m_aEventIndexAccess) { - *pReturn = elem.second->first; + *pReturn = elem.second; ++pReturn; } return aReturn; |