OLD | NEW |
---|---|
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cpdfsdk_document.h" | 7 #include "fpdfsdk/cpdfsdk_document.h" |
8 | 8 |
9 #include "core/fpdfapi/parser/cpdf_array.h" | 9 #include "core/fpdfapi/parser/cpdf_array.h" |
10 #include "core/fpdfapi/parser/cpdf_dictionary.h" | 10 #include "core/fpdfapi/parser/cpdf_dictionary.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 CPDFSDK_PageView* CPDFSDK_Document::GetPageView( | 56 CPDFSDK_PageView* CPDFSDK_Document::GetPageView( |
57 UnderlyingPageType* pUnderlyingPage, | 57 UnderlyingPageType* pUnderlyingPage, |
58 bool ReNew) { | 58 bool ReNew) { |
59 auto it = m_pageMap.find(pUnderlyingPage); | 59 auto it = m_pageMap.find(pUnderlyingPage); |
60 if (it != m_pageMap.end()) | 60 if (it != m_pageMap.end()) |
61 return it->second; | 61 return it->second; |
62 | 62 |
63 if (!ReNew) | 63 if (!ReNew) |
64 return nullptr; | 64 return nullptr; |
65 | 65 |
66 CPDFSDK_PageView* pPageView = new CPDFSDK_PageView(this, pUnderlyingPage); | 66 CPDFSDK_PageView* pPageView = |
67 new CPDFSDK_PageView(this->GetEnv(), pUnderlyingPage); | |
Tom Sepez
2016/10/06 18:46:28
nit: just GetEnv()
dsinclair
2016/10/06 19:32:54
Done.
| |
67 m_pageMap[pUnderlyingPage] = pPageView; | 68 m_pageMap[pUnderlyingPage] = pPageView; |
68 // Delay to load all the annotations, to avoid endless loop. | 69 // Delay to load all the annotations, to avoid endless loop. |
69 pPageView->LoadFXAnnots(); | 70 pPageView->LoadFXAnnots(); |
70 return pPageView; | 71 return pPageView; |
71 } | 72 } |
72 | 73 |
73 CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView() { | 74 CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView() { |
74 UnderlyingPageType* pPage = | 75 UnderlyingPageType* pPage = |
75 UnderlyingFromFPDFPage(m_pEnv->GetCurrentPage(m_pDoc)); | 76 UnderlyingFromFPDFPage(m_pEnv->GetCurrentPage(m_pDoc)); |
76 return pPage ? GetPageView(pPage, true) : nullptr; | 77 return pPage ? GetPageView(pPage, true) : nullptr; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 return GetPDFDocument()->GetUserPermissions() & nFlag; | 247 return GetPDFDocument()->GetUserPermissions() & nFlag; |
247 } | 248 } |
248 | 249 |
249 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { | 250 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { |
250 return m_pEnv->GetJSRuntime(); | 251 return m_pEnv->GetJSRuntime(); |
251 } | 252 } |
252 | 253 |
253 CFX_WideString CPDFSDK_Document::GetPath() { | 254 CFX_WideString CPDFSDK_Document::GetPath() { |
254 return m_pEnv->JS_docGetFilePath(); | 255 return m_pEnv->JS_docGetFilePath(); |
255 } | 256 } |
OLD | NEW |