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() ...@@ -330,12 +330,12 @@ LwpVirtualLayout* LwpVirtualLayout::GetParentLayout()
void LwpVirtualLayout::RegisterChildStyle() void LwpVirtualLayout::RegisterChildStyle()
{ {
//Register all children styles //Register all children styles
LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while(pLayout) while (xLayout.is())
{ {
pLayout->SetFoundry(m_pFoundry); xLayout->SetFoundry(m_pFoundry);
pLayout->RegisterStyle(); xLayout->RegisterStyle();
pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get()); xLayout.set(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
} }
} }
......
...@@ -503,24 +503,24 @@ void LwpPageLayout::ResetXFColumns() ...@@ -503,24 +503,24 @@ void LwpPageLayout::ResetXFColumns()
LwpHeaderLayout* LwpPageLayout::GetHeaderLayout() LwpHeaderLayout* LwpPageLayout::GetHeaderLayout()
{ {
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while(pLay) while (xLay.is())
{ {
if( pLay->GetLayoutType() == LWP_HEADER_LAYOUT ) if (xLay->GetLayoutType() == LWP_HEADER_LAYOUT)
return ( static_cast<LwpHeaderLayout*> (pLay) ); return dynamic_cast<LwpHeaderLayout*>(xLay.get());
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get()); xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
} }
return nullptr; return nullptr;
} }
LwpFooterLayout* LwpPageLayout::GetFooterLayout() LwpFooterLayout* LwpPageLayout::GetFooterLayout()
{ {
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while(pLay) while (xLay.is())
{ {
if( pLay->GetLayoutType() == LWP_FOOTER_LAYOUT ) if (xLay->GetLayoutType() == LWP_FOOTER_LAYOUT)
return ( static_cast<LwpFooterLayout*> (pLay) ); return dynamic_cast<LwpFooterLayout*>(xLay.get());
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get()); xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
} }
return nullptr; return nullptr;
} }
...@@ -533,19 +533,19 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout() ...@@ -533,19 +533,19 @@ LwpPageLayout* LwpPageLayout::GetOddChildLayout()
{ {
if(IsComplex()) if(IsComplex())
{ {
LwpVirtualLayout* pLay = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
while(pLay) 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(); LwpUseWhen* pUseWhen = pPageLayout->GetUseWhen();
if(pUseWhen && pUseWhen->IsUseOnAllOddPages()) if(pUseWhen && pUseWhen->IsUseOnAllOddPages())
{ {
return pPageLayout; return pPageLayout;
} }
} }
pLay = dynamic_cast<LwpVirtualLayout*> (pLay->GetNext().obj().get()); xLay.set(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
} }
} }
return nullptr; return nullptr;
......
...@@ -691,11 +691,8 @@ void LwpTableLayout::RegisterStyle() ...@@ -691,11 +691,8 @@ void LwpTableLayout::RegisterStyle()
{ {
// get super table layout // get super table layout
LwpSuperTableLayout * pSuper = GetSuperTableLayout(); LwpSuperTableLayout * pSuper = GetSuperTableLayout();
if(!pSuper) if (!pSuper)
{
assert(false);
return; return;
}
// get table // get table
LwpTable * pTable = GetTable(); 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