summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-13 12:12:19 +0000
committerMichael Stahl <michael.stahl@cib.de>2020-01-13 19:01:39 +0100
commit352ab705a8b97414ac3fe95419473299811104a7 (patch)
treed86f5d5b0bb65a6821451bd20b0bfe49ad0b7dcd /filter
parent9b318842d5062417640e0541d4799cb5b1598865 (diff)
ofz#20051 if duplicate exists then m_ObjToRecMap points to deleted element
Change-Id: I854410ba1d5c0a622b5ba9c6816a24a3477e5089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86685 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ebe405aefb9d..29fd41a9879c 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5140,8 +5140,13 @@ SvxMSDffImportRec* SvxMSDffImportData::find(const SdrObject* pObj)
void SvxMSDffImportData::insert(std::unique_ptr<SvxMSDffImportRec> pImpRec)
{
- m_ObjToRecMap[pImpRec->pObj] = pImpRec.get();
- m_Records.insert(std::move(pImpRec));
+ auto aRet = m_Records.insert(std::move(pImpRec));
+ bool bSuccess = aRet.second;
+ if (bSuccess)
+ {
+ SvxMSDffImportRec* pRec = aRet.first->get();
+ m_ObjToRecMap[pRec->pObj] = pRec;
+ }
}
void SvxMSDffImportData::NotifyFreeObj(SdrObject* pObj)