Chromium Code Reviews| 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 "fpdfsdk/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 return pPage ? GetPageView(pPage, true) : nullptr; | 292 return pPage ? GetPageView(pPage, true) : nullptr; |
| 293 } | 293 } |
| 294 | 294 |
| 295 CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex) { | 295 CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex) { |
| 296 UnderlyingPageType* pTempPage = | 296 UnderlyingPageType* pTempPage = |
| 297 UnderlyingFromFPDFPage(m_pEnv->FFI_GetPage(m_pDoc, nIndex)); | 297 UnderlyingFromFPDFPage(m_pEnv->FFI_GetPage(m_pDoc, nIndex)); |
| 298 if (!pTempPage) | 298 if (!pTempPage) |
| 299 return nullptr; | 299 return nullptr; |
| 300 | 300 |
| 301 auto it = m_pageMap.find(pTempPage); | 301 auto it = m_pageMap.find(pTempPage); |
| 302 return it->second; | 302 #ifdef PDF_ENABLE_XFA |
| 303 pTempPage->Release(); | |
|
Tom Sepez
2016/08/22 19:42:51
might this cause the page to be removed from the m
| |
| 304 #endif | |
| 305 return it == m_pageMap.end() ? nullptr : it->second; | |
| 303 } | 306 } |
| 304 | 307 |
| 305 void CPDFSDK_Document::ProcJavascriptFun() { | 308 void CPDFSDK_Document::ProcJavascriptFun() { |
| 306 CPDF_Document* pPDFDoc = GetPDFDocument(); | 309 CPDF_Document* pPDFDoc = GetPDFDocument(); |
| 307 CPDF_DocJSActions docJS(pPDFDoc); | 310 CPDF_DocJSActions docJS(pPDFDoc); |
| 308 int iCount = docJS.CountJSActions(); | 311 int iCount = docJS.CountJSActions(); |
| 309 if (iCount < 1) | 312 if (iCount < 1) |
| 310 return; | 313 return; |
| 311 for (int i = 0; i < iCount; i++) { | 314 for (int i = 0; i < iCount; i++) { |
| 312 CFX_ByteString csJSName; | 315 CFX_ByteString csJSName; |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1057 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { | 1060 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { |
| 1058 #ifdef PDF_ENABLE_XFA | 1061 #ifdef PDF_ENABLE_XFA |
| 1059 CPDF_Page* pPage = m_page->GetPDFPage(); | 1062 CPDF_Page* pPage = m_page->GetPDFPage(); |
| 1060 #else // PDF_ENABLE_XFA | 1063 #else // PDF_ENABLE_XFA |
| 1061 CPDF_Page* pPage = m_page; | 1064 CPDF_Page* pPage = m_page; |
| 1062 #endif // PDF_ENABLE_XFA | 1065 #endif // PDF_ENABLE_XFA |
| 1063 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 1066 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
| 1064 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); | 1067 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); |
| 1065 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; | 1068 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; |
| 1066 } | 1069 } |
| OLD | NEW |