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

теперь работает как и подбор. Раньше тупо по папке

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@61295 954022d7-b5bf-4e40-9824-e11837661b57
parent 3d5a4ab5
#include "doctrenderer.h"
#ifdef BOOL
#undef BOOL
#endif
#include "nativecontrol.h"
#define _USE_LIBXML2_READER_
......@@ -421,6 +426,8 @@ namespace NSDoctRenderer
pNative->m_strFontsDirectory = m_oParams.m_strFontsDirectory;
pNative->m_strImagesDirectory = m_oParams.m_strImagesDirectory;
pNative->CheckFonts();
pNative->m_strEditorType = m_strEditorType;
pNative->SetFilePath(m_strFilePath);
......
......@@ -148,12 +148,16 @@ public:
#endif
}
void CheckSystemFonts()
void CheckFonts()
{
if (L"" == m_strFontsDirectory && 0 == m_map_fonts.size())
if (0 == m_map_fonts.size())
{
CApplicationFonts oApplication;
oApplication.Initialize();
if (m_strFontsDirectory == L"")
oApplication.Initialize();
else
oApplication.InitializeFromFolder(m_strFontsDirectory);
CArray<CFontInfo*>* pFonts = oApplication.GetList()->GetFonts();
int nCount = pFonts->GetCount();
......@@ -335,8 +339,9 @@ void _GetFontArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
}
else
{
std::map<std::wstring, std::wstring>::iterator pair = pNative->m_map_fonts.find(to_cstring(args[0]));
if (pair == pNative->m_map_fonts.end())
std::wstring sFind = to_cstring(args[0]);
std::map<std::wstring, std::wstring>::iterator pair = pNative->m_map_fonts.find(sFind);
if (pair != pNative->m_map_fonts.end())
strDir = pair->second;
else
strDir = pNative->m_sDefaultFont;
......
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