summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-31 20:57:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-31 21:03:44 +0000
commitd9efa12addb8fbedbc900081bdcaf9db7fd4cd66 (patch)
tree519da8b51d76acf826a169ee5c004fc906f007fa /lotuswordpro
parent888973850c7bf476de0b4c9b171d5b19583e8056 (diff)
ofz: Infinite loop
Change-Id: I9f7170023dd31c11ef6e02a6901bb5ea18f5fa81
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 73f0c3114640..c3aae4ee1369 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -484,25 +484,17 @@ void LwpHeadLayout::RegisterStyle()
{
//Register all children styles
rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
+ std::set<LwpVirtualLayout*> aSeen;
while (xLayout.is())
{
+ aSeen.insert(xLayout.get());
xLayout->SetFoundry(m_pFoundry);
//if the layout is relative to para, the layout will be registered in para
if (!xLayout->IsRelativeAnchored())
- {
- if (xLayout.get() == this)
- {
- OSL_FAIL("Layout points to itself");
- break;
- }
xLayout->DoRegisterStyle();
- }
rtl::Reference<LwpVirtualLayout> xNext(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
- if (xNext.get() == xLayout.get())
- {
- OSL_FAIL("Layout points to itself");
- break;
- }
+ if (aSeen.find(xNext.get()) != aSeen.end())
+ throw std::runtime_error("loop in conversion");
xLayout = xNext;
}
}