summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-01-29 15:44:20 -0800
committerWei Li <weili@chromium.org>2016-01-29 15:44:20 -0800
commit9b76113ae4567eb998618d049afde26d3f0175d5 (patch)
treeede02b9835770dafe91eaee727e328765e4ffd52 /core/src/fpdfapi/fpdf_page
parent47f7199eee69abdd48c5ab16a5b8f5aef433a003 (diff)
downloadpdfium-9b76113ae4567eb998618d049afde26d3f0175d5.tar.xz
Merge to XFA: Member function name refactoring
This is needed by Cl 1634373003 as the name collision with virtual functions will be shown as warnings on Linux. Also, it is better to use different names for different cases. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1644633003 . (cherry picked from commit d45e7a51904164fb22049f0a7a80d2a94c06936b) Review URL: https://codereview.chromium.org/1648233002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp56
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp52
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp14
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp11
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp22
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp26
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp36
9 files changed, 121 insertions, 120 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 5ec79000ac..c4a26e9921 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -756,18 +756,18 @@ void CPDF_PageObjectList::LoadTransInfo() {
if (!m_pFormDict) {
return;
}
- CPDF_Dictionary* pGroup = m_pFormDict->GetDict("Group");
+ CPDF_Dictionary* pGroup = m_pFormDict->GetDictBy("Group");
if (!pGroup) {
return;
}
- if (pGroup->GetString("S") != "Transparency") {
+ if (pGroup->GetStringBy("S") != "Transparency") {
return;
}
m_Transparency |= PDFTRANS_GROUP;
- if (pGroup->GetInteger("I")) {
+ if (pGroup->GetIntegerBy("I")) {
m_Transparency |= PDFTRANS_ISOLATED;
}
- if (pGroup->GetInteger("K")) {
+ if (pGroup->GetIntegerBy("K")) {
m_Transparency |= PDFTRANS_KNOCKOUT;
}
}
@@ -869,7 +869,7 @@ CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict,
if (pObj) {
return pObj;
}
- CPDF_Dictionary* pParent = pPageDict->GetDict("Parent");
+ CPDF_Dictionary* pParent = pPageDict->GetDictBy("Parent");
if (!pParent || pParent == pPageDict) {
return NULL;
}
@@ -890,7 +890,7 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc,
m_pDocument = pDoc;
m_pFormStream = pFormStream;
m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL;
- m_pResources = m_pFormDict->GetDict("Resources");
+ m_pResources = m_pFormDict->GetDictBy("Resources");
m_pPageResources = pPageResources;
if (!m_pResources) {
m_pResources = pParentResources;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 87b9e025bc..9620415e55 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -333,20 +333,20 @@ class CPDF_CalGray : public CPDF_ColorSpace {
};
FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict)
return FALSE;
- CPDF_Array* pParam = pDict->GetArray("WhitePoint");
+ CPDF_Array* pParam = pDict->GetArrayBy("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
- m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_WhitePoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- pParam = pDict->GetArray("BlackPoint");
+ pParam = pDict->GetArrayBy("BlackPoint");
for (i = 0; i < 3; i++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_BlackPoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- m_Gamma = pDict->GetNumber("Gamma");
+ m_Gamma = pDict->GetNumberBy("Gamma");
if (m_Gamma == 0) {
m_Gamma = 1.0f;
}
@@ -409,33 +409,33 @@ class CPDF_CalRGB : public CPDF_ColorSpace {
FX_BOOL m_bMatrix;
};
FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict)
return FALSE;
- CPDF_Array* pParam = pDict->GetArray("WhitePoint");
+ CPDF_Array* pParam = pDict->GetArrayBy("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
- m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_WhitePoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- pParam = pDict->GetArray("BlackPoint");
+ pParam = pDict->GetArrayBy("BlackPoint");
for (i = 0; i < 3; i++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_BlackPoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- pParam = pDict->GetArray("Gamma");
+ pParam = pDict->GetArrayBy("Gamma");
if (pParam) {
m_bGamma = TRUE;
for (i = 0; i < 3; i++) {
- m_Gamma[i] = pParam->GetNumber(i);
+ m_Gamma[i] = pParam->GetNumberAt(i);
}
} else {
m_bGamma = FALSE;
}
- pParam = pDict->GetArray("Matrix");
+ pParam = pDict->GetArrayBy("Matrix");
if (pParam) {
m_bMatrix = TRUE;
for (i = 0; i < 9; i++) {
- m_Matrix[i] = pParam->GetNumber(i);
+ m_Matrix[i] = pParam->GetNumberAt(i);
}
} else {
m_bMatrix = FALSE;
@@ -529,24 +529,24 @@ class CPDF_LabCS : public CPDF_ColorSpace {
FX_FLOAT m_Ranges[4];
};
FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Dictionary* pDict = pArray->GetDictAt(1);
if (!pDict) {
return FALSE;
}
- CPDF_Array* pParam = pDict->GetArray("WhitePoint");
+ CPDF_Array* pParam = pDict->GetArrayBy("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
- m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_WhitePoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- pParam = pDict->GetArray("BlackPoint");
+ pParam = pDict->GetArrayBy("BlackPoint");
for (i = 0; i < 3; i++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ m_BlackPoint[i] = pParam ? pParam->GetNumberAt(i) : 0;
}
- pParam = pDict->GetArray("Range");
+ pParam = pDict->GetArrayBy("Range");
const FX_FLOAT def_ranges[4] = {-100 * 1.0f, 100 * 1.0f, -100 * 1.0f,
100 * 1.0f};
for (i = 0; i < 4; i++) {
- m_Ranges[i] = pParam ? pParam->GetNumber(i) : def_ranges[i];
+ m_Ranges[i] = pParam ? pParam->GetNumberAt(i) : def_ranges[i];
}
return TRUE;
}
@@ -692,7 +692,7 @@ CPDF_ICCBasedCS::~CPDF_ICCBasedCS() {
}
FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- CPDF_Stream* pStream = pArray->GetStream(1);
+ CPDF_Stream* pStream = pArray->GetStreamAt(1);
if (!pStream) {
return FALSE;
}
@@ -717,7 +717,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
m_bOwn = TRUE;
} else { // No valid alternative colorspace
pAlterCS->ReleaseCS();
- int32_t nDictComponents = pDict ? pDict->GetInteger("N") : 0;
+ int32_t nDictComponents = pDict ? pDict->GetIntegerBy("N") : 0;
if (nDictComponents != 1 && nDictComponents != 3 &&
nDictComponents != 4) {
return FALSE;
@@ -745,11 +745,11 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
}
}
}
- CPDF_Array* pRanges = pDict->GetArray("Range");
+ CPDF_Array* pRanges = pDict->GetArrayBy("Range");
m_pRanges = FX_Alloc2D(FX_FLOAT, m_nComponents, 2);
for (int i = 0; i < m_nComponents * 2; i++) {
if (pRanges) {
- m_pRanges[i] = pRanges->GetNumber(i);
+ m_pRanges[i] = pRanges->GetNumberAt(i);
} else if (i % 2) {
m_pRanges[i] = 1.0f;
} else {
@@ -914,7 +914,7 @@ FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
m_pCompMinMax[i * 2 + 1]);
m_pCompMinMax[i * 2 + 1] -= m_pCompMinMax[i * 2];
}
- m_MaxIndex = pArray->GetInteger(2);
+ m_MaxIndex = pArray->GetIntegerAt(2);
CPDF_Object* pTableObj = pArray->GetElementValue(3);
if (!pTableObj)
@@ -1054,7 +1054,7 @@ void CPDF_SeparationCS::GetDefaultValue(int iComponent,
max = 1.0f;
}
FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
- CFX_ByteString name = pArray->GetString(1);
+ CFX_ByteString name = pArray->GetStringAt(1);
if (name == "None") {
m_Type = None;
} else {
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 0199809a45..6ba7e4598b 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -317,7 +317,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(
CFX_ByteString name = pCSObj->GetConstString();
CPDF_ColorSpace* pCS = _CSFromName(name);
if (!pCS && pResources) {
- CPDF_Dictionary* pList = pResources->GetDict("ColorSpace");
+ CPDF_Dictionary* pList = pResources->GetDictBy("ColorSpace");
if (pList) {
pCSObj = pList->GetElementValue(name);
return GetColorSpace(pCSObj, nullptr);
@@ -326,7 +326,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(
if (!pCS || !pResources)
return pCS;
- CPDF_Dictionary* pColorSpaces = pResources->GetDict("ColorSpace");
+ CPDF_Dictionary* pColorSpaces = pResources->GetDictBy("ColorSpace");
if (!pColorSpaces)
return pCS;
@@ -423,7 +423,7 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
} else {
CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr;
if (pDict) {
- int type = pDict->GetInteger("PatternType");
+ int type = pDict->GetIntegerBy("PatternType");
if (type == 1) {
pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
} else if (type == 2) {
@@ -553,9 +553,9 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(
return it->second->AddRef();
CPDF_Dictionary* pFontDict = pFontStream->GetDict();
- int32_t org_size = pFontDict->GetInteger("Length1") +
- pFontDict->GetInteger("Length2") +
- pFontDict->GetInteger("Length3");
+ int32_t org_size = pFontDict->GetIntegerBy("Length1") +
+ pFontDict->GetIntegerBy("Length2") +
+ pFontDict->GetIntegerBy("Length3");
if (org_size < 0)
org_size = 0;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 15222fc594..d1991adab2 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -500,10 +500,10 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
return false;
CPDF_Dictionary* pDict = pStream->GetDict();
- CPDF_Array* pSize = pDict->GetArray("Size");
- CPDF_Array* pEncode = pDict->GetArray("Encode");
- CPDF_Array* pDecode = pDict->GetArray("Decode");
- m_nBitsPerSample = pDict->GetInteger("BitsPerSample");
+ CPDF_Array* pSize = pDict->GetArrayBy("Size");
+ CPDF_Array* pEncode = pDict->GetArrayBy("Encode");
+ CPDF_Array* pDecode = pDict->GetArrayBy("Decode");
+ m_nBitsPerSample = pDict->GetIntegerBy("BitsPerSample");
if (m_nBitsPerSample > 32) {
return FALSE;
}
@@ -513,14 +513,14 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
FX_SAFE_DWORD nTotalSampleBits = 1;
for (int i = 0; i < m_nInputs; i++) {
- m_pEncodeInfo[i].sizes = pSize ? pSize->GetInteger(i) : 0;
+ m_pEncodeInfo[i].sizes = pSize ? pSize->GetIntegerAt(i) : 0;
if (!pSize && i == 0) {
- m_pEncodeInfo[i].sizes = pDict->GetInteger("Size");
+ m_pEncodeInfo[i].sizes = pDict->GetIntegerBy("Size");
}
nTotalSampleBits *= m_pEncodeInfo[i].sizes;
if (pEncode) {
- m_pEncodeInfo[i].encode_min = pEncode->GetFloat(i * 2);
- m_pEncodeInfo[i].encode_max = pEncode->GetFloat(i * 2 + 1);
+ m_pEncodeInfo[i].encode_min = pEncode->GetFloatAt(i * 2);
+ m_pEncodeInfo[i].encode_max = pEncode->GetFloatAt(i * 2 + 1);
} else {
m_pEncodeInfo[i].encode_min = 0;
if (m_pEncodeInfo[i].sizes == 1) {
@@ -542,8 +542,8 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
m_pDecodeInfo = FX_Alloc(SampleDecodeInfo, m_nOutputs);
for (int i = 0; i < m_nOutputs; i++) {
if (pDecode) {
- m_pDecodeInfo[i].decode_min = pDecode->GetFloat(2 * i);
- m_pDecodeInfo[i].decode_max = pDecode->GetFloat(2 * i + 1);
+ m_pDecodeInfo[i].decode_min = pDecode->GetFloatAt(2 * i);
+ m_pDecodeInfo[i].decode_max = pDecode->GetFloatAt(2 * i + 1);
} else {
m_pDecodeInfo[i].decode_min = m_pRanges[i * 2];
m_pDecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
@@ -686,21 +686,21 @@ FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
if (!pDict) {
return FALSE;
}
- CPDF_Array* pArray0 = pDict->GetArray("C0");
+ CPDF_Array* pArray0 = pDict->GetArrayBy("C0");
if (m_nOutputs == 0) {
m_nOutputs = 1;
if (pArray0) {
m_nOutputs = pArray0->GetCount();
}
}
- CPDF_Array* pArray1 = pDict->GetArray("C1");
+ CPDF_Array* pArray1 = pDict->GetArrayBy("C1");
m_pBeginValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
m_pEndValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
for (int i = 0; i < m_nOutputs; i++) {
- m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
- m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
+ m_pBeginValues[i] = pArray0 ? pArray0->GetFloatAt(i) : 0.0f;
+ m_pEndValues[i] = pArray1 ? pArray1->GetFloatAt(i) : 1.0f;
}
- m_Exponent = pDict->GetFloat("N");
+ m_Exponent = pDict->GetFloatBy("N");
m_nOrigOutputs = m_nOutputs;
if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
return FALSE;
@@ -754,7 +754,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
if (m_nInputs != kRequiredNumInputs) {
return FALSE;
}
- CPDF_Array* pArray = pDict->GetArray("Functions");
+ CPDF_Array* pArray = pDict->GetArrayBy("Functions");
if (!pArray) {
return FALSE;
}
@@ -788,21 +788,21 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
}
m_pBounds = FX_Alloc(FX_FLOAT, nSubs + 1);
m_pBounds[0] = m_pDomains[0];
- pArray = pDict->GetArray("Bounds");
+ pArray = pDict->GetArrayBy("Bounds");
if (!pArray) {
return FALSE;
}
for (FX_DWORD i = 0; i < nSubs - 1; i++) {
- m_pBounds[i + 1] = pArray->GetFloat(i);
+ m_pBounds[i + 1] = pArray->GetFloatAt(i);
}
m_pBounds[nSubs] = m_pDomains[1];
m_pEncode = FX_Alloc2D(FX_FLOAT, nSubs, 2);
- pArray = pDict->GetArray("Encode");
+ pArray = pDict->GetArrayBy("Encode");
if (!pArray) {
return FALSE;
}
for (FX_DWORD i = 0; i < nSubs * 2; i++) {
- m_pEncode[i] = pArray->GetFloat(i);
+ m_pEncode[i] = pArray->GetFloatAt(i);
}
return TRUE;
}
@@ -829,9 +829,9 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) {
CPDF_Function* pFunc = NULL;
int type;
if (CPDF_Stream* pStream = pFuncObj->AsStream()) {
- type = pStream->GetDict()->GetInteger("FunctionType");
+ type = pStream->GetDict()->GetIntegerBy("FunctionType");
} else if (CPDF_Dictionary* pDict = pFuncObj->AsDictionary()) {
- type = pDict->GetInteger("FunctionType");
+ type = pDict->GetIntegerBy("FunctionType");
} else {
return NULL;
}
@@ -864,7 +864,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
CPDF_Stream* pStream = pObj->AsStream();
CPDF_Dictionary* pDict = pStream ? pStream->GetDict() : pObj->AsDictionary();
- CPDF_Array* pDomains = pDict->GetArray("Domain");
+ CPDF_Array* pDomains = pDict->GetArrayBy("Domain");
if (!pDomains)
return FALSE;
@@ -874,15 +874,15 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
m_pDomains = FX_Alloc2D(FX_FLOAT, m_nInputs, 2);
for (int i = 0; i < m_nInputs * 2; i++) {
- m_pDomains[i] = pDomains->GetFloat(i);
+ m_pDomains[i] = pDomains->GetFloatAt(i);
}
- CPDF_Array* pRanges = pDict->GetArray("Range");
+ CPDF_Array* pRanges = pDict->GetArrayBy("Range");
m_nOutputs = 0;
if (pRanges) {
m_nOutputs = pRanges->GetCount() / 2;
m_pRanges = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
for (int i = 0; i < m_nOutputs * 2; i++) {
- m_pRanges[i] = pRanges->GetFloat(i);
+ m_pRanges[i] = pRanges->GetFloatAt(i);
}
}
FX_DWORD old_outputs = m_nOutputs;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index e9f1747097..37e3c04e53 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -452,7 +452,7 @@ void CPDF_AllStates::SetLineDash(CPDF_Array* pArray,
pData->m_DashPhase = FXSYS_Mul(phase, scale);
pData->SetDashCount(pArray->GetCount());
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
- pData->m_DashArray[i] = FXSYS_Mul(pArray->GetNumber(i), scale);
+ pData->m_DashArray[i] = FXSYS_Mul(pArray->GetNumberAt(i), scale);
}
}
void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
@@ -486,11 +486,11 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
if (!pDash)
break;
- CPDF_Array* pArray = pDash->GetArray(0);
+ CPDF_Array* pArray = pDash->GetArrayAt(0);
if (!pArray)
break;
- SetLineDash(pArray, pDash->GetNumber(1), 1.0f);
+ SetLineDash(pArray, pDash->GetNumberAt(1), 1.0f);
break;
}
case FXBSTR_ID('R', 'I', 0, 0):
@@ -501,8 +501,8 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
if (!pFont)
break;
- m_TextState.GetModify()->m_FontSize = pFont->GetNumber(1);
- m_TextState.SetFont(pParser->FindFont(pFont->GetString(0)));
+ m_TextState.GetModify()->m_FontSize = pFont->GetNumberAt(1);
+ m_TextState.SetFont(pParser->FindFont(pFont->GetStringAt(0)));
break;
}
case FXBSTR_ID('T', 'R', 0, 0):
@@ -516,7 +516,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
case FXBSTR_ID('B', 'M', 0, 0): {
CPDF_Array* pArray = pObject->AsArray();
CFX_ByteString mode =
- pArray ? pArray->GetString(0) : pObject->GetString();
+ pArray ? pArray->GetStringAt(0) : pObject->GetString();
pGeneralState->SetBlendMode(mode);
if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) {
@@ -625,7 +625,7 @@ int CPDF_ContentMarkData::GetMCID() const {
CPDF_Dictionary* pDict =
ToDictionary(static_cast<CPDF_Object*>(m_Marks[i].GetParam()));
if (pDict->KeyExist("MCID")) {
- return pDict->GetInteger("MCID");
+ return pDict->GetIntegerBy("MCID");
}
}
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index d1e6687999..9296cd6158 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -86,10 +86,11 @@ FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) {
if (m_bInline) {
m_pInlineDict = ToDictionary(pDict->Clone());
}
- m_pOC = pDict->GetDict("OC");
- m_bIsMask = !pDict->KeyExist("ColorSpace") || pDict->GetInteger("ImageMask");
- m_bInterpolate = pDict->GetInteger("Interpolate");
- m_Height = pDict->GetInteger("Height");
- m_Width = pDict->GetInteger("Width");
+ m_pOC = pDict->GetDictBy("OC");
+ m_bIsMask =
+ !pDict->KeyExist("ColorSpace") || pDict->GetIntegerBy("ImageMask");
+ m_bInterpolate = pDict->GetIntegerBy("Interpolate");
+ m_Height = pDict->GetIntegerBy("Height");
+ m_Width = pDict->GetIntegerBy("Width");
return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 30480ca348..7f242fdb0e 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -708,9 +708,9 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
if (!m_pResources)
return;
- CPDF_Dictionary* pList = m_pResources->GetDict("XObject");
+ CPDF_Dictionary* pList = m_pResources->GetDictBy("XObject");
if (!pList && m_pPageResources && m_pResources != m_pPageResources)
- pList = m_pPageResources->GetDict("XObject");
+ pList = m_pPageResources->GetDictBy("XObject");
if (!pList)
return;
CPDF_Reference* pRes = ToReference(pList->GetElement(name));
@@ -729,7 +729,7 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
}
CFX_ByteStringC type = pXObject->GetDict()
- ? pXObject->GetDict()->GetConstString("Subtype")
+ ? pXObject->GetDict()->GetConstStringBy("Subtype")
: CFX_ByteStringC();
if (type == "Image") {
if (m_Options.m_bTextOnly) {
@@ -749,14 +749,14 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) {
if (!m_Options.m_bSeparateForm) {
- CPDF_Dictionary* pResources = pStream->GetDict()->GetDict("Resources");
- CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix("Matrix");
+ CPDF_Dictionary* pResources = pStream->GetDict()->GetDictBy("Resources");
+ CFX_Matrix form_matrix = pStream->GetDict()->GetMatrixBy("Matrix");
form_matrix.Concat(m_pCurStates->m_CTM);
- CPDF_Array* pBBox = pStream->GetDict()->GetArray("BBox");
+ CPDF_Array* pBBox = pStream->GetDict()->GetArrayBy("BBox");
CFX_FloatRect form_bbox;
CPDF_Path ClipPath;
if (pBBox) {
- form_bbox = pStream->GetDict()->GetRect("BBox");
+ form_bbox = pStream->GetDict()->GetRectBy("BBox");
ClipPath.New();
ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right,
form_bbox.top);
@@ -1249,19 +1249,19 @@ CPDF_Object* CPDF_StreamContentParser::FindResourceObj(
return NULL;
}
if (m_pResources == m_pPageResources) {
- CPDF_Dictionary* pList = m_pResources->GetDict(type);
+ CPDF_Dictionary* pList = m_pResources->GetDictBy(type);
if (!pList) {
return NULL;
}
CPDF_Object* pRes = pList->GetElementValue(name);
return pRes;
}
- CPDF_Dictionary* pList = m_pResources->GetDict(type);
+ CPDF_Dictionary* pList = m_pResources->GetDictBy(type);
if (!pList) {
if (!m_pPageResources) {
return NULL;
}
- CPDF_Dictionary* pList = m_pPageResources->GetDict(type);
+ CPDF_Dictionary* pList = m_pPageResources->GetDictBy(type);
if (!pList) {
return NULL;
}
@@ -1427,7 +1427,7 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
if (nsegs == 0) {
for (int i = 0; i < n; i++) {
m_pCurStates->m_TextX -=
- FXSYS_Mul(pArray->GetNumber(i),
+ FXSYS_Mul(pArray->GetNumberAt(i),
m_pCurStates->m_TextState.GetFontSize()) /
1000;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 7b96c4f02c..022c170bf0 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -94,7 +94,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf,
ICodec_ScanlineDecoder* pDecoder =
CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
src_buf, limit, width, height, 0,
- pParam ? pParam->GetInteger("ColorTransform", 1) : 1);
+ pParam ? pParam->GetIntegerBy("ColorTransform", 1) : 1);
return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
}
if (decoder == "RunLengthDecode" || decoder == "RL") {
@@ -120,20 +120,20 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
CPDF_Object* pFilter = pDict->GetElementValue("Filter");
if (pFilter) {
if (CPDF_Array* pArray = pFilter->AsArray()) {
- Decoder = pArray->GetString(0);
- CPDF_Array* pParams = pDict->GetArray("DecodeParms");
+ Decoder = pArray->GetStringAt(0);
+ CPDF_Array* pParams = pDict->GetArrayBy("DecodeParms");
if (pParams)
- pParam = pParams->GetDict(0);
+ pParam = pParams->GetDictAt(0);
} else {
Decoder = pFilter->GetString();
- pParam = pDict->GetDict("DecodeParms");
+ pParam = pDict->GetDictBy("DecodeParms");
}
}
- FX_DWORD width = pDict->GetInteger("Width");
- FX_DWORD height = pDict->GetInteger("Height");
+ FX_DWORD width = pDict->GetIntegerBy("Width");
+ FX_DWORD height = pDict->GetIntegerBy("Height");
FX_DWORD OrigSize = 0;
if (pCSObj) {
- FX_DWORD bpc = pDict->GetInteger("BitsPerComponent");
+ FX_DWORD bpc = pDict->GetIntegerBy("BitsPerComponent");
FX_DWORD nComponents = 1;
CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
if (!pCS) {
@@ -191,7 +191,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
dwStreamSize = dwDestSize;
if (CPDF_Array* pArray = pFilter->AsArray()) {
pArray->RemoveAt(0);
- CPDF_Array* pParams = pDict->GetArray("DecodeParms");
+ CPDF_Array* pParams = pDict->GetArrayBy("DecodeParms");
if (pParams)
pParams->RemoveAt(0);
} else {
@@ -722,11 +722,11 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
m_pType3Char = pType3Char;
m_pObjects = pForm;
m_bForm = TRUE;
- CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix("Matrix");
+ CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix");
if (pGraphicStates) {
form_matrix.Concat(pGraphicStates->m_CTM);
}
- CPDF_Array* pBBox = pForm->m_pFormDict->GetArray("BBox");
+ CPDF_Array* pBBox = pForm->m_pFormDict->GetArrayBy("BBox");
CFX_FloatRect form_bbox;
CPDF_Path ClipPath;
if (pBBox) {
@@ -743,7 +743,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
form_bbox.Transform(pParentMatrix);
}
}
- CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict("Resources");
+ CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDictBy("Resources");
m_pParser.reset(new CPDF_StreamContentParser(
pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources,
pParentMatrix, pForm, pResources, &form_bbox, pOptions, pGraphicStates,
@@ -803,7 +803,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
m_InternalStage = STAGE_PARSE;
m_CurrentOffset = 0;
} else {
- CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray("Contents");
+ CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArrayBy("Contents");
m_StreamArray[m_CurrentOffset].reset(new CPDF_StreamAcc);
CPDF_Stream* pStreamObj = ToStream(
pContent ? pContent->GetElementValue(m_CurrentOffset) : nullptr);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 1eae578b97..dae583e8b9 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -43,8 +43,8 @@ CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc,
const CFX_Matrix* parentMatrix)
: CPDF_Pattern(TILING, pDoc, pPatternObj, parentMatrix) {
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
- m_Pattern2Form = pDict->GetMatrix("Matrix");
- m_bColored = pDict->GetInteger("PaintType") == 1;
+ m_Pattern2Form = pDict->GetMatrixBy("Matrix");
+ m_bColored = pDict->GetIntegerBy("PaintType") == 1;
if (parentMatrix) {
m_Pattern2Form.Concat(*parentMatrix);
}
@@ -62,9 +62,9 @@ FX_BOOL CPDF_TilingPattern::Load() {
if (!pDict)
return FALSE;
- m_bColored = pDict->GetInteger("PaintType") == 1;
- m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber("XStep"));
- m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber("YStep"));
+ m_bColored = pDict->GetIntegerBy("PaintType") == 1;
+ m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberBy("XStep"));
+ m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberBy("YStep"));
CPDF_Stream* pStream = m_pPatternObj->AsStream();
if (!pStream)
@@ -72,7 +72,7 @@ FX_BOOL CPDF_TilingPattern::Load() {
m_pForm = new CPDF_Form(m_pDocument, NULL, pStream);
m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
- m_BBox = pDict->GetRect("BBox");
+ m_BBox = pDict->GetRectBy("BBox");
return TRUE;
}
CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
@@ -91,7 +91,7 @@ CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
m_nFuncs(0) {
if (!bShading) {
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
- m_Pattern2Form = pDict->GetMatrix("Matrix");
+ m_Pattern2Form = pDict->GetMatrixBy("Matrix");
m_pShadingObj = pDict->GetElementValue("Shading");
if (parentMatrix)
m_Pattern2Form.Concat(*parentMatrix);
@@ -146,7 +146,7 @@ FX_BOOL CPDF_ShadingPattern::Load() {
m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray());
}
- m_ShadingType = ToShadingType(pShadingDict->GetInteger("ShadingType"));
+ m_ShadingType = ToShadingType(pShadingDict->GetIntegerBy("ShadingType"));
// We expect to have a stream if our shading type is a mesh.
if (IsMeshShading() && !ToStream(m_pShadingObj))
@@ -164,9 +164,9 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
m_nFuncs = nFuncs;
m_pCS = pCS;
CPDF_Dictionary* pDict = pShadingStream->GetDict();
- m_nCoordBits = pDict->GetInteger("BitsPerCoordinate");
- m_nCompBits = pDict->GetInteger("BitsPerComponent");
- m_nFlagBits = pDict->GetInteger("BitsPerFlag");
+ m_nCoordBits = pDict->GetIntegerBy("BitsPerCoordinate");
+ m_nCompBits = pDict->GetIntegerBy("BitsPerComponent");
+ m_nFlagBits = pDict->GetIntegerBy("BitsPerFlag");
if (!m_nCoordBits || !m_nCompBits) {
return FALSE;
}
@@ -180,17 +180,17 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
}
m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
m_CompMax = (1 << m_nCompBits) - 1;
- CPDF_Array* pDecode = pDict->GetArray("Decode");
+ CPDF_Array* pDecode = pDict->GetArrayBy("Decode");
if (!pDecode || pDecode->GetCount() != 4 + m_nComps * 2) {
return FALSE;
}
- m_xmin = pDecode->GetNumber(0);
- m_xmax = pDecode->GetNumber(1);
- m_ymin = pDecode->GetNumber(2);
- m_ymax = pDecode->GetNumber(3);
+ m_xmin = pDecode->GetNumberAt(0);
+ m_xmax = pDecode->GetNumberAt(1);
+ m_ymin = pDecode->GetNumberAt(2);
+ m_ymax = pDecode->GetNumberAt(3);
for (FX_DWORD i = 0; i < m_nComps; i++) {
- m_ColorMin[i] = pDecode->GetNumber(i * 2 + 4);
- m_ColorMax[i] = pDecode->GetNumber(i * 2 + 5);
+ m_ColorMin[i] = pDecode->GetNumberAt(i * 2 + 4);
+ m_ColorMax[i] = pDecode->GetNumberAt(i * 2 + 5);
}
return TRUE;
}