summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-11 05:37:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-11 05:37:28 +0000
commit74d2389d206da5638b642ca8084e140cfbf04c92 (patch)
treea034b53cd654402921d3bd511b1e1f4120c55145
parent3b76669371e54011d8a035122a1af0f0673597ab (diff)
downloadpdfium-74d2389d206da5638b642ca8084e140cfbf04c92.tar.xz
Initialize CPDF_CIDFont members.
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 <thestig@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
-rw-r--r--core/fpdfapi/font/cpdf_cidfont.cpp5
-rw-r--r--core/fpdfapi/font/cpdf_cidfont.h16
2 files changed, 8 insertions, 13 deletions
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<CPDF_CMap> m_pCMap;
UnownedPtr<const CPDF_CID2UnicodeMap> m_pCID2UnicodeMap;
- CIDSet m_Charset;
- bool m_bType1;
- bool m_bCIDIsGID = false;
- uint16_t m_DefaultWidth;
RetainPtr<CPDF_StreamAcc> m_pStreamAcc;
+ std::unique_ptr<CFX_CTTGSUBTable> 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<uint32_t> m_WidthList;
- short m_DefaultVY;
- short m_DefaultW1;
std::vector<uint32_t> m_VertMetrics;
- bool m_bAdobeCourierStd = false;
- std::unique_ptr<CFX_CTTGSUBTable> m_pTTGSUBTable;
FX_RECT m_CharBBox[256];
};