diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-23 13:21:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-23 17:30:49 +0100 |
commit | ebfcf40d9a6508f0ca6a608d15d82a4fc9bf1238 (patch) | |
tree | 3e1191a59bf6cc6435dc3457dcf100bc27b41de0 | |
parent | c36547d16e1ea4f085880d480e7a6381108ff7d8 (diff) |
ofz: better loop detect
Change-Id: I7c33d2a64a6b4968e8a83f53f5c893eb5ba268b7
Reviewed-on: https://gerrit.libreoffice.org/48415
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | lotuswordpro/source/filter/lwpstory.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 491977516c7a..88e8e7b50b7c 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -67,6 +67,8 @@ #include <lwpobjfactory.hxx> #include "lwppagelayout.hxx" +#include <set> + LwpStory::LwpStory(LwpObjectHeader const &objHdr, LwpSvStream* pStrm) : LwpContent(objHdr, pStrm) @@ -100,15 +102,17 @@ void LwpStory::XFConvert(XFContentContainer* pCont) //process para list XFContentContainer* pParaCont = pCont; rtl::Reference<LwpPara> xPara(dynamic_cast<LwpPara*>(GetFirstPara().obj().get())); + std::set<LwpPara*> aConverted; while (xPara.is()) { xPara->SetFoundry(m_pFoundry); xPara->XFConvert(pParaCont); + aConverted.insert(xPara.get()); //Get the xfcontainer for the next para pParaCont = xPara->GetXFContainer(); rtl::Reference<LwpPara> xNext(dynamic_cast<LwpPara*>(xPara->GetNext().obj().get())); - if (xPara == xNext) + if (aConverted.find(xNext.get()) != aConverted.end()) throw std::runtime_error("loop in conversion"); xPara = xNext; } |