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

Default Font for GetByParams

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59338 954022d7-b5bf-4e40-9824-e11837661b57
parent 2425e5eb
......@@ -858,6 +858,29 @@ CArray<CFontInfo*> CFontList::GetAllByName(const std::wstring& strFontName)
}
return aRes;
}
void CFontList::SetDefaultFont(std::wstring& sName)
{
m_lDefIndex = -1;
int nStyleMin = 100;
for ( int nIndex = 0; nIndex < m_pList.GetCount(); ++nIndex )
{
CFontInfo* pInfo = m_pList[nIndex];
if (pInfo->m_wsFontName == sName)
{
int nStyle = 0;
if (pInfo->m_bBold)
nStyle |= 2;
if (pInfo->m_bItalic)
nStyle |= 1;
if (nStyle < nStyleMin)
{
m_lDefIndex = nIndex;
nStyleMin = nStyle;
}
}
}
}
void CFontList::LoadFromFolder(const std::wstring& strDirectory)
{
CArray<std::wstring> oArray = NSDirectory::GetFiles(strDirectory);
......
......@@ -181,6 +181,7 @@ public:
void Add(CFontInfo* pInfo);
CFontInfo* GetByParams(const CFontSelectFormat& oSelect);
CArray<CFontInfo*> GetAllByName(const std::wstring& strFontName);
void SetDefaultFont(std::wstring& sName);
};
class CApplicationFonts
......
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