ofz: loop in layout
Change-Id: I7c776d3b02bd8d35f160e82916213e402e9c88ab
This commit is contained in:
@@ -367,19 +367,25 @@ bool LwpVirtualLayout::IsStyleLayout()
|
|||||||
LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
|
LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
|
||||||
{
|
{
|
||||||
LwpObjectID& rID = GetChildHead();
|
LwpObjectID& rID = GetChildHead();
|
||||||
|
LwpVirtualLayout* pPrevLayout = nullptr;
|
||||||
|
|
||||||
while(!rID.IsNull())
|
while(!rID.IsNull())
|
||||||
{
|
{
|
||||||
LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
|
LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
|
||||||
if (!pLayout)
|
if (!pLayout)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (pPrevLayout && pLayout == pPrevLayout)
|
||||||
{
|
{
|
||||||
|
SAL_WARN("lwp", "loop in layout");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pPrevLayout = pLayout;
|
||||||
|
|
||||||
if (pLayout->GetLayoutType() == eType)
|
if (pLayout->GetLayoutType() == eType)
|
||||||
{
|
|
||||||
return pLayout;
|
return pLayout;
|
||||||
}
|
|
||||||
rID = pLayout->GetNext();
|
rID = pLayout->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user