[Libreoffice-commits] core.git: filter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 13 13:23:04 UTC 2020


 filter/source/msfilter/msdffimp.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit bfb7fef85f63b82b54832c755e111b90f701e8dc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 13 12:12:19 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jan 13 14:22:34 2020 +0100

    ofz#20051 if duplicate exists then m_ObjToRecMap points to deleted element
    
    Change-Id: I854410ba1d5c0a622b5ba9c6816a24a3477e5089
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86681
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 9f0db88ee889..cea6d7168b85 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5126,8 +5126,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)


More information about the Libreoffice-commits mailing list