[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Dec 14 02:17:06 PST 2015


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

New commits:
commit 08fbd42376de4a7ff438d4c8dea954dfb7b82e2a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 14 10:15:06 2015 +0000

    clear objects from duplicate ids early
    
    Change-Id: I0caab9e329a465e10bf3ed321c55c287371bd437
    (cherry picked from commit 480fb6ca369f5a347489414e9d314c802b1ee7aa)

diff --git a/lotuswordpro/source/filter/lwpobjfactory.cxx b/lotuswordpro/source/filter/lwpobjfactory.cxx
index 127770b..b1f94a1 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;


More information about the Libreoffice-commits mailing list