[Libreoffice-commits] core.git: 2 commits - vcl/unx xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue May 7 06:31:49 UTC 2019


 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    4 ++--
 xmloff/source/core/PropertySetMerger.cxx       |   20 ++------------------
 2 files changed, 4 insertions(+), 20 deletions(-)

New commits:
commit 024f3e05e5a0ccf189903caede2ace7ba3e6f3de
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon May 6 14:27:42 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue May 7 08:31:22 2019 +0200

    fix leak in FreetypeFontInfo::AnnounceFont
    
    the Add can fail, and this is a reference-counted type
    
    Change-Id: I9a6e7656a8c744222b4b10031cc6fd54e67c8ce0
    Reviewed-on: https://gerrit.libreoffice.org/71858
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 691b3f004f12..4e3a834e95c7 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -304,8 +304,8 @@ const unsigned char* FreetypeFontInfo::GetTable( const char* pTag, sal_uLong* pL
 
 void FreetypeFontInfo::AnnounceFont( PhysicalFontCollection* pFontCollection )
 {
-    FreetypeFontFace* pFD = new FreetypeFontFace( this, maDevFontAttributes );
-    pFontCollection->Add( pFD );
+    rtl::Reference<FreetypeFontFace> pFD(new FreetypeFontFace( this, maDevFontAttributes ));
+    pFontCollection->Add( pFD.get() );
 }
 
 void GlyphCache::InitFreetype()
commit 3484dff661d7418ecf4da48faac27ae64e01ec5f
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Mon May 6 10:08:52 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue May 7 08:31:10 2019 +0200

    Use comphelper::concatSequences to reduce copypaste
    
    Change-Id: I15aafc657680d476abdba621ec6c3288beafc55f
    Reviewed-on: https://gerrit.libreoffice.org/71847
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmloff/source/core/PropertySetMerger.cxx b/xmloff/source/core/PropertySetMerger.cxx
index b29cf4579dd7..ad059a2b95d1 100644
--- a/xmloff/source/core/PropertySetMerger.cxx
+++ b/xmloff/source/core/PropertySetMerger.cxx
@@ -25,6 +25,7 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::lang;
 
+#include <comphelper/sequence.hxx>
 #include <cppuhelper/implbase3.hxx>
 
 class PropertySetMergerImpl : public ::cppu::WeakAggImplHelper3< XPropertySet, XPropertyState, XPropertySetInfo >
@@ -200,26 +201,9 @@ Any SAL_CALL PropertySetMergerImpl::getPropertyDefault( const OUString& aPropert
 Sequence< Property > SAL_CALL PropertySetMergerImpl::getProperties()
 {
     Sequence< Property > aProps1( mxPropSet1Info->getProperties() );
-    const Property* pProps1 = aProps1.getArray();
-    const sal_Int32 nCount1 = aProps1.getLength();
-
     Sequence< Property > aProps2( mxPropSet1Info->getProperties() );
-    const Property* pProps2 = aProps2.getArray();
-    const sal_Int32 nCount2 = aProps2.getLength();
-
-    Sequence< Property > aProperties( nCount1 + nCount2 );
-
-    sal_Int32 nIndex;
-
-    Property* pProperties = aProperties.getArray();
-
-    for( nIndex = 0; nIndex < nCount1; nIndex++ )
-        *pProperties++ = *pProps1++;
-
-    for( nIndex = 0; nIndex < nCount2; nIndex++ )
-        *pProperties++ = *pProps2++;
 
-    return aProperties;
+    return comphelper::concatSequences(aProps1, aProps2);
 }
 
 Property SAL_CALL PropertySetMergerImpl::getPropertyByName( const OUString& aName )


More information about the Libreoffice-commits mailing list