summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 17:50:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 17:50:45 +0000
commit455e35dfc89119dc93aecaee1447b2b27ce27baf (patch)
treef67fbe1e4553b56087534c02a580fa1cddcbd3b8
parent86d2f25e3bd3a7d94087ac1b277ede0a58e26720 (diff)
more lifecycle protection
Change-Id: I158632de6898685e34d362cc274e959bb5c2e2d7 (cherry picked from commit 012bdecfcd7094403516c98bd5231fe1ef6f7e9d)
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx48
1 files changed, 23 insertions, 25 deletions
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index ed5273030693..da8ea33c9d2f 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -301,21 +301,19 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is())
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get());
- while(pFrameLayout)
+ rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
+ while (xFrameLayout.is())
{
-
- //if(pFrameLayout->IsAnchorCell())
- if(pFrameLayout->IsAnchorCell() && pFrameLayout->HasContent())
+ if (xFrameLayout->IsAnchorCell() && xFrameLayout->HasContent())
{
//get the first xfpara
rtl::Reference<XFContent> first(
pCont->FindFirstContent(enumXFContentPara));
XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get());
if(pXFFirtPara)
- pFrameLayout->XFConvert(pXFFirtPara);
+ xFrameLayout->XFConvert(pXFFirtPara);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
+ xFrameLayout.set(dynamic_cast<LwpVirtualLayout*>(xFrameLayout->GetNext().obj().get()));
}
xLayout = GetLayout(xLayout.get());
}
@@ -329,17 +327,17 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is())
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get());
- while(pFrameLayout)
+ rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
+ while (xFrameLayout.is())
{
- if((pFrameLayout->IsAnchorPage()
- &&(pFrameLayout->IsFrame()
- ||pFrameLayout->IsSuperTable()
- ||pFrameLayout->IsGroupHead())))
+ if((xFrameLayout->IsAnchorPage()
+ &&(xFrameLayout->IsFrame()
+ || xFrameLayout->IsSuperTable()
+ || xFrameLayout->IsGroupHead())))
{
- pFrameLayout->XFConvert(pCont);
+ xFrameLayout->XFConvert(pCont);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
+ xFrameLayout.set(dynamic_cast<LwpVirtualLayout*>(xFrameLayout->GetNext().obj().get()));
}
xLayout = GetLayout(xLayout.get());
}
@@ -352,14 +350,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.get())
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get());
- while(pFrameLayout)
+ rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
+ while (xFrameLayout.is())
{
- if(pFrameLayout->IsAnchorFrame())
+ if (xFrameLayout->IsAnchorFrame())
{
- pFrameLayout->XFConvert(pCont);
+ xFrameLayout->XFConvert(pCont);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
+ xFrameLayout.set(dynamic_cast<LwpVirtualLayout*>(xFrameLayout->GetNext().obj().get()));
}
xLayout = GetLayout(xLayout.get());
}
@@ -372,19 +370,19 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is())
{
- LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get());
- while(pFrameLayout)
+ rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
+ while (xFrameLayout.is())
{
- if(pFrameLayout->IsAnchorPage() && (xLayout->IsHeader() || xLayout->IsFooter()))
+ if (xFrameLayout->IsAnchorPage() && (xLayout->IsHeader() || xLayout->IsFooter()))
{
//The frame must be included by <text:p>
rtl::Reference<XFContent> first(
pCont->FindFirstContent(enumXFContentPara));
XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get());
if(pXFFirtPara)
- pFrameLayout->XFConvert(pXFFirtPara);
+ xFrameLayout->XFConvert(pXFFirtPara);
}
- pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get());
+ xFrameLayout.set(dynamic_cast<LwpVirtualLayout*>(xFrameLayout->GetNext().obj().get()));
}
xLayout = GetLayout(xLayout.get());
}