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

Side by Side 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: rebase past rename 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfeditpage.cpp ('k') | fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_string.h"
10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" 10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 CPDFXFA_Page* pTempPage = m_XFAPageList.GetAt(i); 175 CPDFXFA_Page* pTempPage = m_XFAPageList.GetAt(i);
176 if (!pTempPage) 176 if (!pTempPage)
177 continue; 177 continue;
178 if (pTempPage->GetXFAPageView() && pTempPage->GetXFAPageView() == pPage) 178 if (pTempPage->GetXFAPageView() && pTempPage->GetXFAPageView() == pPage)
179 return pTempPage; 179 return pTempPage;
180 } 180 }
181 181
182 return NULL; 182 return NULL;
183 } 183 }
184 184
185 void CPDFXFA_Document::DeletePage(int page_index) {
186 if (page_index < 0 || page_index >= m_XFAPageList.GetSize())
187 return;
188
189 if (CPDFXFA_Page* pPage = m_XFAPageList.GetAt(page_index))
190 pPage->Release();
191 }
192
185 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) { 193 void CPDFXFA_Document::RemovePage(CPDFXFA_Page* page) {
186 m_XFAPageList.SetAt(page->GetPageIndex(), NULL); 194 m_XFAPageList.SetAt(page->GetPageIndex(), NULL);
187 } 195 }
188 196
189 CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument( 197 CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument(
190 CPDFDoc_Environment* pFormFillEnv) { 198 CPDFDoc_Environment* pFormFillEnv) {
191 if (!m_pSDKDoc && pFormFillEnv) 199 if (!m_pSDKDoc && pFormFillEnv)
192 m_pSDKDoc = new CPDFSDK_Document(this, pFormFillEnv); 200 m_pSDKDoc = new CPDFSDK_Document(this, pFormFillEnv);
193 return m_pSDKDoc; 201 return m_pSDKDoc;
194 } 202 }
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 } 1255 }
1248 1256
1249 return _GetHValueByName(szPropName, hValue, 1257 return _GetHValueByName(szPropName, hValue,
1250 m_pSDKDoc->GetEnv()->GetJSRuntime()); 1258 m_pSDKDoc->GetEnv()->GetJSRuntime());
1251 } 1259 }
1252 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, 1260 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name,
1253 FXJSE_HVALUE hValue, 1261 FXJSE_HVALUE hValue,
1254 IJS_Runtime* runTime) { 1262 IJS_Runtime* runTime) {
1255 return runTime->GetHValueByName(utf8Name, hValue); 1263 return runTime->GetHValueByName(utf8Name, hValue);
1256 } 1264 }
OLDNEW
« 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