summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
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/page
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/page')
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.cpp10
-rw-r--r--core/fpdfapi/page/cpdf_contentparser.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_expintfunc.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_function.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_shadingpattern.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_stitchfunc.cpp6
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp4
9 files changed, 17 insertions, 17 deletions
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 882b5657d8..2266dec9e8 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -80,7 +80,7 @@ void GetDefaultBlackPoint(float* pPoints) {
void GetBlackPoint(const CPDF_Dictionary* pDict, float* pPoints) {
const CPDF_Array* pParam = pDict->GetArrayFor("BlackPoint");
- if (!pParam || pParam->GetCount() != kBlackWhitePointCount) {
+ if (!pParam || pParam->size() != kBlackWhitePointCount) {
GetDefaultBlackPoint(pPoints);
return;
}
@@ -97,7 +97,7 @@ void GetBlackPoint(const CPDF_Dictionary* pDict, float* pPoints) {
bool GetWhitePoint(const CPDF_Dictionary* pDict, float* pPoints) {
const CPDF_Array* pParam = pDict->GetArrayFor("WhitePoint");
- if (!pParam || pParam->GetCount() != kBlackWhitePointCount)
+ if (!pParam || pParam->size() != kBlackWhitePointCount)
return false;
for (size_t i = 0; i < kBlackWhitePointCount; ++i)
@@ -481,7 +481,7 @@ std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(
return nullptr;
ByteString familyname = pFamilyObj->GetString();
- if (pArray->GetCount() == 1)
+ if (pArray->size() == 1)
return pdfium::WrapUnique(ColorspaceFromName(familyname));
std::unique_ptr<CPDF_ColorSpace> pCS;
@@ -1101,7 +1101,7 @@ CPDF_IndexedCS::~CPDF_IndexedCS() {
uint32_t CPDF_IndexedCS::v_Load(CPDF_Document* pDoc,
const CPDF_Array* pArray,
std::set<const CPDF_Object*>* pVisited) {
- if (pArray->GetCount() < 4)
+ if (pArray->size() < 4)
return 0;
const CPDF_Object* pBaseObj = pArray->GetDirectObjectAt(1);
@@ -1299,7 +1299,7 @@ uint32_t CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc,
if (m_pFunc->CountOutputs() < m_pAltCS->CountComponents())
return 0;
- return pObj->GetCount();
+ return pObj->size();
}
bool CPDF_DeviceNCS::GetRGB(const float* pBuf,
diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp
index 3427fe5230..cf31447697 100644
--- a/core/fpdfapi/page/cpdf_contentparser.cpp
+++ b/core/fpdfapi/page/cpdf_contentparser.cpp
@@ -52,7 +52,7 @@ CPDF_ContentParser::CPDF_ContentParser(CPDF_Page* pPage)
return;
}
- m_nStreams = pArray->GetCount();
+ m_nStreams = pArray->size();
if (m_nStreams == 0) {
m_CurrentStage = Stage::kComplete;
return;
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index bc1c1c5a60..b41a8466b1 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -278,7 +278,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceInternal(
if (!pArray || pArray->IsEmpty())
return nullptr;
- if (pArray->GetCount() == 1) {
+ if (pArray->size() == 1) {
return GetColorSpaceInternal(pArray->GetDirectObjectAt(0), pResources,
pVisited, pVisitedInternal);
}
diff --git a/core/fpdfapi/page/cpdf_expintfunc.cpp b/core/fpdfapi/page/cpdf_expintfunc.cpp
index cb83ac2d0b..e04ce1282c 100644
--- a/core/fpdfapi/page/cpdf_expintfunc.cpp
+++ b/core/fpdfapi/page/cpdf_expintfunc.cpp
@@ -30,7 +30,7 @@ bool CPDF_ExpIntFunc::v_Init(const CPDF_Object* pObj,
const CPDF_Array* pArray0 = pDict->GetArrayFor("C0");
if (pArray0 && m_nOutputs == 0)
- m_nOutputs = pArray0->GetCount();
+ m_nOutputs = pArray0->size();
if (m_nOutputs == 0)
m_nOutputs = 1;
diff --git a/core/fpdfapi/page/cpdf_function.cpp b/core/fpdfapi/page/cpdf_function.cpp
index def72992cd..fc8eb46d73 100644
--- a/core/fpdfapi/page/cpdf_function.cpp
+++ b/core/fpdfapi/page/cpdf_function.cpp
@@ -85,7 +85,7 @@ bool CPDF_Function::Init(const CPDF_Object* pObj,
if (!pDomains)
return false;
- m_nInputs = pDomains->GetCount() / 2;
+ m_nInputs = pDomains->size() / 2;
if (m_nInputs == 0)
return false;
@@ -95,7 +95,7 @@ bool CPDF_Function::Init(const CPDF_Object* pObj,
m_Domains[i] = pDomains->GetFloatAt(i);
const CPDF_Array* pRanges = pDict->GetArrayFor("Range");
- m_nOutputs = pRanges ? pRanges->GetCount() / 2 : 0;
+ m_nOutputs = pRanges ? pRanges->size() / 2 : 0;
// Ranges are required for type 0 and type 4 functions. A non-zero
// |m_nOutputs| here implied Ranges meets the requirements.
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp
index 5d8e1f2342..dce4c8a7c8 100644
--- a/core/fpdfapi/page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/page/cpdf_meshstream.cpp
@@ -142,7 +142,7 @@ bool CPDF_MeshStream::Load() {
m_nComponents = m_funcs.empty() ? nComponents : 1;
const CPDF_Array* pDecode = pDict->GetArrayFor("Decode");
- if (!pDecode || pDecode->GetCount() != 4 + m_nComponents * 2)
+ if (!pDecode || pDecode->size() != 4 + m_nComponents * 2)
return false;
m_xmin = pDecode->GetNumberAt(0);
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index 52f4e1e10a..79ea6f84ec 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -72,7 +72,7 @@ bool CPDF_ShadingPattern::Load() {
const CPDF_Object* pFunc = pShadingDict->GetDirectObjectFor("Function");
if (pFunc) {
if (const CPDF_Array* pArray = pFunc->AsArray()) {
- m_pFunctions.resize(std::min<size_t>(pArray->GetCount(), 4));
+ m_pFunctions.resize(std::min<size_t>(pArray->size(), 4));
for (size_t i = 0; i < m_pFunctions.size(); ++i)
m_pFunctions[i] = CPDF_Function::Load(pArray->GetDirectObjectAt(i));
} else {
diff --git a/core/fpdfapi/page/cpdf_stitchfunc.cpp b/core/fpdfapi/page/cpdf_stitchfunc.cpp
index b400a987c0..40f7c44d72 100644
--- a/core/fpdfapi/page/cpdf_stitchfunc.cpp
+++ b/core/fpdfapi/page/cpdf_stitchfunc.cpp
@@ -43,14 +43,14 @@ bool CPDF_StitchFunc::v_Init(const CPDF_Object* pObj,
if (!pEncodeArray)
return false;
- const uint32_t nSubs = pFunctionsArray->GetCount();
+ const uint32_t nSubs = pFunctionsArray->size();
if (nSubs == 0)
return false;
// Check array sizes. The checks are slightly relaxed to allow the "Bounds"
// and "Encode" arrays to have more than the required number of elements.
{
- if (pBoundsArray->GetCount() < nSubs - 1)
+ if (pBoundsArray->size() < nSubs - 1)
return false;
FX_SAFE_UINT32 nExpectedEncodeSize = nSubs;
@@ -58,7 +58,7 @@ bool CPDF_StitchFunc::v_Init(const CPDF_Object* pObj,
if (!nExpectedEncodeSize.IsValid())
return false;
- if (pEncodeArray->GetCount() < nExpectedEncodeSize.ValueOrDie())
+ if (pEncodeArray->size() < nExpectedEncodeSize.ValueOrDie())
return false;
}
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index d84d4d62ec..79fa3d2890 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -216,7 +216,7 @@ void ReplaceAbbr(CPDF_Object* pObj) {
}
case CPDF_Object::ARRAY: {
CPDF_Array* pArray = pObj->AsArray();
- for (size_t i = 0; i < pArray->GetCount(); i++) {
+ for (size_t i = 0; i < pArray->size(); i++) {
CPDF_Object* pElement = pArray->GetObjectAt(i);
if (pElement->IsName()) {
ByteString name = pElement->GetString();
@@ -1286,7 +1286,7 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
if (!pArray)
return;
- size_t n = pArray->GetCount();
+ size_t n = pArray->size();
size_t nsegs = 0;
for (size_t i = 0; i < n; i++) {
if (pArray->GetDirectObjectAt(i)->IsString())