summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-12 09:38:41 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-12 09:38:41 -0700
commit74b8c6ed314cfcc83aea13f028b4231db26e6ff8 (patch)
treee417f5d3ec4286aa9709354d9418f06eb1b8887b /core/fpdfapi/edit
parent47cbc06ef6f528e4d30a869ec533d010ee79b064 (diff)
downloadpdfium-74b8c6ed314cfcc83aea13f028b4231db26e6ff8.tar.xz
Get rid of CFX_ArrayTemplate<CPDF_Object*>
They won't work with std::unique_ptr down the road, so replace with std::vector. Review-Url: https://codereview.chromium.org/2411703003
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp18
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index 66a47406f5..ad1ffaf687 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -34,21 +34,19 @@ CPDF_PageContentGenerator::CPDF_PageContentGenerator(CPDF_Page* pPage)
CPDF_PageContentGenerator::~CPDF_PageContentGenerator() {}
-FX_BOOL CPDF_PageContentGenerator::InsertPageObject(
- CPDF_PageObject* pPageObject) {
- return pPageObject && m_pageObjects.Add(pPageObject);
+void CPDF_PageContentGenerator::InsertPageObject(CPDF_PageObject* pPageObject) {
+ if (pPageObject)
+ m_pageObjects.push_back(pPageObject);
}
void CPDF_PageContentGenerator::GenerateContent() {
CFX_ByteTextBuf buf;
- CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
- for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
- CPDF_PageObject* pPageObj = m_pageObjects[i];
- if (!pPageObj || !pPageObj->IsImage()) {
- continue;
- }
- ProcessImage(buf, pPageObj->AsImage());
+ for (CPDF_PageObject* pPageObj : m_pageObjects) {
+ CPDF_ImageObject* pImageObject = pPageObj->AsImage();
+ if (pImageObject)
+ ProcessImage(buf, pImageObject);
}
+ CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
CPDF_Object* pContent =
pPageDict ? pPageDict->GetDirectObjectFor("Contents") : nullptr;
if (pContent)
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
index 1470ca8e83..ce605f0dfe 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
#define CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
+#include <vector>
+
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_coordinates.h"
@@ -22,7 +24,7 @@ class CPDF_PageContentGenerator {
explicit CPDF_PageContentGenerator(CPDF_Page* pPage);
~CPDF_PageContentGenerator();
- FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);
+ void InsertPageObject(CPDF_PageObject* pPageObject);
void GenerateContent();
void TransformContent(CFX_Matrix& matrix);
@@ -37,7 +39,7 @@ class CPDF_PageContentGenerator {
CPDF_Page* m_pPage;
CPDF_Document* m_pDocument;
- CFX_ArrayTemplate<CPDF_PageObject*> m_pageObjects;
+ std::vector<CPDF_PageObject*> m_pageObjects;
};
#endif // CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_