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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { | 321 if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) { |
322 CPDF_Action action(pDict); | 322 CPDF_Action action(pDict); |
323 if (m_pEnv->GetActionHander()) | 323 if (m_pEnv->GetActionHander()) |
324 m_pEnv->GetActionHander()->DoAction_DocOpen(action, this); | 324 m_pEnv->GetActionHander()->DoAction_DocOpen(action, this); |
325 return TRUE; | 325 return TRUE; |
326 } | 326 } |
327 return FALSE; | 327 return FALSE; |
328 } | 328 } |
329 | 329 |
330 CPDF_OCContext* CPDFSDK_Document::GetOCContext() { | 330 CPDF_OCContext* CPDFSDK_Document::GetOCContext() { |
331 if (!m_pOccontent) | 331 if (!m_pOccontent) { |
332 m_pOccontent.reset(new CPDF_OCContext(GetPDFDocument())); | 332 m_pOccontent.reset( |
| 333 new CPDF_OCContext(GetPDFDocument(), CPDF_OCContext::View)); |
| 334 } |
333 return m_pOccontent.get(); | 335 return m_pOccontent.get(); |
334 } | 336 } |
335 | 337 |
336 void CPDFSDK_Document::RemovePageView(UnderlyingPageType* pUnderlyingPage) { | 338 void CPDFSDK_Document::RemovePageView(UnderlyingPageType* pUnderlyingPage) { |
337 auto it = m_pageMap.find(pUnderlyingPage); | 339 auto it = m_pageMap.find(pUnderlyingPage); |
338 if (it == m_pageMap.end()) | 340 if (it == m_pageMap.end()) |
339 return; | 341 return; |
340 | 342 |
341 CPDFSDK_PageView* pPageView = it->second; | 343 CPDFSDK_PageView* pPageView = it->second; |
342 if (pPageView->IsLocked()) | 344 if (pPageView->IsLocked()) |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1015 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1014 if (!pFocusAnnot) | 1016 if (!pFocusAnnot) |
1015 return nullptr; | 1017 return nullptr; |
1016 | 1018 |
1017 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1019 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1018 if (pAnnot == pFocusAnnot) | 1020 if (pAnnot == pFocusAnnot) |
1019 return pAnnot; | 1021 return pAnnot; |
1020 } | 1022 } |
1021 return nullptr; | 1023 return nullptr; |
1022 } | 1024 } |
OLD | NEW |