diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-01 11:53:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-01 11:54:46 +0000 |
commit | a75439fe0f2e54781e6344b4b2db1a0a02a94c76 (patch) | |
tree | 185f92f4977ccdbbfccada16f164740e41c6dfb0 /lotuswordpro/source | |
parent | tdf#77111 cui,sw: fix page number offset on paragraph dialog "Text Flow" (diff) | |
download | core-a75439fe0f2e54781e6344b4b2db1a0a02a94c76.tar.gz core-a75439fe0f2e54781e6344b4b2db1a0a02a94c76.zip |
fix leak
Change-Id: I7f87bf07e50baffd463d4429186928642bdf73b3
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpframelayout.cxx | 44 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpframelayout.hxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 4 |
3 files changed, 25 insertions, 25 deletions
diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx index a1cb93598a67..c4de8630c4be 100644 --- a/lotuswordpro/source/filter/lwpframelayout.cxx +++ b/lotuswordpro/source/filter/lwpframelayout.cxx @@ -83,26 +83,26 @@ LwpFrame::~LwpFrame() * @param: pFrameStyle - Frame Style object * */ -void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle) +void LwpFrame::RegisterStyle(std::unique_ptr<XFFrameStyle>& rFrameStyle) { - ApplyWrapType(pFrameStyle); - ApplyMargins(pFrameStyle); - ApplyPadding(pFrameStyle); - ApplyBorders(pFrameStyle); - ApplyColumns(pFrameStyle); - ApplyShadow(pFrameStyle); - ApplyBackGround(pFrameStyle); - ApplyWatermark(pFrameStyle); -// ApplyBackColor(pFrameStyle); - ApplyProtect(pFrameStyle); - ApplyTextDir(pFrameStyle); - ApplyPosType(pFrameStyle); - - pFrameStyle->SetStyleName(m_pLayout->GetName().str()); + ApplyWrapType(rFrameStyle.get()); + ApplyMargins(rFrameStyle.get()); + ApplyPadding(rFrameStyle.get()); + ApplyBorders(rFrameStyle.get()); + ApplyColumns(rFrameStyle.get()); + ApplyShadow(rFrameStyle.get()); + ApplyBackGround(rFrameStyle.get()); + ApplyWatermark(rFrameStyle.get()); + ApplyProtect(rFrameStyle.get()); + ApplyTextDir(rFrameStyle.get()); + ApplyPosType(rFrameStyle.get()); + + rFrameStyle->SetStyleName(m_pLayout->GetName().str()); XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - m_StyleName = pXFStyleManager->AddStyle(pFrameStyle).m_pStyle->GetStyleName(); + m_StyleName = pXFStyleManager->AddStyle(rFrameStyle.release()).m_pStyle->GetStyleName(); m_pLayout->SetStyleName(m_StyleName); } + /** * @descr: parse frame and set frame properties * @param: pXFFrame - XFFrame object @@ -856,9 +856,9 @@ void LwpFrameLayout::RegisterStyle() return; //register frame style - XFFrameStyle* pFrameStyle = new XFFrameStyle(); - m_pFrame.reset( new LwpFrame(this) ); - m_pFrame->RegisterStyle(pFrameStyle); + std::unique_ptr<XFFrameStyle> xFrameStyle(new XFFrameStyle); + m_pFrame.reset(new LwpFrame(this)); + m_pFrame->RegisterStyle(xFrameStyle); //register content style rtl::Reference<LwpObject> content = m_Content.obj(); @@ -1046,9 +1046,9 @@ void LwpGroupLayout::RegisterStyle() return; //register frame style - XFFrameStyle* pFrameStyle = new XFFrameStyle(); - m_pFrame.reset( new LwpFrame(this) ); - m_pFrame->RegisterStyle(pFrameStyle); + std::unique_ptr<XFFrameStyle> xFrameStyle(new XFFrameStyle); + m_pFrame.reset(new LwpFrame(this)); + m_pFrame->RegisterStyle(xFrameStyle); //register child frame style RegisterChildStyle(); diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx index 9575687283b1..527e5fbd50b5 100644 --- a/lotuswordpro/source/filter/lwpframelayout.hxx +++ b/lotuswordpro/source/filter/lwpframelayout.hxx @@ -74,7 +74,7 @@ class LwpFrame public: explicit LwpFrame(LwpPlacableLayout* pLayout); ~LwpFrame(); - void RegisterStyle(XFFrameStyle* pFrameStyle); + void RegisterStyle(std::unique_ptr<XFFrameStyle>& rFrameStyle); void Parse(XFFrame* pXFFrame, sal_Int32 nPageNo); void XFConvert(XFContentContainer* pCont); private: diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index f690daf296a4..7973803ec016 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -410,8 +410,8 @@ void LwpSuperTableLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 n */ void LwpSuperTableLayout::RegisterFrameStyle() { - XFFrameStyle* pFrameStyle = new XFFrameStyle(); - m_pFrame->RegisterStyle(pFrameStyle); + std::unique_ptr<XFFrameStyle> xFrameStyle(new XFFrameStyle); + m_pFrame->RegisterStyle(xFrameStyle); } LwpTableLayout::LwpTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm) |