Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp |
| diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp |
| index e33a99ba63fb42dfa3756f1a371f2f7e735d2668..dfb11e4bb81dd77f8051e8d01fe7889bba47f9e6 100644 |
| --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp |
| +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp |
| @@ -1,7 +1,7 @@ |
| // Copyright 2014 PDFium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| - |
| + |
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| #include "../../../include/fpdfapi/fpdf_page.h" |
| @@ -20,15 +20,16 @@ CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) : m_pPage(p |
| if (m_pPage) { |
| m_pDocument = m_pPage->m_pDocument; |
| } |
| + FX_POSITION pos = pPage->GetFirstObjectPosition(); |
| + while (pos) { |
| + if (CPDF_PageObject* pPageObj = pPage->GetNextObject(pos)) { |
|
Lei Zhang
2014/08/20 00:04:22
Do you need the if statement? InsertPageObject() c
Bo Xu
2014/08/20 00:16:57
Right, it's not needed.
|
| + InsertPageObject(pPageObj); |
| + } |
| + } |
| + |
| } |
| CPDF_PageContentGenerate::~CPDF_PageContentGenerate() |
| { |
| - for (int i = 0; i < m_pageObjects.GetSize(); ++i) { |
| - CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i]; |
| - if (pPageObj) { |
| - pPageObj->Release(); |
| - } |
| - } |
| } |
| FX_BOOL CPDF_PageContentGenerate::InsertPageObject(CPDF_PageObject* pPageObject) |
| { |