From 74d2389d206da5638b642ca8084e140cfbf04c92 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Sat, 11 Aug 2018 05:37:28 +0000 Subject: Initialize CPDF_CIDFont members. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given POD members default values, rather than hoping Load() will. Also reorder members to pack better. Change-Id: I493db11eb3d115e49f4e914e53a1eb55fa2046f0 Reviewed-on: https://pdfium-review.googlesource.com/39495 Commit-Queue: Lei Zhang Reviewed-by: Nicolás Peña Moreno --- core/fpdfapi/font/cpdf_cidfont.cpp | 5 ----- core/fpdfapi/font/cpdf_cidfont.h | 16 ++++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp index cf2102cd8a..d38154331a 100644 --- a/core/fpdfapi/font/cpdf_cidfont.cpp +++ b/core/fpdfapi/font/cpdf_cidfont.cpp @@ -417,9 +417,6 @@ bool CPDF_CIDFont::Load() { if (pDefaultArray) { m_DefaultVY = pDefaultArray->GetIntegerAt(0); m_DefaultW1 = pDefaultArray->GetIntegerAt(1); - } else { - m_DefaultVY = 880; - m_DefaultW1 = -1000; } } return true; @@ -829,7 +826,6 @@ void CPDF_CIDFont::LoadGB2312() { LoadFontDescriptor(pFontDesc); m_Charset = CIDSET_GB1; - m_bType1 = false; CPDF_CMapManager* manager = GetFontGlobals()->GetCMapManager(); m_pCMap = manager->GetPredefinedCMap("GBK-EUC-H", false); @@ -838,7 +834,6 @@ void CPDF_CIDFont::LoadGB2312() { LoadSubstFont(); CheckFontMetrics(); - m_DefaultWidth = 1000; m_bAnsiWidthsFixed = true; } diff --git a/core/fpdfapi/font/cpdf_cidfont.h b/core/fpdfapi/font/cpdf_cidfont.h index ab074fb6f0..9dde95d75e 100644 --- a/core/fpdfapi/font/cpdf_cidfont.h +++ b/core/fpdfapi/font/cpdf_cidfont.h @@ -74,18 +74,18 @@ class CPDF_CIDFont : public CPDF_Font { RetainPtr m_pCMap; UnownedPtr m_pCID2UnicodeMap; - CIDSet m_Charset; - bool m_bType1; - bool m_bCIDIsGID = false; - uint16_t m_DefaultWidth; RetainPtr m_pStreamAcc; + std::unique_ptr m_pTTGSUBTable; + bool m_bType1 = false; + bool m_bCIDIsGID = false; bool m_bAnsiWidthsFixed = false; + bool m_bAdobeCourierStd = false; + CIDSet m_Charset = CIDSET_UNKNOWN; + uint16_t m_DefaultWidth = 1000; + short m_DefaultVY = 880; + short m_DefaultW1 = -1000; std::vector m_WidthList; - short m_DefaultVY; - short m_DefaultW1; std::vector m_VertMetrics; - bool m_bAdobeCourierStd = false; - std::unique_ptr m_pTTGSUBTable; FX_RECT m_CharBBox[256]; }; -- cgit v1.2.3