diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-03 16:20:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-03 18:29:29 +0100 |
commit | 64d51760cc41bf033a6b69258f6f4a376878d17a (patch) | |
tree | 4fe906c1daac5a425cec1016d7cfda4fb757514d /lotuswordpro | |
parent | aca34b59b6d1d0dba9aa05d50315c7fed57681df (diff) |
ofz#6674 Direct-leak
Change-Id: Ia396d11cca424da1507bd470c04642bdb7482f72
Reviewed-on: https://gerrit.libreoffice.org/50681
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 014ff5563d16..235a4515c6fa 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1370,42 +1370,42 @@ XFBGImage* LwpMiddleLayout::GetXFBGImage() LwpGraphicObject* pGrfObj = dynamic_cast<LwpGraphicObject*>(pLay->GetContent().obj().get()); if(pGrfObj) { - XFBGImage* pXFBGImage = new XFBGImage(); + std::unique_ptr<XFBGImage> xXFBGImage(new XFBGImage); if(pGrfObj->IsLinked()) { //set file link OUString linkedfilepath = pGrfObj->GetLinkedFilePath(); OUString fileURL = LwpTools::convertToFileUrl(OUStringToOString(linkedfilepath, osl_getThreadTextEncoding())); - pXFBGImage->SetFileLink(fileURL); + xXFBGImage->SetFileLink(fileURL); } else { std::vector<sal_uInt8> aGrafData = pGrfObj->GetRawGrafData(); - pXFBGImage->SetImageData(aGrafData.data(), aGrafData.size()); + xXFBGImage->SetImageData(aGrafData.data(), aGrafData.size()); } //automatic, top left - pXFBGImage->SetPosition(enumXFAlignStart,enumXFAlignTop); + xXFBGImage->SetPosition(enumXFAlignStart,enumXFAlignTop); if(pLay->GetScaleCenter()) { //center - pXFBGImage->SetPosition(); + xXFBGImage->SetPosition(); } else if(pLay->GetScaleTile()) { //tile - pXFBGImage->SetRepeate(); + xXFBGImage->SetRepeate(); } //fit type, area type if((pLay->GetScaleMode()& LwpLayoutScale::FIT_IN_FRAME)!=0) { if((pLay->GetScaleMode()& LwpLayoutScale::MAINTAIN_ASPECT_RATIO)==0) { - pXFBGImage->SetStretch(); + xXFBGImage->SetStretch(); } } - return pXFBGImage; + return xXFBGImage.release(); } } return nullptr; |