[Libreoffice-commits] core.git: editeng/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Mon Jan 23 07:28:29 UTC 2017


 editeng/source/editeng/editobj.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dd891ec422fb35eada219ca7adddbd60d69f1fb7
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Sun Jan 22 13:23:57 2017 +0100

    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 at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 3f1f70f..3e3e8b7 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 ];


More information about the Libreoffice-commits mailing list