summaryrefslogtreecommitdiff
path: root/psprint
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-04-11 16:17:21 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-04-11 16:17:21 +0000
commit418765e43f639c85759a84c70e94811dc2c8e2d0 (patch)
tree35fe3e5ee78aa1524212dc3ecf9fe0fefc717fd4 /psprint
parente1b04ba701d1b7f59be0550cf675b40da895ecd2 (diff)
INTEGRATION: CWS vcl07 (1.1.40); FILE MERGED
2003/04/04 14:41:59 pl 1.1.40.3: #i12889# cache directories with no fonts 2003/04/02 20:30:36 pl 1.1.40.2: #i12889# better font import 2003/04/01 08:06:39 pl 1.1.40.1: #i12889# more aggressive caching
Diffstat (limited to 'psprint')
-rw-r--r--psprint/inc/psprint/fontcache.hxx41
1 files changed, 35 insertions, 6 deletions
diff --git a/psprint/inc/psprint/fontcache.hxx b/psprint/inc/psprint/fontcache.hxx
index 9edc21527bc5..b123a24b1b14 100644
--- a/psprint/inc/psprint/fontcache.hxx
+++ b/psprint/inc/psprint/fontcache.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fontcache.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: pl $ $Date: 2002-02-28 11:49:51 $
+ * last change: $Author: vg $ $Date: 2003-04-11 17:17:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,9 +73,29 @@ namespace psp
class FontCache
{
- typedef ::std::list< PrintFontManager::PrintFont* > FontCacheEntry;
- typedef ::std::hash_map< ::rtl::OString, FontCacheEntry, ::rtl::OStringHash > FontDirMap;
- typedef ::std::hash_map< int, FontDirMap > FontCacheData;
+ struct FontDir;
+ friend class FontDir;
+ struct FontFile;
+ friend class FontFile;
+
+ typedef std::list< PrintFontManager::PrintFont* > FontCacheEntry;
+ struct FontFile
+ {
+ sal_Int64 m_nTimestamp;
+ FontCacheEntry m_aEntry;
+ };
+
+ typedef std::hash_map< ::rtl::OString, FontFile, ::rtl::OStringHash > FontDirMap;
+ struct FontDir
+ {
+ sal_Int64 m_nTimestamp;
+ bool m_bNoFiles;
+ FontDirMap m_aEntries;
+
+ FontDir() : m_nTimestamp(0), m_bNoFiles(false) {}
+ };
+
+ typedef std::hash_map< int, FontDir > FontCacheData;
FontCacheData m_aCache;
bool m_bDoFlush;
@@ -84,14 +104,23 @@ class FontCache
void copyPrintFont( const PrintFontManager::PrintFont* pFrom, PrintFontManager::PrintFont* pTo ) const;
PrintFontManager::PrintFont* clonePrintFont( const PrintFontManager::PrintFont* pFont ) const;
+
+ void createCacheDir( int nDirID );
public:
FontCache();
~FontCache();
- bool getFontCacheFile( int nDirID, const ::rtl::OString& rDir, const ::rtl::OString& rFile, ::std::list< PrintFontManager::PrintFont* >& rNewFonts );
+ bool getFontCacheFile( int nDirID, const rtl::OString& rDir, const rtl::OString& rFile, std::list< PrintFontManager::PrintFont* >& rNewFonts ) const;
void updateFontCacheEntry( const PrintFontManager::PrintFont*, bool bFlush );
+ void markEmptyDir( int nDirID, bool bNoFiles = true );
+
+ // returns false for non cached directory
+ // a cached but empty directory will return true but not append anything
+ bool listDirectory( const rtl::OString& rDir, std::list< PrintFontManager::PrintFont* >& rNewFonts ) const;
void flush();
+
+ void updateDirTimestamp( int nDirID );
};
} // namespace psp