diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-09 17:07:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-09 17:07:39 +0100 |
commit | b29cc3d07dbc274cfd7d7db6d6b43751d4859d48 (patch) | |
tree | c59fb25a8a896477d2eb6fcd6fdd4793877056ee /vcl | |
parent | 440eaa7f44a24d52f2dda543fafd6ec30a71acb6 (diff) |
survive 0 fonts until we get to no-fonts message
Diffstat (limited to 'vcl')
-rwxr-xr-x | vcl/source/gdi/outdev3.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index aba8a3a77b4d..5393bafb38e6 100755 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -646,10 +646,13 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang, // get the name of the first available font float fExactHeight = static_cast<float>(aSize.Height()); ImplFontEntry* pEntry = pOutDev->mpFontCache->GetFontEntry( pOutDev->mpFontList, aFont, aSize, fExactHeight, pOutDev->mpOutDevData ? &pOutDev->mpOutDevData->maDevFontSubst : NULL ); - if( pEntry->maFontSelData.mpFontData ) - aFont.SetName( pEntry->maFontSelData.mpFontData->maName ); - else - aFont.SetName( pEntry->maFontSelData.maTargetName ); + if (pEntry) + { + if( pEntry->maFontSelData.mpFontData ) + aFont.SetName( pEntry->maFontSelData.mpFontData->maName ); + else + aFont.SetName( pEntry->maFontSelData.maTargetName ); + } } } else @@ -2401,7 +2404,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList, if( !pEntry->mnRefCount++ ) --mnRef0Count; } - else // no cache hit => create a new font instance + else if (pFontFamily)// no cache hit => create a new font instance { // find the best matching physical font face ImplFontData* pFontData = pFontFamily->FindBestFontFace( aFontSelData ); @@ -2952,6 +2955,9 @@ void OutputDevice::ImplInitFont() const { DBG_TESTSOLARMUTEX(); + if (!mpFontEntry) + return; + if ( mbInitFont ) { if ( meOutDevType != OUTDEV_PRINTER ) @@ -3038,6 +3044,10 @@ bool OutputDevice::ImplNewFont() const mpFontCache->Release( pOldEntry ); ImplFontEntry* pFontEntry = mpFontEntry; + + if (!pFontEntry) + return false; + // mark when lower layers need to get involved mbNewFont = sal_False; if( pFontEntry != pOldEntry ) |