diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-11 11:57:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-11 14:13:32 +0000 |
commit | 6b5eacd10dde8fc5e68c64b532c441c2888b1b4e (patch) | |
tree | 01449ed811f478eca0f910786fd2bbff34e57133 /vcl/generic/fontmanager | |
parent | 6eddd1b54cb6fc21cdc6883eee708d1247d15f9d (diff) |
align m_nCollectionEntry with getFontFaceNumber and FC_FACE, bump cache magic
Diffstat (limited to 'vcl/generic/fontmanager')
-rw-r--r-- | vcl/generic/fontmanager/fontcache.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx index cbad197a19f5..9c71963f0794 100644 --- a/vcl/generic/fontmanager/fontcache.cxx +++ b/vcl/generic/fontmanager/fontcache.cxx @@ -48,7 +48,7 @@ #endif #define FONTCACHEFILE "/user/psprint/pspfontcache" -#define CACHE_MAGIC "PspFontCacheFile format 4" +#define CACHE_MAGIC "LibreOffice PspFontCacheFile format 5" using namespace std; using namespace psp; @@ -170,7 +170,7 @@ void FontCache::flush() if( nEntrySize > 1 ) nSubEntry = static_cast<const PrintFontManager::TrueTypeFontFile*>(*it)->m_nCollectionEntry; else - nSubEntry = -1; + nSubEntry = 0; aLine.append(OUStringToOString(pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName), RTL_TEXTENCODING_UTF8)); for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it ) diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index e99044e62c11..09e64c9358dc 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -392,7 +392,7 @@ PrintFontManager::Type1FontFile::~Type1FontFile() PrintFontManager::TrueTypeFontFile::TrueTypeFontFile() : PrintFont( fonttype::TrueType ) , m_nDirectory( 0 ) -, m_nCollectionEntry(-1) +, m_nCollectionEntry( 0 ) , m_nTypeFlags( TYPEFLAG_INVALID ) {} @@ -432,7 +432,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr TrueTypeFont* pTTFont = NULL; - if( OpenTTFontFile( aFile.GetBuffer(), m_nCollectionEntry < 0 ? 0 : m_nCollectionEntry, &pTTFont ) == SF_OK ) + if( OpenTTFontFile( aFile.GetBuffer(), m_nCollectionEntry, &pTTFont ) == SF_OK ) { if( ! m_pMetrics ) { @@ -1422,7 +1422,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co TrueTypeFontFile* pFont = new TrueTypeFontFile(); pFont->m_nDirectory = nDirID; pFont->m_aFontFile = rFontFile; - pFont->m_nCollectionEntry = -1; + pFont->m_nCollectionEntry = 0; if( rXLFDs.size() ) getFontAttributesFromXLFD( pFont, rXLFDs ); @@ -1963,7 +1963,7 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const TrueTypeFont* pTTFont = NULL; TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont); - if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) + if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) { TTGlobalFontInfo aInfo; GetTTGlobalFontInfo( pTTFont, & aInfo ); @@ -3076,7 +3076,7 @@ bool PrintFontManager::isFontDownloadingAllowed( fontID nFont ) const { TrueTypeFont* pTTFont = NULL; ByteString aFile = getFontFile( pFont ); - if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) + if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) { // get type flags TTGlobalFontInfo aInfo; @@ -3511,7 +3511,7 @@ bool PrintFontManager::getAlternativeFamilyNames( fontID nFont, ::std::list< OUS TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont); ByteString aFile( getFontFile( pFont ) ); TrueTypeFont* pTTFont; - if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) + if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK ) { NameRecord* pNameRecords = NULL; int nNameRecords = GetTTNameRecords( pTTFont, &pNameRecords ); @@ -3602,7 +3602,7 @@ bool PrintFontManager::createFontSubset( TrueTypeFont* pTTFont = NULL; // TODO: rename to SfntFont TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont); - if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK ) + if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK ) return false; // prepare system name for write access for subset file target @@ -3696,7 +3696,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont, TrueTypeFont* pTTFont = NULL; TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont); ByteString aFromFile = getFontFile( pFont ); - if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK ) + if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK ) return; int nGlyphs = GetTTGlyphCount( pTTFont ); if( nGlyphs > 0 ) |