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:16:06 +0000 |
commit | 08fbd42376de4a7ff438d4c8dea954dfb7b82e2a (patch) | |
tree | 79816521166b343ec0b95f5467a6638b318c9ea2 /lotuswordpro | |
parent | 7b6769e6437aa588215100c2b1de0b9fda11d475 (diff) |
clear objects from duplicate ids early
Change-Id: I0caab9e329a465e10bf3ed321c55c287371bd437
(cherry picked from commit 480fb6ca369f5a347489414e9d314c802b1ee7aa)
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; |