diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-16 17:57:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-16 17:57:57 +0000 |
commit | 818632b0bb2f94bfba4acb518b6e08d20eda4b17 (patch) | |
tree | 62ec9d304d1e41454073e95b78382f63a855b976 /xfa/fgas/font | |
parent | fcc9eb3a7c60fab1205ab5b6fb4fcccb1efb3892 (diff) | |
download | pdfium-818632b0bb2f94bfba4acb518b6e08d20eda4b17.tar.xz |
m_pEnumerator only ever has one value, indirection not needed.
Change-Id: Ic1d63e8ef54a820b01d67dbf1dd6f6f72a06b77c
Reviewed-on: https://pdfium-review.googlesource.com/26990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/font')
-rw-r--r-- | xfa/fgas/font/cfgas_fontmgr.cpp | 11 | ||||
-rw-r--r-- | xfa/fgas/font/cfgas_fontmgr.h | 5 |
2 files changed, 5 insertions, 11 deletions
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index 99120a0d51..4df9863692 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -200,12 +200,11 @@ void EnumGdiFonts(std::deque<FX_FONTDESCRIPTOR>* fonts, } // namespace -CFGAS_FontMgr::CFGAS_FontMgr() : m_pEnumerator(EnumGdiFonts), m_FontFaces(100) { - if (m_pEnumerator) - m_pEnumerator(&m_FontFaces, nullptr, 0xFEFF); +CFGAS_FontMgr::CFGAS_FontMgr() : m_FontFaces(100) { + EnumGdiFonts(&m_FontFaces, nullptr, 0xFEFF); } -CFGAS_FontMgr::~CFGAS_FontMgr() {} +CFGAS_FontMgr::~CFGAS_FontMgr() = default; bool CFGAS_FontMgr::EnumFonts() { return true; @@ -229,11 +228,11 @@ const FX_FONTDESCRIPTOR* CFGAS_FontMgr::FindFont(const wchar_t* pszFontFamily, if (pDesc) return pDesc; - if (!pszFontFamily || !m_pEnumerator) + if (!pszFontFamily) return nullptr; std::deque<FX_FONTDESCRIPTOR> namedFonts; - m_pEnumerator(&namedFonts, pszFontFamily, wUnicode); + EnumGdiFonts(&namedFonts, pszFontFamily, wUnicode); params.pwsFamily = nullptr; pDesc = MatchDefaultFont(¶ms, namedFonts); if (!pDesc) diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 445b318a26..210b5643bb 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -63,10 +63,6 @@ inline bool operator==(const FX_FONTDESCRIPTOR& left, wcscmp(left.wsFontFace, right.wsFontFace) == 0; } -typedef void (*FX_LPEnumAllFonts)(std::deque<FX_FONTDESCRIPTOR>* fonts, - const wchar_t* pwsFaceName, - wchar_t wUnicode); - #else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ class CFX_FontDescriptor { @@ -153,7 +149,6 @@ class CFGAS_FontMgr : public Observable<CFGAS_FontMgr> { uint32_t dwUSB, wchar_t wUnicode); - FX_LPEnumAllFonts m_pEnumerator; std::deque<FX_FONTDESCRIPTOR> m_FontFaces; #else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ bool EnumFontsFromFontMapper(); |