| Index: xfa/fgas/font/fgas_stdfontmgr.cpp
|
| diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
|
| index 2b403e8ee89ae547382a842ce21a9ba35bc8f1d9..a106d0b1ab770ffebb4036fb9c2c7ef776664fff 100644
|
| --- a/xfa/fgas/font/fgas_stdfontmgr.cpp
|
| +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
|
| @@ -11,16 +11,11 @@
|
| #include "xfa/fgas/font/fgas_fontutils.h"
|
|
|
| #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
|
| -IFX_FontMgr* IFX_FontMgr::Create(FX_LPEnumAllFonts pEnumerator,
|
| - FX_LPMatchFont pMatcher,
|
| - void* pUserData) {
|
| - return new CFX_StdFontMgrImp(pEnumerator, pMatcher, pUserData);
|
| -}
|
| -CFX_StdFontMgrImp::CFX_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator,
|
| - FX_LPMatchFont pMatcher,
|
| - void* pUserData)
|
| - : m_pMatcher(pMatcher),
|
| - m_pEnumerator(pEnumerator),
|
| +IFX_FontMgr* IFX_FontMgr::Create(FX_LPEnumAllFonts pEnumerator) {
|
| + return new CFX_StdFontMgrImp(pEnumerator);
|
| +}
|
| +CFX_StdFontMgrImp::CFX_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator)
|
| + : m_pEnumerator(pEnumerator),
|
| m_FontFaces(),
|
| m_Fonts(),
|
| m_CPFonts(8),
|
| @@ -29,16 +24,12 @@ CFX_StdFontMgrImp::CFX_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator,
|
| m_BufferFonts(4),
|
| m_FileFonts(4),
|
| m_StreamFonts(4),
|
| - m_DeriveFonts(4),
|
| - m_pUserData(pUserData) {
|
| + m_DeriveFonts(4) {
|
| if (m_pEnumerator != NULL) {
|
| m_pEnumerator(m_FontFaces, m_pUserData, NULL, 0xFEFF);
|
| }
|
| - if (m_pMatcher == NULL) {
|
| - m_pMatcher = FX_DefFontMatcher;
|
| - }
|
| - FXSYS_assert(m_pMatcher != NULL);
|
| }
|
| +
|
| CFX_StdFontMgrImp::~CFX_StdFontMgrImp() {
|
| m_FontFaces.RemoveAll();
|
| m_CPFonts.RemoveAll();
|
| @@ -302,9 +293,6 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily,
|
| uint16_t wCodePage,
|
| uint32_t dwUSB,
|
| FX_WCHAR wUnicode) {
|
| - if (m_pMatcher == NULL) {
|
| - return NULL;
|
| - }
|
| FX_FONTMATCHPARAMS params;
|
| FXSYS_memset(¶ms, 0, sizeof(params));
|
| params.dwUSB = dwUSB;
|
| @@ -313,7 +301,8 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily,
|
| params.pwsFamily = pszFontFamily;
|
| params.dwFontStyles = dwFontStyles;
|
| params.dwMatchFlags = dwMatchFlags;
|
| - FX_LPCFONTDESCRIPTOR pDesc = m_pMatcher(¶ms, m_FontFaces, m_pUserData);
|
| + FX_LPCFONTDESCRIPTOR pDesc =
|
| + FX_DefFontMatcher(¶ms, m_FontFaces, m_pUserData);
|
| if (pDesc) {
|
| return pDesc;
|
| }
|
| @@ -321,7 +310,7 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(const FX_WCHAR* pszFontFamily,
|
| CFX_FontDescriptors namedFonts;
|
| m_pEnumerator(namedFonts, m_pUserData, pszFontFamily, wUnicode);
|
| params.pwsFamily = NULL;
|
| - pDesc = m_pMatcher(¶ms, namedFonts, m_pUserData);
|
| + pDesc = FX_DefFontMatcher(¶ms, namedFonts, m_pUserData);
|
| if (pDesc == NULL) {
|
| return NULL;
|
| }
|
| @@ -570,26 +559,19 @@ IFX_FileAccess* CFX_FontSourceEnum_File::GetNext(FX_POSITION& pos,
|
| IFX_FontSourceEnum* FX_CreateDefaultFontSourceEnum() {
|
| return (IFX_FontSourceEnum*)new CFX_FontSourceEnum_File;
|
| }
|
| -IFX_FontMgr* IFX_FontMgr::Create(IFX_FontSourceEnum* pFontEnum,
|
| - IFX_FontMgrDelegate* pDelegate,
|
| - void* pUserData) {
|
| +IFX_FontMgr* IFX_FontMgr::Create(IFX_FontSourceEnum* pFontEnum) {
|
| if (NULL == pFontEnum) {
|
| return NULL;
|
| }
|
| - CFX_FontMgrImp* pFontMgr =
|
| - new CFX_FontMgrImp(pFontEnum, pDelegate, pUserData);
|
| + CFX_FontMgrImp* pFontMgr = new CFX_FontMgrImp(pFontEnum);
|
| if (pFontMgr->EnumFonts()) {
|
| return pFontMgr;
|
| }
|
| delete pFontMgr;
|
| return NULL;
|
| }
|
| -CFX_FontMgrImp::CFX_FontMgrImp(IFX_FontSourceEnum* pFontEnum,
|
| - IFX_FontMgrDelegate* pDelegate,
|
| - void* pUserData)
|
| - : m_pFontSource(pFontEnum),
|
| - m_pDelegate(pDelegate),
|
| - m_pUserData(pUserData) {}
|
| +CFX_FontMgrImp::CFX_FontMgrImp(IFX_FontSourceEnum* pFontEnum)
|
| + : m_pFontSource(pFontEnum) {}
|
|
|
| FX_BOOL CFX_FontMgrImp::EnumFontsFromFontMapper() {
|
| CFX_FontMapper* pFontMapper =
|
| @@ -692,30 +674,22 @@ void CFX_FontMgrImp::Release() {
|
| IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage(uint16_t wCodePage,
|
| uint32_t dwFontStyles,
|
| const FX_WCHAR* pszFontFamily) {
|
| - return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage(
|
| - this, wCodePage, dwFontStyles,
|
| - pszFontFamily);
|
| + return nullptr;
|
| }
|
| IFX_Font* CFX_FontMgrImp::GetDefFontByCharset(uint8_t nCharset,
|
| uint32_t dwFontStyles,
|
| const FX_WCHAR* pszFontFamily) {
|
| - return NULL == m_pDelegate ? NULL
|
| - : m_pDelegate->GetDefFontByCharset(
|
| - this, nCharset, dwFontStyles, pszFontFamily);
|
| + return nullptr;
|
| }
|
| IFX_Font* CFX_FontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode,
|
| uint32_t dwFontStyles,
|
| const FX_WCHAR* pszFontFamily) {
|
| - return NULL == m_pDelegate ? NULL
|
| - : m_pDelegate->GetDefFontByUnicode(
|
| - this, wUnicode, dwFontStyles, pszFontFamily);
|
| + return nullptr;
|
| }
|
| IFX_Font* CFX_FontMgrImp::GetDefFontByLanguage(uint16_t wLanguage,
|
| uint32_t dwFontStyles,
|
| const FX_WCHAR* pszFontFamily) {
|
| - return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByLanguage(
|
| - this, wLanguage, dwFontStyles,
|
| - pszFontFamily);
|
| + return nullptr;
|
| }
|
| IFX_Font* CFX_FontMgrImp::GetFontByCodePage(uint16_t wCodePage,
|
| uint32_t dwFontStyles,
|
|
|