summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-15 12:43:09 -0700
committerTom Sepez <tsepez@chromium.org>2016-03-15 12:43:09 -0700
commit744da70149c450d2f387a1fa325a3074ac2edb0c (patch)
tree91889184989b49e0899a110aab9808efaea4ca14 /fpdfsdk/fpdfxfa
parent3a8051c8cb55e3c108c1f860dc743c42827ae4fa (diff)
downloadpdfium-744da70149c450d2f387a1fa325a3074ac2edb0c.tar.xz
FPDF_PageDelete must delete XFA pages as well.
Currently, it is only deleting the CPDF_ resources, which are wrapped by XFA objects in an XFA build. Hence, if a page is deleted and then re-inserted, we get the old contents. In print preview, chromium first inserts blank pages and then replaces them later on, causing the associated bug. BUG=594111 R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1804163002 .
Diffstat (limited to 'fpdfsdk/fpdfxfa')
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index 144e5dc811..6e0edf646e 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();
+}
+
void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) {
m_XFAPageList.SetAt(page->GetPageIndex(), NULL);
}