vcl/inc/unx/fontmanager.hxx                    |    2 +-
 vcl/unx/generic/fontmanager/fontconfig.cxx     |    6 +++---
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 7047f46695689564b1a69679e3a4e5a8c20aa3a3
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 27 09:27:17 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Mar 27 10:54:37 2019 +0100

    return by unique_ptr from psp::PrintFontManager::getFontOptions
    
    Change-Id: Ib78844af17ff60453ad714eb50c01626ea2ee792
    Reviewed-on: https://gerrit.libreoffice.org/69792
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index d796aba7e944..0ce8ff437c69 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -312,7 +312,7 @@ public:
     in different fonts in e.g. english and japanese
      */
     void matchFont( FastPrintFontInfo& rInfo, const css::lang::Locale& rLocale 
);
-    static FontConfigFontOptions* getFontOptions( const FastPrintFontInfo&, 
int nSize);
+    static std::unique_ptr<FontConfigFontOptions> getFontOptions( const 
FastPrintFontInfo&, int nSize);
 
     void Substitute(FontSelectPattern &rPattern, OUString& rMissingCodes);
 
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 003e163d8777..2cb1aee919d9 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -1092,11 +1092,11 @@ void FontConfigFontOptions::SyncPattern(const OString& 
rFileName, sal_uInt32 nIn
     FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse);
 }
 
-FontConfigFontOptions* PrintFontManager::getFontOptions(const 
FastPrintFontInfo& rInfo, int nSize)
+std::unique_ptr<FontConfigFontOptions> PrintFontManager::getFontOptions(const 
FastPrintFontInfo& rInfo, int nSize)
 {
     FontCfgWrapper& rWrapper = FontCfgWrapper::get();
 
-    FontConfigFontOptions* pOptions = nullptr;
+    std::unique_ptr<FontConfigFontOptions> pOptions;
     FcConfig* pConfig = FcConfigGetCurrent();
     FcPattern* pPattern = FcPatternCreate();
 
@@ -1125,7 +1125,7 @@ FontConfigFontOptions* 
PrintFontManager::getFontOptions(const FastPrintFontInfo&
         (void) FcPatternGetInteger(pResult,
             FC_HINT_STYLE, 0, &hintstyle);
 
-        pOptions = new FontConfigFontOptions(pResult);
+        pOptions.reset(new FontConfigFontOptions(pResult));
     }
 
     // cleanup
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx 
b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 42eff115aaee..691b3f004f12 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -465,7 +465,7 @@ FreetypeFont::FreetypeFont(LogicalFontInstance* 
pFontInstance, FreetypeFontInfo*
 
 namespace
 {
-    FontConfigFontOptions* GetFCFontOptions( const FontAttributes& 
rFontAttributes, int nSize)
+    std::unique_ptr<FontConfigFontOptions> GetFCFontOptions( const 
FontAttributes& rFontAttributes, int nSize)
     {
         psp::FastPrintFontInfo aInfo;
 
@@ -482,7 +482,7 @@ const FontConfigFontOptions* FreetypeFont::GetFontOptions() 
const
 {
     if (!mxFontOptions)
     {
-        mxFontOptions.reset(GetFCFontOptions(mpFontInfo->GetFontAttributes(), 
mpFontInstance->GetFontSelectPattern().mnHeight));
+        mxFontOptions = GetFCFontOptions(mpFontInfo->GetFontAttributes(), 
mpFontInstance->GetFontSelectPattern().mnHeight);
         mxFontOptions->SyncPattern(GetFontFileName(), GetFontFaceIndex(), 
GetFontFaceVariation(), NeedsArtificialBold());
     }
     return mxFontOptions.get();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to