summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-14 10:15:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-14 10:16:06 +0000
commit08fbd42376de4a7ff438d4c8dea954dfb7b82e2a (patch)
tree79816521166b343ec0b95f5467a6638b318c9ea2 /lotuswordpro
parent7b6769e6437aa588215100c2b1de0b9fda11d475 (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.cxx9
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;