summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-12 18:31:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-12 18:31:51 +0000
commitf40380f454042c9783fe30260a0e3df8b32c5c92 (patch)
treed89f89ee2f813e490ec0ccd5c6195c041f81ab44 /core/fpdfapi/font
parent8273b37f032a2d9e8e4a83eeda43641365f311a2 (diff)
downloadpdfium-f40380f454042c9783fe30260a0e3df8b32c5c92.tar.xz
Rename CPDF_{Array,Dictionary}::GetCount() to size().
Make them compatible with pdfium::CollectionSize(). Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157 Reviewed-on: https://pdfium-review.googlesource.com/c/43937 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/cpdf_cidfont.cpp8
-rw-r--r--core/fpdfapi/font/cpdf_simplefont.cpp6
-rw-r--r--core/fpdfapi/font/cpdf_type3font.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index 03442b5897..41627c069f 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -333,7 +333,7 @@ bool CPDF_CIDFont::Load() {
}
const CPDF_Array* pFonts = m_pFontDict->GetArrayFor("DescendantFonts");
- if (!pFonts || pFonts->GetCount() != 1)
+ if (!pFonts || pFonts->size() != 1)
return false;
const CPDF_Dictionary* pCIDFontDict = pFonts->GetDictAt(0);
@@ -771,7 +771,7 @@ void CPDF_CIDFont::LoadMetricsArray(const CPDF_Array* pArray,
int iCurElement = 0;
uint32_t first_code = 0;
uint32_t last_code = 0;
- for (size_t i = 0; i < pArray->GetCount(); i++) {
+ for (size_t i = 0; i < pArray->size(); i++) {
const CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
if (!pObj)
continue;
@@ -780,12 +780,12 @@ void CPDF_CIDFont::LoadMetricsArray(const CPDF_Array* pArray,
if (width_status != 1)
return;
if (first_code >
- std::numeric_limits<uint32_t>::max() - pObjArray->GetCount()) {
+ std::numeric_limits<uint32_t>::max() - pObjArray->size()) {
width_status = 0;
continue;
}
- for (size_t j = 0; j < pObjArray->GetCount(); j += nElements) {
+ for (size_t j = 0; j < pObjArray->size(); j += nElements) {
result->push_back(first_code);
result->push_back(first_code);
for (int k = 0; k < nElements; k++)
diff --git a/core/fpdfapi/font/cpdf_simplefont.cpp b/core/fpdfapi/font/cpdf_simplefont.cpp
index dd1a1f33f3..38deef7cc8 100644
--- a/core/fpdfapi/font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/font/cpdf_simplefont.cpp
@@ -146,7 +146,7 @@ void CPDF_SimpleFont::LoadPDFEncoding(bool bEmbedded, bool bTrueType) {
m_CharNames.resize(256);
uint32_t cur_code = 0;
- for (uint32_t i = 0; i < pDiffs->GetCount(); i++) {
+ for (uint32_t i = 0; i < pDiffs->size(); i++) {
const CPDF_Object* pElement = pDiffs->GetDirectObjectAt(i);
if (!pElement)
continue;
@@ -202,8 +202,8 @@ bool CPDF_SimpleFont::LoadCommon() {
size_t width_start = m_pFontDict->GetIntegerFor("FirstChar", 0);
size_t width_end = m_pFontDict->GetIntegerFor("LastChar", 0);
if (width_start <= 255) {
- if (width_end == 0 || width_end >= width_start + pWidthArray->GetCount())
- width_end = width_start + pWidthArray->GetCount() - 1;
+ if (width_end == 0 || width_end >= width_start + pWidthArray->size())
+ width_end = width_start + pWidthArray->size() - 1;
if (width_end > 255)
width_end = 255;
for (size_t i = width_start; i <= width_end; i++)
diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp
index 5993c1c7cb..1d70c8bb48 100644
--- a/core/fpdfapi/font/cpdf_type3font.cpp
+++ b/core/fpdfapi/font/cpdf_type3font.cpp
@@ -69,7 +69,7 @@ bool CPDF_Type3Font::Load() {
if (StartChar >= 0 && static_cast<size_t>(StartChar) < kCharLimit) {
const CPDF_Array* pWidthArray = m_pFontDict->GetArrayFor("Widths");
if (pWidthArray) {
- size_t count = std::min(pWidthArray->GetCount(), kCharLimit);
+ size_t count = std::min(pWidthArray->size(), kCharLimit);
count = std::min(count, kCharLimit - StartChar);
for (size_t i = 0; i < count; i++) {
m_CharWidthL[StartChar + i] =