ofz: loop in layout

Change-Id: I7c776d3b02bd8d35f160e82916213e402e9c88ab
This commit is contained in:
Caolán McNamara 2017-06-19 12:48:40 +01:00
parent 3b998365f4
commit 8b1bc1a3f5

View File

@ -367,19 +367,25 @@ bool LwpVirtualLayout::IsStyleLayout()
LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
{
LwpObjectID& rID = GetChildHead();
LwpVirtualLayout* pPrevLayout = nullptr;
while(!rID.IsNull())
{
LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
if (!pLayout)
break;
if (pPrevLayout && pLayout == pPrevLayout)
{
SAL_WARN("lwp", "loop in layout");
break;
}
pPrevLayout = pLayout;
if (pLayout->GetLayoutType() == eType)
{
return pLayout;
}
rID = pLayout->GetNext();
}