summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 12:29:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 12:30:00 +0000
commit6fee415ec54c1386cbabb10bec0d7f6e28e17987 (patch)
treee5cbbfc55d9ad0d8dbc73fe654d3694289e9f13d /lotuswordpro
parent27f138b27b14827485e587cf924a227b8aabe91f (diff)
deploy references to keep layout alive long enough
Change-Id: I670f00b0beb77e5014c3dd4a4798e69ece882b87 (cherry picked from commit 1deae8a2d92747ad69b024513ddae93cc8927d29)
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx10
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx30
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx5
3 files changed, 21 insertions, 24 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 3e58fa90de8f..e4a9112904ad 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -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()));
}
}
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index e7fd45d272db..cd291575967d 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -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;
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index e5b16c7c7c88..97835316c1c4 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -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();