Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: fpdfsdk/cpdfsdk_document.cpp

Issue 2400673002: Convert CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_annothandlermgr.cpp ('k') | fpdfsdk/cpdfsdk_pageview.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = new CPDFSDK_PageView(GetEnv(), pUnderlyingPage);
67 m_pageMap[pUnderlyingPage] = pPageView; 67 m_pageMap[pUnderlyingPage] = pPageView;
68 // Delay to load all the annotations, to avoid endless loop. 68 // Delay to load all the annotations, to avoid endless loop.
69 pPageView->LoadFXAnnots(); 69 pPageView->LoadFXAnnots();
70 return pPageView; 70 return pPageView;
71 } 71 }
72 72
73 CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView() { 73 CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView() {
74 UnderlyingPageType* pPage = 74 UnderlyingPageType* pPage =
75 UnderlyingFromFPDFPage(m_pEnv->GetCurrentPage(m_pDoc)); 75 UnderlyingFromFPDFPage(m_pEnv->GetCurrentPage(m_pDoc));
76 return pPage ? GetPageView(pPage, true) : nullptr; 76 return pPage ? GetPageView(pPage, true) : nullptr;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return GetPDFDocument()->GetUserPermissions() & nFlag; 246 return GetPDFDocument()->GetUserPermissions() & nFlag;
247 } 247 }
248 248
249 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { 249 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() {
250 return m_pEnv->GetJSRuntime(); 250 return m_pEnv->GetJSRuntime();
251 } 251 }
252 252
253 CFX_WideString CPDFSDK_Document::GetPath() { 253 CFX_WideString CPDFSDK_Document::GetPath() {
254 return m_pEnv->JS_docGetFilePath(); 254 return m_pEnv->JS_docGetFilePath();
255 } 255 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_annothandlermgr.cpp ('k') | fpdfsdk/cpdfsdk_pageview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698