summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 12:42:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 12:43:19 +0000
commitc3568650bf339e283b6212e87d60a7faead2ec80 (patch)
tree4f09c4829a4df9d6b41a34c99cc7a101b4d04ba3 /lotuswordpro
parent6fee415ec54c1386cbabb10bec0d7f6e28e17987 (diff)
use more references to fix life cycles
Change-Id: Ib70b5ebc498e6517ef40d0515e69e2e77288c1b5 (cherry picked from commit 62a6cadbab6c7bdfbd605c1c75c250904ed10442)
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdoc.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index 12975e35f338..d0be3964fec3 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -284,18 +284,18 @@ void LwpDocument::RegisterLayoutStyles()
void LwpDocument::RegisterStylesInPara()
{
//Register all automatic styles in para
- LwpHeadContent* pContent = m_pFoundry
+ rtl::Reference<LwpHeadContent> xContent(m_pFoundry
? dynamic_cast<LwpHeadContent*> (m_pFoundry->GetContentManager().GetContentList().obj().get())
- : nullptr;
- if (pContent)
+ : nullptr);
+ if (xContent.is())
{
- LwpStory* pStory = dynamic_cast<LwpStory*>(pContent->GetChildHead().obj(VO_STORY).get());
- while(pStory)
+ rtl::Reference<LwpStory> xStory(dynamic_cast<LwpStory*>(xContent->GetChildHead().obj(VO_STORY).get()));
+ while (xStory.is())
{
//Register the child para
- pStory->SetFoundry(m_pFoundry);
- pStory->DoRegisterStyle();
- pStory = dynamic_cast<LwpStory*>(pStory->GetNext().obj(VO_STORY).get());
+ xStory->SetFoundry(m_pFoundry);
+ xStory->DoRegisterStyle();
+ xStory.set(dynamic_cast<LwpStory*>(xStory->GetNext().obj(VO_STORY).get()));
}
}
}