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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { | 122 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { |
123 CPDF_Action action(pDict); | 123 CPDF_Action action(pDict); |
124 if (m_pEnv->GetActionHander()) | 124 if (m_pEnv->GetActionHander()) |
125 m_pEnv->GetActionHander()->DoAction_DocOpen(action, this); | 125 m_pEnv->GetActionHander()->DoAction_DocOpen(action, this); |
126 return TRUE; | 126 return TRUE; |
127 } | 127 } |
128 return FALSE; | 128 return FALSE; |
129 } | 129 } |
130 | 130 |
131 CPDF_OCContext* CPDFSDK_Document::GetOCContext() { | |
132 if (!m_pOccontent) { | |
133 m_pOccontent.reset( | |
134 new CPDF_OCContext(GetPDFDocument(), CPDF_OCContext::View)); | |
135 } | |
136 return m_pOccontent.get(); | |
137 } | |
138 | |
139 void CPDFSDK_Document::RemovePageView(UnderlyingPageType* pUnderlyingPage) { | 131 void CPDFSDK_Document::RemovePageView(UnderlyingPageType* pUnderlyingPage) { |
140 auto it = m_pageMap.find(pUnderlyingPage); | 132 auto it = m_pageMap.find(pUnderlyingPage); |
141 if (it == m_pageMap.end()) | 133 if (it == m_pageMap.end()) |
142 return; | 134 return; |
143 | 135 |
144 CPDFSDK_PageView* pPageView = it->second; | 136 CPDFSDK_PageView* pPageView = it->second; |
145 if (pPageView->IsLocked() || pPageView->IsBeingDestroyed()) | 137 if (pPageView->IsLocked() || pPageView->IsBeingDestroyed()) |
146 return; | 138 return; |
147 | 139 |
148 // Mark the page view so we do not come into |RemovePageView| a second | 140 // Mark the page view so we do not come into |RemovePageView| a second |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return GetPDFDocument()->GetUserPermissions() & nFlag; | 246 return GetPDFDocument()->GetUserPermissions() & nFlag; |
255 } | 247 } |
256 | 248 |
257 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { | 249 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { |
258 return m_pEnv->GetJSRuntime(); | 250 return m_pEnv->GetJSRuntime(); |
259 } | 251 } |
260 | 252 |
261 CFX_WideString CPDFSDK_Document::GetPath() { | 253 CFX_WideString CPDFSDK_Document::GetPath() { |
262 return m_pEnv->JS_docGetFilePath(); | 254 return m_pEnv->JS_docGetFilePath(); |
263 } | 255 } |
OLD | NEW |