From 40d522134a11867adb95f77c0b7891932e0739a2 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 16 Nov 2017 21:41:47 +0000 Subject: Refactor CFGAS_FontMgr's Windows implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL unifies a bit the public methods of CFGAS_FontMgr. It does so by replacing the multiple maps on the Windows implementation to a single map from hash to font. Also, cloning CFX_Fonts is avoided with the use of SetLogicalFontStyle. These Windows changes are just mimicking other OS's. As a side-effect, some members of CFX_Fonts are now owned so the raw pointers are replaced with unique_ptrs. Change-Id: I576d438572ccbe6c48f8f5cc434d66fc6adba372 Reviewed-on: https://pdfium-review.googlesource.com/18131 Reviewed-by: dsinclair Commit-Queue: Nicolás Peña Moreno --- xfa/fgas/font/cfgas_gefont.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'xfa/fgas/font/cfgas_gefont.h') diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index 2e63ee5367..d14554758b 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -54,18 +54,13 @@ class CFGAS_GEFont : public Retainable { m_pProvider.Reset(pProvider); } -#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ - RetainPtr Derive(uint32_t dwFontStyles, uint16_t wCodePage); -#else // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ void SetLogicalFontStyle(uint32_t dwLogFontStyle) { m_bUseLogFontStyle = true; m_dwLogFontStyle = dwLogFontStyle; } -#endif // _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ private: explicit CFGAS_GEFont(CFGAS_FontMgr* pFontMgr); - CFGAS_GEFont(const RetainPtr& src, uint32_t dwFontStyles); ~CFGAS_GEFont() override; #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ @@ -84,10 +79,8 @@ class CFGAS_GEFont : public Retainable { bool bRecursive); WideString GetFamilyName() const; -#if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ bool m_bUseLogFontStyle; uint32_t m_dwLogFontStyle; -#endif CFX_Font* m_pFont; bool m_bExternalFont; RetainPtr m_pSrcFont; // Only set by ctor, so no cycles. -- cgit v1.2.3