[Libreoffice-commits] core.git: lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Tue Jan 23 16:31:10 UTC 2018
lotuswordpro/source/filter/lwpstory.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit ebfcf40d9a6508f0ca6a608d15d82a4fc9bf1238
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 23 13:21:24 2018 +0000
ofz: better loop detect
Change-Id: I7c33d2a64a6b4968e8a83f53f5c893eb5ba268b7
Reviewed-on: https://gerrit.libreoffice.org/48415
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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;
}
More information about the Libreoffice-commits
mailing list