Commit af658e6f authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54444 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a673731
...@@ -1095,6 +1095,7 @@ void CFontList::Add(CFontInfo* pInfo) ...@@ -1095,6 +1095,7 @@ void CFontList::Add(CFontInfo* pInfo)
// ApplicationFonts // ApplicationFonts
CApplicationFonts::CApplicationFonts() CApplicationFonts::CApplicationFonts()
{ {
m_oCache.m_pApplicationFontStreams = &m_oStreams;
} }
CApplicationFonts::~CApplicationFonts() CApplicationFonts::~CApplicationFonts()
{ {
......
...@@ -150,6 +150,7 @@ CFontManager::CFontManager() ...@@ -150,6 +150,7 @@ CFontManager::CFontManager()
m_pFont = NULL; m_pFont = NULL;
m_pApplication = NULL; m_pApplication = NULL;
m_pOwnerCache = NULL;
m_bStringGID = FALSE; m_bStringGID = FALSE;
m_nLOAD_MODE = 40968; m_nLOAD_MODE = 40968;
...@@ -170,6 +171,11 @@ CFontManager::~CFontManager() ...@@ -170,6 +171,11 @@ CFontManager::~CFontManager()
{ {
FT_Done_FreeType(m_pLibrary); FT_Done_FreeType(m_pLibrary);
} }
RELEASEOBJECT(m_pOwnerCache);
}
void CFontManager::SetOwnerCache(CFontsCache* pCache)
{
m_pOwnerCache = pCache;
} }
void CFontManager::AfterLoad() void CFontManager::AfterLoad()
...@@ -475,7 +481,7 @@ BOOL CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceI ...@@ -475,7 +481,7 @@ BOOL CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceI
if (NULL == m_pApplication) if (NULL == m_pApplication)
return FALSE; return FALSE;
CFontsCache* pCache = m_pApplication->GetCache(); CFontsCache* pCache = (m_pOwnerCache != NULL) ? m_pOwnerCache : m_pApplication->GetCache();
m_pFont = pCache->LockFont(m_pLibrary, sPath, lFaceIndex, dSize); m_pFont = pCache->LockFont(m_pLibrary, sPath, lFaceIndex, dSize);
m_pFont->m_pFontManager = this; m_pFont->m_pFontManager = this;
......
...@@ -79,6 +79,7 @@ public: ...@@ -79,6 +79,7 @@ public:
int m_nLOAD_MODE; int m_nLOAD_MODE;
CApplicationFonts* m_pApplication; CApplicationFonts* m_pApplication;
CFontsCache* m_pOwnerCache;
public: public:
CFontManager(); CFontManager();
...@@ -88,6 +89,8 @@ public: ...@@ -88,6 +89,8 @@ public:
void AfterLoad(); void AfterLoad();
void Initialize(); void Initialize();
void SetOwnerCache(CFontsCache* pCache);
double UpdateSize(const double& dOldSize, const double& dDpi, const double& dNewDpi); double UpdateSize(const double& dOldSize, const double& dDpi, const double& dNewDpi);
BOOL LoadString(const std::wstring& wsBuffer, const float& fX, const float& fY); BOOL LoadString(const std::wstring& wsBuffer, const float& fX, const float& fY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment