summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-17 16:46:26 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-17 16:46:26 -0800
commit2398d8938277a2492b411f8f807bf1935918ccae (patch)
tree0f8c13509e23d6a0ea80d461ab803fae62a4638f /core/src/fpdfapi/fpdf_edit
parentefbc1912f10f5a53e7df3a24ebfd6b78412f0bba (diff)
downloadpdfium-2398d8938277a2492b411f8f807bf1935918ccae.tar.xz
Remove CFX_PtrList from renderer main loop.
Exposes an iterator over the object list, but not the object holder, since pages and forms inherit from object holder, and we don't want to imply that there's only one thing that might be iterated over for those classes. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1700183002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 82ab370564..ef0344cda0 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -14,25 +14,18 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& ar, CFX_Matrix& matrix) {
<< matrix.e << " " << matrix.f;
return ar;
}
+
CPDF_PageContentGenerator::CPDF_PageContentGenerator(CPDF_Page* pPage)
- : m_pPage(pPage) {
- m_pDocument = NULL;
- if (m_pPage) {
- m_pDocument = m_pPage->m_pDocument;
- }
- FX_POSITION pos = pPage->GetPageObjectList()->GetHeadPosition();
- while (pos) {
- InsertPageObject(pPage->GetPageObjectList()->GetNextObject(pos));
- }
+ : m_pPage(pPage), m_pDocument(m_pPage->m_pDocument) {
+ for (const auto& pObj : *pPage->GetPageObjectList())
+ InsertPageObject(pObj.get());
}
-CPDF_PageContentGenerator::~CPDF_PageContentGenerator() {}
+
FX_BOOL CPDF_PageContentGenerator::InsertPageObject(
CPDF_PageObject* pPageObject) {
- if (!pPageObject) {
- return FALSE;
- }
- return m_pageObjects.Add(pPageObject);
+ return pPageObject && m_pageObjects.Add(pPageObject);
}
+
void CPDF_PageContentGenerator::GenerateContent() {
CFX_ByteTextBuf buf;
CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;