diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-01-22 13:23:57 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 07:27:58 +0000 |
commit | dd891ec422fb35eada219ca7adddbd60d69f1fb7 (patch) | |
tree | 37d92c4912c16c0e81f19784a538ee03e6fc33d8 /editeng/source | |
parent | 38f9082771b7842d056a04965bffd57cb655a558 (diff) |
cppcheck: memleak (false positive)
but manage ownership from start
Change-Id: Ia9d29cc0e0676173c231c8b68b7681cc1b3dff86
Reviewed-on: https://gerrit.libreoffice.org/33392
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 3f1f70f5c681..3e3e8b7d3ec3 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1404,11 +1404,11 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) ); // Replace the existing attribute with a new one. - XEditAttribute* pNewAttr = CreateAttrib(aNewFontItem, rAttr.GetStart(), rAttr.GetEnd()); - + pC->maCharAttribs[nAttr] = + std::unique_ptr<XEditAttribute>(CreateAttrib(aNewFontItem, rAttr.GetStart(), rAttr.GetEnd())); pPool->Remove(*rAttr.GetItem()); - pC->maCharAttribs[nAttr] = std::unique_ptr<XEditAttribute>(pNewAttr); + XEditAttribute* pNewAttr = pC->maCharAttribs[nAttr].get(); for ( sal_uInt16 nChar = pNewAttr->GetStart(); nChar < pNewAttr->GetEnd(); nChar++ ) { sal_Unicode cOld = pC->GetText()[ nChar ]; |