summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-14 20:48:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-01-14 20:48:50 +0000
commit594a21fd5e13bc4626e22bf06d85822d6de9eebf (patch)
tree0a2c117324341994bd109ddcadc5836261bfc771 /lotuswordpro
parentf172d5ee4813e94c5c7f678a636985d0f76e872a (diff)
ofz#5301 Direct-leak
Change-Id: Id9b876e89dd186782c0168229840f721a8b3720c
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpbulletstylemgr.cxx13
-rw-r--r--lotuswordpro/source/filter/lwpbulletstylemgr.hxx2
-rw-r--r--lotuswordpro/source/filter/lwpfribptr.cxx8
-rw-r--r--lotuswordpro/source/filter/lwppara.cxx10
-rw-r--r--lotuswordpro/source/filter/lwppara.hxx2
5 files changed, 17 insertions, 18 deletions
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
index 9692eedb7fa3..4b97c6551e6e 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.cxx
@@ -110,7 +110,7 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid
LwpPara* pBulletPara = pSilverBullet->GetBulletPara();
if (!pBulletPara)
{
- assert(false);
+ SAL_WARN("lwp", "missing bullet para");
return OUString();
}
@@ -245,7 +245,7 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid
//Create nested XFList and XFItems and then add it to XFContentContainer(pCont)
//Return the inner XFItem created.
-XFContentContainer* LwpBulletStyleMgr::AddBulletList(
+rtl::Reference<XFContentContainer> LwpBulletStyleMgr::AddBulletList(
XFContentContainer* pCont, bool bIsOrdered,
const OUString& rStyleName, sal_Int16 nLevel, bool bIsBulletSkiped)
{
@@ -256,13 +256,12 @@ XFContentContainer* LwpBulletStyleMgr::AddBulletList(
//todo: need judge here.
bool bContinue = m_bContinue;
- XFList* theList;
- XFList* prevList = nullptr;
+ rtl::Reference<XFList> prevList;
XFListItem* theItem;
XFListItem* InnerItem = nullptr;
for (sal_Int8 nC = nLevel-1; nC >= 0; nC--)
{
- theList = new XFList();
+ rtl::Reference<XFList> theList(new XFList);
theItem = new XFListItem();
theList->Add(theItem);
@@ -284,7 +283,7 @@ XFContentContainer* LwpBulletStyleMgr::AddBulletList(
if (nC == 0 && pCont)
{
theList->SetStyleName(rStyleName);
- pCont->Add(theList);
+ pCont->Add(theList.get());
}
if ((nC == nLevel-1) && bIsBulletSkiped)
@@ -301,7 +300,7 @@ XFContentContainer* LwpBulletStyleMgr::AddBulletList(
if(prevList)
{
- theItem->Add(prevList);
+ theItem->Add(prevList.get());
}
prevList = theList;
}
diff --git a/lotuswordpro/source/filter/lwpbulletstylemgr.hxx b/lotuswordpro/source/filter/lwpbulletstylemgr.hxx
index 7dce7eb165c6..78754a75b355 100644
--- a/lotuswordpro/source/filter/lwpbulletstylemgr.hxx
+++ b/lotuswordpro/source/filter/lwpbulletstylemgr.hxx
@@ -84,7 +84,7 @@ public:
LwpIndentOverride const * pIndent);
inline void SetFoundry(LwpFoundry* pFoundry);
inline void SetContinueFlag(bool bFlag);
- XFContentContainer* AddBulletList(XFContentContainer* pCont, bool bIsOrdered,
+ rtl::Reference<XFContentContainer> AddBulletList(XFContentContainer* pCont, bool bIsOrdered,
const OUString& rStyleName, sal_Int16 nLevel, bool bIsBulletSkiped);
inline void SetCurrentSilverBullet(const LwpObjectID& rNewID);
diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx
index d56f0aba06ed..0cad23dfbe2f 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -240,10 +240,10 @@ void LwpFribPtr::XFConvert()
break;
case FRIB_TAG_COLBREAK:
{
- XFParagraph *pPara = new XFParagraph();
- pPara->SetStyleName(pFrib->GetStyleName());
- SetXFPara(pPara);
- m_pPara->AddXFContent(pPara);
+ rtl::Reference<XFParagraph> xPara(new XFParagraph);
+ xPara->SetStyleName(pFrib->GetStyleName());
+ SetXFPara(xPara.get());
+ m_pPara->AddXFContent(xPara.get());
}
break;
case FRIB_TAG_LINEBREAK:
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index af39a79bea70..0c9c59d6fd2d 100644
--- a/lotuswordpro/source/filter/lwppara.cxx
+++ b/lotuswordpro/source/filter/lwppara.cxx
@@ -278,10 +278,10 @@ void LwpPara::XFConvert(XFContentContainer* pCont)
if (m_bHasBullet && m_pSilverBullet)
{
- XFContentContainer* pListItem = AddBulletList(m_pXFContainer);
- if (pListItem)
+ rtl::Reference<XFContentContainer> xListItem = AddBulletList(m_pXFContainer);
+ if (xListItem)
{
- pListItem->Add(pPara);
+ xListItem->Add(pPara);
}
}
else if (m_pXFContainer)
@@ -879,13 +879,13 @@ LwpBulletStyleMgr* LwpPara::GetBulletStyleMgr()
return nullptr;
}
-XFContentContainer* LwpPara::AddBulletList(XFContentContainer* pCont)
+rtl::Reference<XFContentContainer> LwpPara::AddBulletList(XFContentContainer* pCont)
{
LwpBulletStyleMgr* pBulletStyleMgr = GetBulletStyleMgr();
if (!pBulletStyleMgr)
{
assert(false);
- return nullptr;
+ return rtl::Reference<XFContentContainer>();
}
sal_uInt16 nLevel = m_nLevel;
diff --git a/lotuswordpro/source/filter/lwppara.hxx b/lotuswordpro/source/filter/lwppara.hxx
index da927326c24e..2b662ea75204 100644
--- a/lotuswordpro/source/filter/lwppara.hxx
+++ b/lotuswordpro/source/filter/lwppara.hxx
@@ -271,7 +271,7 @@ private:
void RegisterNewSectionStyle(LwpPageLayout* pLayout);
void ParseDropcapContent();
- XFContentContainer* AddBulletList(XFContentContainer* pCont);
+ rtl::Reference<XFContentContainer> AddBulletList(XFContentContainer* pCont);
void AddBreakAfter(XFContentContainer* pCont);
void AddBreakBefore(XFContentContainer* pCont);
XFSection* CreateXFSection();