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

Caolán McNamara caolanm at redhat.com
Tue Jan 30 09:06:13 UTC 2018


 lotuswordpro/source/filter/lwpdoc.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit aa57442687b936fe862e73449ca39873888b9539
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 29 20:56:52 2018 +0000

    ofz#5313 Timeout
    
    Change-Id: I5a51bf241d1a3c3c04b4f46cd26d2afab518787c
    Reviewed-on: https://gerrit.libreoffice.org/48854
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index f12838a07095..72921cbae903 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -68,6 +68,7 @@
 #include "lwpverdocument.hxx"
 #include <xfilter/xfstylemanager.hxx>
 #include <osl/thread.h>
+#include <set>
 
 LwpDocument::LwpDocument(LwpObjectHeader const & objHdr, LwpSvStream* pStrm)
     : LwpDLNFPVList(objHdr, pStrm)
@@ -644,11 +645,15 @@ LwpDocument* LwpDocument::GetPreviousDivision()
 {
     LwpDocument* pRoot = GetRootDocument();
     LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : nullptr;
+    std::set<LwpDocument*> aSeen;
     while (pLastDoc)
     {
+        if (aSeen.find(pLastDoc) != aSeen.end())
+            throw std::runtime_error("loop in conversion");
         if (pLastDoc->GetEnSuperTableLayout().is())
             return pLastDoc;
         pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
+        aSeen.insert(pLastDoc);
     }
     return nullptr;
 


More information about the Libreoffice-commits mailing list