summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-03-30 19:41:57 +0200
committerMichael Stahl <mstahl@redhat.com>2016-03-31 13:43:27 +0200
commit4ab36bbd1816d6f297892a638e6826f28ca87150 (patch)
treec685f71b651e902562bd5c20bea4a6599f43e2bc /vcl
parent4ae7ec8c8d22e751b868459e1f51fcecc37dd6b1 (diff)
tdf#98812: follow-up
pFont->mpFontInstance can be NULL. Reviewed-on: https://gerrit.libreoffice.org/23654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 9fa87bb1a42c45446f78b4d8c8096d7ce90a8022) Signed-off-by: Michael Stahl <mstahl@redhat.com> Change-Id: I934703bc40621dc412e444cc9a370c7031cbbb86
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index b1f865dcf886..964f25fb25a1 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1548,7 +1548,12 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
{
GetWinFontEntry(nFallbackLevel)->m_pFontCache->Release(GetWinFontEntry(nFallbackLevel));
}
- pFont->mpFontEntry->m_pFontCache->Acquire(pFont->mpFontEntry);
+ // WinSalGraphics::GetEmbedFontData does not set mpFontInstance/mpFontEntry
+ // since it is interested in font file data only.
+ if (pFont->mpFontEntry)
+ {
+ pFont->mpFontEntry->m_pFontCache->Acquire(pFont->mpFontEntry);
+ }
mpWinFontEntry[ nFallbackLevel ] = reinterpret_cast<ImplWinFontEntry*>( pFont->mpFontEntry );
mpWinFontData[ nFallbackLevel ] = static_cast<const ImplWinFontData*>( pFont->mpFontData );