diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-14 10:15:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-14 10:15:27 +0000 |
commit | 480fb6ca369f5a347489414e9d314c802b1ee7aa (patch) | |
tree | 86418a30fa1163a108f31e29692f9506696c4775 /lotuswordpro | |
parent | d25035bc1c65998fc9e7d6271d5f7a16cf9cecc5 (diff) |
clear objects from duplicate ids early
Change-Id: I0caab9e329a465e10bf3ed321c55c287371bd437
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpobjfactory.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lotuswordpro/source/filter/lwpobjfactory.cxx b/lotuswordpro/source/filter/lwpobjfactory.cxx index 127770bd8d5d..b1f94a11e346 100644 --- a/lotuswordpro/source/filter/lwpobjfactory.cxx +++ b/lotuswordpro/source/filter/lwpobjfactory.cxx @@ -665,10 +665,15 @@ rtl::Reference<LwpObject> LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObj break; } } - if(newObj.is()) + if (newObj.is()) { newObj->QuickRead(); - m_IdToObjList.insert(LwpIdToObjMap::value_type(objHdr.GetID(), newObj)); + auto result = m_IdToObjList.insert(LwpIdToObjMap::value_type(objHdr.GetID(), newObj)); + if (!result.second) + { + SAL_WARN("lwp", "clearing duplicate object"); + newObj.clear(); + } } return newObj; |