OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |