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

Unified Diff: fpdfsdk/fpdfeditpage.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 | « no previous file | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('j') | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfeditpage.cpp
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp
index 992f08eb8b5b1a7a10845154122e6bdc85af7cee..15c2cb69d4eab87db5403e011a1b6c937e91660f 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdfeditpage.cpp
@@ -56,11 +56,8 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() {
}
DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) {
- CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
- if (!pDoc || page_index < 0 || page_index >= pDoc->GetPageCount())
- return;
-
- pDoc->DeletePage(page_index);
+ if (UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document))
+ pDoc->DeletePage(page_index);
}
DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document,
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('j') | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698