diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-09-07 11:15:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-09-07 13:47:54 +0200 |
commit | 1806691c91b45b3ee5a52efc585930c41c705127 (patch) | |
tree | cfc5b97990400a0ed8c4c7616829abc683f2a7ee /svl | |
parent | 7bc010d624215b3d1830546e5c6f0a24567c54f4 (diff) |
tdf#141123: impossible to replace an event after it has been set
Change-Id: Iabecd5b4cff803e45fede6b25db03d553eb835a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156651
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/macitem.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 4dae21dd4fc9..0b242c7cffa8 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -233,6 +233,10 @@ bool SvxMacroItem::GetPresentation void SvxMacroItem::SetMacro( SvMacroItemId nEvent, const SvxMacro& rMacro ) { + // tdf#141123: emplace doesn't replace the element in the map if already exists + // see https://en.cppreference.com/w/cpp/container/map/emplace + // so first erase the macro if there's one for this event + aMacroTable.Erase(nEvent); aMacroTable.Insert( nEvent, rMacro); } |