diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-03 15:19:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-03 19:54:35 +0100 |
commit | 20ac7089ad833d0d70c8c3e88a58d20a88530c42 (patch) | |
tree | 4894174bb90fd9d5889e48ca4239260461abeff8 | |
parent | 2f2ce15d1e20ab0096157b50c6b482b7cc540435 (diff) |
ofz#4909 Direct-leak
Change-Id: I16f2fd93bbc416a5677f8bbe02e22b4615599eaa
Reviewed-on: https://gerrit.libreoffice.org/47323
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | lotuswordpro/source/filter/lwpgrfobj.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 4d596c82dd3e..aaa7f688c6c6 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -442,18 +442,18 @@ void LwpGraphicObject::CreateGrafObject() rtl::Reference<XFImage> pImage = new XFImage(); // set image processing styles - XFImageStyle* pImageStyle = new XFImageStyle(); + std::unique_ptr<XFImageStyle> xImageStyle(new XFImageStyle); if (m_sServerContextFormat[1]!='w' || m_sServerContextFormat[2]!='m' || m_sServerContextFormat[3]!='f') { if (m_aIPData.nBrightness != 50) { sal_Int32 nSODCBrightness = (sal_Int32)m_aIPData.nBrightness*2 - 100; - pImageStyle->SetBrightness(nSODCBrightness); + xImageStyle->SetBrightness(nSODCBrightness); } if (m_aIPData.nContrast != 50) { sal_Int32 nSODCContrast = (sal_Int32)(80 - (double)m_aIPData.nContrast*1.6); - pImageStyle->SetContrast(nSODCContrast); + xImageStyle->SetContrast(nSODCContrast); } } @@ -542,8 +542,8 @@ void LwpGraphicObject::CreateGrafObject() if (pMyFrameLayout->GetScaleCenter() || pMyFrameLayout->GetScaleTile()) { // set center alignment - pImageStyle->SetXPosType(enumXFFrameXPosCenter, enumXFFrameXRelFrame); - pImageStyle->SetYPosType(enumXFFrameYPosMiddle, enumXFFrameYRelFrame); + xImageStyle->SetXPosType(enumXFFrameXPosCenter, enumXFFrameXRelFrame); + xImageStyle->SetYPosType(enumXFFrameYPosMiddle, enumXFFrameYRelFrame); // need horizontal crop? double fClipWidth = 0; @@ -564,7 +564,7 @@ void LwpGraphicObject::CreateGrafObject() if (sal_bCropped) { - pImageStyle->SetClip(fClipWidth, fClipWidth, fClipHeight, fClipHeight); + xImageStyle->SetClip(fClipWidth, fClipWidth, fClipHeight, fClipHeight); pImage->SetWidth(fDisFrameWidth); pImage->SetHeight(fDisFrameHeight); } @@ -573,8 +573,8 @@ void LwpGraphicObject::CreateGrafObject() else { // set left-top alignment - pImageStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame); - pImageStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame); + xImageStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame); + xImageStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame); // get image position offset LwpPoint& rOffset = pMyScale->GetOffset(); @@ -635,7 +635,7 @@ void LwpGraphicObject::CreateGrafObject() aCropRect.fBottom = (aImageRect.fBottom - aFrameRect.fBottom) / fYRatio; } - pImageStyle->SetClip(aCropRect.fLeft, aCropRect.fRight, aCropRect.fTop, aCropRect.fBottom); + xImageStyle->SetClip(aCropRect.fLeft, aCropRect.fRight, aCropRect.fTop, aCropRect.fBottom); double fPicWidth = fSclGrafWidth - (aCropRect.fLeft+aCropRect.fRight)*fXRatio; double fPicHeight = fSclGrafHeight- (aCropRect.fTop+aCropRect.fBottom)*fYRatio; double fX = fOffsetX > 0 ? fOffsetX : 0.00; @@ -648,7 +648,7 @@ void LwpGraphicObject::CreateGrafObject() // set style for the image XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - pImage->SetStyleName(pXFStyleManager->AddStyle(pImageStyle).m_pStyle->GetStyleName()); + pImage->SetStyleName(pXFStyleManager->AddStyle(xImageStyle.release()).m_pStyle->GetStyleName()); // set anchor to frame pImage->SetAnchorType(enumXFAnchorFrame); |