diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-08-19 17:17:04 -0700 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-08-19 17:17:04 -0700 |
commit | 93d081110279c309433a397bfba71b46533a710d (patch) | |
tree | 7f279b7d4c5af7d815e861d80e76cbad2fef0034 /core/src | |
parent | 8cf33bc76455afda7c65f61e70899754a6186d2c (diff) | |
download | pdfium-93d081110279c309433a397bfba71b46533a710d.tar.xz |
Fix bug in CPDF_PageContentGenerate constructor and destructor
m_pageObjects never gets initialize, thus making CPDF_PageContentGenerate::GenerateContent() doing nothing.
Since the CPFD_PageObject are owned by m_pPage, no need to release them in the destructor.
BUG=385119
R=thestig@chromium.org, vitalybuka@chromium.org
Review URL: https://codereview.chromium.org/470253004
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index e33a99ba63..e8c051b434 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,13 @@ 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) { + InsertPageObject(pPage->GetNextObject(pos)); + } } 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) { |