summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-10 13:52:25 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-10 13:52:25 -0800
commite238549d212e97fe01dba3740949a98172c21454 (patch)
tree22fceab5e0a35b6d12a10f0504b0f4065f05b09e /core/src/fpdfapi/fpdf_page
parent0db900952c2aa76db801c9198923ce1b3d7c017d (diff)
downloadpdfium-e238549d212e97fe01dba3740949a98172c21454.tar.xz
Banish CFX_PtryArray to XFA side only.
The m_Operators array represents a heterogeneous instruction stream, so leave it as a void* for now. R=thestig@chromium.org, thestig@chromimum.org Review URL: https://codereview.chromium.org/1676413002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index d1991adab2..5460615042 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -68,7 +68,7 @@ class CPDF_PSProc {
~CPDF_PSProc();
FX_BOOL Parse(CPDF_SimpleParser& parser);
FX_BOOL Execute(CPDF_PSEngine* pEngine);
- CFX_PtrArray m_Operators;
+ std::vector<void*> m_Operators;
};
#define PSENGINE_STACKSIZE 100
class CPDF_PSEngine {
@@ -90,8 +90,7 @@ class CPDF_PSEngine {
CPDF_PSProc m_MainProc;
};
CPDF_PSProc::~CPDF_PSProc() {
- int size = m_Operators.GetSize();
- for (int i = 0; i < size; i++) {
+ for (size_t i = 0; i < m_Operators.size(); i++) {
if (m_Operators[i] == (void*)PSOP_PROC) {
delete (CPDF_PSProc*)m_Operators[i + 1];
i++;
@@ -102,8 +101,7 @@ CPDF_PSProc::~CPDF_PSProc() {
}
}
FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) {
- int size = m_Operators.GetSize();
- for (int i = 0; i < size; i++) {
+ for (size_t i = 0; i < m_Operators.size(); i++) {
PDF_PSOP op = (PDF_PSOP)(uintptr_t)m_Operators[i];
if (op == PSOP_PROC) {
i++;
@@ -193,8 +191,8 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser) {
}
if (word == "{") {
CPDF_PSProc* pProc = new CPDF_PSProc;
- m_Operators.Add((void*)PSOP_PROC);
- m_Operators.Add(pProc);
+ m_Operators.push_back((void*)PSOP_PROC);
+ m_Operators.push_back(pProc);
if (!pProc->Parse(parser)) {
return FALSE;
}
@@ -202,7 +200,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser) {
int i = 0;
while (_PDF_PSOpNames[i].name) {
if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
- m_Operators.Add((void*)_PDF_PSOpNames[i].op);
+ m_Operators.push_back((void*)_PDF_PSOpNames[i].op);
break;
}
i++;
@@ -210,8 +208,8 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser) {
if (!_PDF_PSOpNames[i].name) {
FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
*pd = FX_atof(word);
- m_Operators.Add((void*)PSOP_CONST);
- m_Operators.Add(pd);
+ m_Operators.push_back((void*)PSOP_CONST);
+ m_Operators.push_back(pd);
}
}
}