[Libreoffice-commits] core.git: vcl/win

Marco Cecchetti marco.cecchetti at collabora.com
Thu Mar 31 11:42:42 UTC 2016


 vcl/win/gdi/salfont.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 9fa87bb1a42c45446f78b4d8c8096d7ce90a8022
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Wed Mar 30 19:41:57 2016 +0200

    tdf#98812: follow-up
    
    pFont->mpFontInstance can be NULL.
    
    Change-Id: I934703bc40621dc412e444cc9a370c7031cbbb86
    Reviewed-on: https://gerrit.libreoffice.org/23654
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 48a3c92..6819d21 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1458,7 +1458,12 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
     {
         GetWinFontEntry(nFallbackLevel)->mpFontCache->Release(GetWinFontEntry(nFallbackLevel));
     }
-    pFont->mpFontInstance->mpFontCache->Acquire(pFont->mpFontInstance);
+    // WinSalGraphics::GetEmbedFontData does not set mpFontInstance
+    // since it is interested in font file data only.
+    if (pFont->mpFontInstance)
+    {
+        pFont->mpFontInstance->mpFontCache->Acquire(pFont->mpFontInstance);
+    }
     mpWinFontEntry[ nFallbackLevel ] = reinterpret_cast<WinFontInstance*>( pFont->mpFontInstance );
     mpWinFontData[ nFallbackLevel ] = static_cast<const WinFontFace*>( pFont->mpFontData );
 


More information about the Libreoffice-commits mailing list