Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp

Issue 470253004: Fix bug in CPDF_PageContentGenerate constructor and destructor (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e8c051b4341f0b429c7910e28e72b37e3a6b4e83 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)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698