lotuswordpro/source/filter/lwpstory.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 9d34cf8c0e0ea833d0a2f643b62adc6d65b96cfc Author: Caolán McNamara <caol...@redhat.com> Date: Sun Mar 18 16:13:10 2018 +0000 ofz#5313 endless loop Change-Id: I994944ce8b71b225334bd0aed8356a81d73a643a Reviewed-on: https://gerrit.libreoffice.org/51510 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 88e8e7b50b7c..1d81a9334f5c 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -137,13 +137,15 @@ void LwpStory::XFConvert(XFContentContainer* pCont) void LwpStory::RegisterStyle() { rtl::Reference<LwpPara> xPara(dynamic_cast<LwpPara*>(GetFirstPara().obj().get())); + std::set<LwpPara*> aSeen; while (xPara.is()) { - if (xPara->GetFoundry()) - throw std::runtime_error("loop in register style"); + aSeen.insert(xPara.get()); xPara->SetFoundry(m_pFoundry); xPara->DoRegisterStyle(); xPara.set(dynamic_cast<LwpPara*>(xPara->GetNext().obj().get())); + if (aSeen.find(xPara.get()) != aSeen.end()) + throw std::runtime_error("loop in register style"); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits