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>
This commit is contained in:
Caolán McNamara
2018-03-18 16:13:10 +00:00
parent dfe797e8a5
commit 9d34cf8c0e

View File

@@ -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");
}
}