summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-18 16:13:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-18 18:28:15 +0100
commit9d34cf8c0e0ea833d0a2f643b62adc6d65b96cfc (patch)
treef5072d6800e9a0f7eeaab475215188c7a12af9b0 /lotuswordpro
parentdfe797e8a54f49270f25043dda5fdd95d8fbc4ff (diff)
ofz#5313 endless loop
Change-Id: I994944ce8b71b225334bd0aed8356a81d73a643a Reviewed-on: https://gerrit.libreoffice.org/51510 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx6
1 files changed, 4 insertions, 2 deletions
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");
}
}