[Libreoffice-commits] .: 2 commits - vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Jun 9 09:09:23 PDT 2011
vcl/source/gdi/outdev3.cxx | 20 +++++++++++++++-----
vcl/unx/generic/plugadapt/salplug.cxx | 4 ++--
2 files changed, 17 insertions(+), 7 deletions(-)
New commits:
commit 007f4c3951bb3cf4c7f23d349dd3dff2619dc3e3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 9 17:09:14 2011 +0100
stick a newlinea fter SalAbort message
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index 399dca5..de7a281 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -269,9 +269,9 @@ void DeInitSalMain()
void SalAbort( const XubString& rErrorText )
{
if( !rErrorText.Len() )
- std::fprintf( stderr, "Application Error" );
+ std::fprintf( stderr, "Application Error\n" );
else
- std::fprintf( stderr, "%s", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
+ std::fprintf( stderr, "%s\n", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
exit(-1);
}
commit a0a80f4628631fa53fda8c261a34d8140b937370
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 9 17:07:39 2011 +0100
survive 0 fonts until we get to no-fonts message
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index f30251d..60063d3 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 )
More information about the Libreoffice-commits
mailing list