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

CloseFont

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62504 954022d7-b5bf-4e40-9824-e11837661b57
parent 4fcc2101
...@@ -629,6 +629,13 @@ INT CFontManager::LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPa ...@@ -629,6 +629,13 @@ INT CFontManager::LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPa
return TRUE; return TRUE;
} }
void CFontManager::CloseFont()
{
this->m_pFont->ClearCache();
this->m_pFont = NULL;
}
std::wstring CFontManager::GetFontType() const std::wstring CFontManager::GetFontType() const
{ {
if (!m_pFont) if (!m_pFont)
......
...@@ -58,12 +58,17 @@ public: ...@@ -58,12 +58,17 @@ public:
m_pApplicationFontStreams = NULL; m_pApplicationFontStreams = NULL;
} }
~CFontsCache() ~CFontsCache()
{
Clear();
}
void Clear()
{ {
for (std::map<std::string, CFontFile*>::iterator iter = m_mapFiles.begin(); iter != m_mapFiles.end(); ++iter) for (std::map<std::string, CFontFile*>::iterator iter = m_mapFiles.begin(); iter != m_mapFiles.end(); ++iter)
{ {
CFontFile* pFile = iter->second; CFontFile* pFile = iter->second;
RELEASEOBJECT(pFile); RELEASEOBJECT(pFile);
} }
m_mapFiles.clear();
} }
public: public:
...@@ -142,6 +147,7 @@ public: ...@@ -142,6 +147,7 @@ public:
INT LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY); INT LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY);
INT LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY); INT LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
INT LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY); INT LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
void CloseFont();
std::wstring GetFontType() const; std::wstring GetFontType() const;
unsigned int GetNameIndex(const std::wstring& wsName) const; unsigned int GetNameIndex(const std::wstring& wsName) const;
......
...@@ -214,6 +214,15 @@ public: ...@@ -214,6 +214,15 @@ public:
_SetFont(); _SetFont();
} }
public:
void CloseFont()
{
if (NULL != m_pFontManager)
m_pFontManager->CloseFont();
m_oInstalledFont.SetDefaultParams();
m_oInstalledFont.Name = L"";
}
protected: protected:
void _SetFont(); void _SetFont();
void ApplyTransform(const double& d1, const double& d2, const double& d3, const double& d4, const double& d5, const double& d6); void ApplyTransform(const double& d1, const double& d2, const double& d3, const double& d4, const double& d5, const double& d6);
......
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