Kaydet (Commit) 012bdecf authored tarafından Caolán McNamara's avatar Caolán McNamara

more lifecycle protection

Change-Id: I158632de6898685e34d362cc274e959bb5c2e2d7
üst 69d166a0
...@@ -301,21 +301,19 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) ...@@ -301,21 +301,19 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is()) while (xLayout.is())
{ {
LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
while(pFrameLayout) while (xFrameLayout.is())
{ {
if (xFrameLayout->IsAnchorCell() && xFrameLayout->HasContent())
//if(pFrameLayout->IsAnchorCell())
if(pFrameLayout->IsAnchorCell() && pFrameLayout->HasContent())
{ {
//get the first xfpara //get the first xfpara
rtl::Reference<XFContent> first( rtl::Reference<XFContent> first(
pCont->FindFirstContent(enumXFContentPara)); pCont->FindFirstContent(enumXFContentPara));
XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get()); XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get());
if(pXFFirtPara) 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()); xLayout = GetLayout(xLayout.get());
} }
...@@ -329,17 +327,17 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) ...@@ -329,17 +327,17 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is()) while (xLayout.is())
{ {
LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
while(pFrameLayout) while (xFrameLayout.is())
{ {
if((pFrameLayout->IsAnchorPage() if((xFrameLayout->IsAnchorPage()
&&(pFrameLayout->IsFrame() &&(xFrameLayout->IsFrame()
||pFrameLayout->IsSuperTable() || xFrameLayout->IsSuperTable()
||pFrameLayout->IsGroupHead()))) || 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()); xLayout = GetLayout(xLayout.get());
} }
...@@ -352,14 +350,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) ...@@ -352,14 +350,14 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.get()) while (xLayout.get())
{ {
LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
while(pFrameLayout) 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()); xLayout = GetLayout(xLayout.get());
} }
...@@ -372,19 +370,19 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) ...@@ -372,19 +370,19 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont)
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.is()) while (xLayout.is())
{ {
LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); rtl::Reference<LwpVirtualLayout> xFrameLayout(dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()));
while(pFrameLayout) 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> //The frame must be included by <text:p>
rtl::Reference<XFContent> first( rtl::Reference<XFContent> first(
pCont->FindFirstContent(enumXFContentPara)); pCont->FindFirstContent(enumXFContentPara));
XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get()); XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(first.get());
if(pXFFirtPara) 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()); xLayout = GetLayout(xLayout.get());
} }
......
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