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

Side by Side Diff: fpdfsdk/cpdfsdk_document.cpp

Issue 2397513003: Remove m_pOccontent from CPDFSDK_Document (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_document.h ('k') | no next file » | 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698