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

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp

Issue 1804163002: FPDF_PageDelete must delete XFA pages as well. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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 | « fpdfsdk/fpdfeditpage.cpp ('k') | fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index ede9b7e8924b838412b8f9d0f9f5be3b9289f7a5..ea411ae7580bbcc9aa6d2cb2f91dad955a0ca2b8 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -182,6 +182,14 @@ CPDFXFA_Page* CPDFXFA_Document::GetPage(IXFA_PageView* pPage) {
return NULL;
}
+void CPDFXFA_Document::DeletePage(int page_index) {
+ if (page_index < 0 || page_index >= m_XFAPageList.GetSize())
+ return;
+
+ if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index))
+ pPage->Release();
dsinclair 2016/03/15 18:50:59 Does this need to set m_XFAPageList[page_index] ==
Tom Sepez 2016/03/15 19:21:54 No, because CPDFXFA_Page::Release() will call into
+}
+
void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) {
m_XFAPageList.SetAt(page->GetPageIndex(), NULL);
}
« no previous file with comments | « fpdfsdk/fpdfeditpage.cpp ('k') | fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698