Kaydet (Commit) 1deae8a2 authored tarafından Caolán McNamara's avatar Caolán McNamara

deploy references to keep layout alive long enough

Change-Id: I670f00b0beb77e5014c3dd4a4798e69ece882b87
üst 2487ba80
......@@ -330,12 +330,12 @@ LwpVirtualLayout* LwpVirtualLayout::GetParentLayout()
void LwpVirtualLayout::RegisterChildStyle()
{
//Register all children styles
LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLayout)
rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while (xLayout.is())
{
pLayout->SetFoundry(m_pFoundry);
pLayout->RegisterStyle();
pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
xLayout->SetFoundry(m_pFoundry);
xLayout->RegisterStyle();
xLayout.set(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
}
}
......
......@@ -503,24 +503,24 @@ void LwpPageLayout::ResetXFColumns()
LwpHeaderLayout* LwpPageLayout::GetHeaderLayout()
{
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while (xLay.is())
{
if( pLay->GetLayoutType() == LWP_HEADER_LAYOUT )
return ( static_cast<LwpHeaderLayout*> (pLay) );
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
if (xLay->GetLayoutType() == LWP_HEADER_LAYOUT)
return dynamic_cast<LwpHeaderLayout*>(xLay.get());
xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
}
return nullptr;
}
LwpFooterLayout* LwpPageLayout::GetFooterLayout()
{
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while (xLay.is())
{
if( pLay->GetLayoutType() == LWP_FOOTER_LAYOUT )
return ( static_cast<LwpFooterLayout*> (pLay) );
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
if (xLay->GetLayoutType() == LWP_FOOTER_LAYOUT)
return dynamic_cast<LwpFooterLayout*>(xLay.get());
xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
}
return nullptr;
}
......@@ -533,19 +533,19 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout()
{
if(IsComplex())
{
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
while(pLay)
rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while (xLay.is())
{
if( pLay->GetLayoutType() == LWP_PAGE_LAYOUT )
if (xLay->GetLayoutType() == LWP_PAGE_LAYOUT)
{
LwpPageLayout* pPageLayout = static_cast<LwpPageLayout*> (pLay);
LwpPageLayout* pPageLayout = static_cast<LwpPageLayout*>(xLay.get());
LwpUseWhen* pUseWhen = pPageLayout->GetUseWhen();
if(pUseWhen && pUseWhen->IsUseOnAllOddPages())
{
return pPageLayout;
}
}
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get());
xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
}
}
return nullptr;
......
......@@ -691,11 +691,8 @@ void LwpTableLayout::RegisterStyle()
{
// get super table layout
LwpSuperTableLayout * pSuper = GetSuperTableLayout();
if(!pSuper)
{
assert(false);
if (!pSuper)
return;
}
// get table
LwpTable * pTable = GetTable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment