summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 16:03:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 16:03:32 +0000
commit517f2d46aab495b630b6d0ba805cacf01c78f364 (patch)
tree4b17f2c7bd6c1b05db850e06d28878edcbb3dfb2 /lotuswordpro
parent33b5bcc9e77b27cedfdeee61e11956bec6960cce (diff)
use more references to fix life cycles
Change-Id: I54931f0dccabb2d9a58cc92ef5ebf3469f93f03c (cherry picked from commit 0876868a14c7d139ed2a79ece989c84239a2c853)
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx41
1 files changed, 12 insertions, 29 deletions
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index 908cf3e42fe1..53d76a94a8e3 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -100,15 +100,15 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
XFConvertFrameInFrame(pCont);
//process para list
XFContentContainer* pParaCont = pCont;
- LwpPara* pPara = dynamic_cast<LwpPara*> ( GetFirstPara().obj().get() );
- while(pPara)
+ rtl::Reference<LwpPara> xPara(dynamic_cast<LwpPara*>(GetFirstPara().obj().get()));
+ while (xPara.is())
{
- pPara->SetFoundry(m_pFoundry);
- pPara->XFConvert(pParaCont);
+ xPara->SetFoundry(m_pFoundry);
+ xPara->XFConvert(pParaCont);
//Get the xfcontainer for the next para
- pParaCont = pPara->GetXFContainer();
- pPara = dynamic_cast<LwpPara*> ( pPara->GetNext().obj().get() );
+ pParaCont = xPara->GetXFContainer();
+ xPara.set(dynamic_cast<LwpPara*>(xPara->GetNext().obj().get()));
}
//process frame which anchor is to cell after converter all the para
@@ -116,15 +116,15 @@ void LwpStory::XFConvert(XFContentContainer* pCont)
XFConvertFrameInHeaderFooter(pCont);
//Release Lwp Objects
- LwpPara* pCur = dynamic_cast<LwpPara*> (GetFirstPara().obj().get());
- LwpPara* pNext;
- while(pCur)
+ rtl::Reference<LwpPara> xCur(dynamic_cast<LwpPara*>(GetFirstPara().obj().get()));
+ rtl::Reference<LwpPara> xNext;
+ while (xCur.is())
{
- pNext = dynamic_cast<LwpPara*> ( pCur->GetNext().obj().get() );
+ xNext.set(dynamic_cast<LwpPara*>(xCur->GetNext().obj().get()));
LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();
- pObjMgr->ReleaseObject(pCur->GetObjectID());
- pCur = pNext;
+ pObjMgr->ReleaseObject(xCur->GetObjectID());
+ xCur = xNext;
}
}
@@ -146,23 +146,6 @@ void LwpStory::Parse(IXFStream* pOutputStream)
m_pXFContainer->ToXml(pOutputStream);
delete m_pXFContainer;
m_pXFContainer = nullptr;
-
- //It seems that, currently, we do not need to process the child story
- /*LwpObject* pChildStory = GetFirstStory()->obj();
- if(pChildStory)
- {
- pChildStory->SetFoundry(m_pFoundry);
- pChildStory->Parse(pOutputStream);
- }*/
-
- //Don't process the next story
-/* LwpObject* pNextStory = GetNextStory()->obj();
- if(pNextStory)
- {
- pNextStory->SetFoundry(m_pFoundry);
- pNextStory->Parse(pOutputStream);
- }*/
-
}
#include "lwppagelayout.hxx"