summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpnotes.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-06 16:49:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-06 16:49:44 +0200
commit37183595bb3b4d58682f90fd9f6713bedcb852a2 (patch)
tree1ac1fd9d69c0d09ea204173bd77721dc01bbddeb /lotuswordpro/source/filter/lwpnotes.cxx
parent7abe976be5166845c5f43b70a0dfb38608d31356 (diff)
Fix memory leaks, by refcounting LwpObject
Change-Id: I1539597cd5bcabcbf0295d1acc320c503ad53604
Diffstat (limited to 'lotuswordpro/source/filter/lwpnotes.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpnotes.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/lotuswordpro/source/filter/lwpnotes.cxx b/lotuswordpro/source/filter/lwpnotes.cxx
index ccf959f19836..542943a0b22c 100644
--- a/lotuswordpro/source/filter/lwpnotes.cxx
+++ b/lotuswordpro/source/filter/lwpnotes.cxx
@@ -85,8 +85,8 @@ void LwpFribNote::Read(LwpObjectStream *pObjStrm, sal_uInt16 /*len*/)
*/
void LwpFribNote::RegisterNewStyle()
{
- LwpObject* pLayout = m_Layout.obj();
- if(pLayout)
+ rtl::Reference<LwpObject> pLayout = m_Layout.obj();
+ if(pLayout.is())
{
//register font style
LwpFrib::RegisterStyle(m_pPara->GetFoundry());
@@ -101,7 +101,7 @@ void LwpFribNote::RegisterNewStyle()
*/
void LwpFribNote::XFConvert(XFContentContainer* pCont)
{
- LwpNoteLayout* pLayout =static_cast<LwpNoteLayout*>(m_Layout.obj());
+ LwpNoteLayout* pLayout =static_cast<LwpNoteLayout*>(m_Layout.obj().get());
if(pLayout)
{
XFAnnotation* pXFNote = new XFAnnotation;
@@ -217,10 +217,10 @@ OUString LwpNoteLayout::GetAuthor()
LwpNoteHeaderLayout* pTextLayout = static_cast<LwpNoteHeaderLayout*>(FindChildByType(LWP_NOTEHEADER_LAYOUT));
if(pTextLayout)
{
- LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj());
+ LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj().get());
if(pStory)
{
- LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj());
+ LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj().get());
if(pFirst)
return pFirst->GetContentText(true);
}
@@ -280,8 +280,8 @@ void LwpNoteTextLayout::Read()
*/
void LwpNoteTextLayout::RegisterStyle()
{
- LwpObject* pContent = m_Content.obj();
- if(pContent)
+ rtl::Reference<LwpObject> pContent = m_Content.obj();
+ if(pContent.is())
{
pContent->SetFoundry(GetFoundry());
pContent->RegisterStyle();
@@ -290,8 +290,8 @@ void LwpNoteTextLayout::RegisterStyle()
void LwpNoteTextLayout::XFConvert(XFContentContainer * pCont)
{
- LwpObject* pContent = m_Content.obj();
- if(pContent)
+ rtl::Reference<LwpObject> pContent = m_Content.obj();
+ if(pContent.is())
{
pContent->XFConvert(pCont);
}