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

Side by Side Diff: fpdfsdk/cpdfsdk_document.cpp

Issue 2354363003: Move CPDFSDK_Environment code to cpp file (Closed)
Patch Set: Review feedback 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 | « no previous file | fpdfsdk/cpdfsdk_environment.cpp » ('j') | fpdfsdk/cpdfsdk_environment.cpp » ('J')
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/include/cpdfsdk_document.h" 7 #include "fpdfsdk/include/cpdfsdk_document.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (!pAnnotHandler->Annot_OnChangeFocus(nullptr, pFocusAnnot)) 224 if (!pAnnotHandler->Annot_OnChangeFocus(nullptr, pFocusAnnot))
225 return FALSE; 225 return FALSE;
226 #endif // PDF_ENABLE_XFA 226 #endif // PDF_ENABLE_XFA
227 227
228 if (pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag)) { 228 if (pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag)) {
229 if (pFocusAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET) { 229 if (pFocusAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET) {
230 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot; 230 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
231 int nFieldType = pWidget->GetFieldType(); 231 int nFieldType = pWidget->GetFieldType();
232 if (FIELDTYPE_TEXTFIELD == nFieldType || 232 if (FIELDTYPE_TEXTFIELD == nFieldType ||
233 FIELDTYPE_COMBOBOX == nFieldType) { 233 FIELDTYPE_COMBOBOX == nFieldType) {
234 m_pEnv->OnSetFieldInputFocus(nullptr, nullptr, 0, FALSE); 234 m_pEnv->OnSetFieldInputFocus(nullptr, 0, FALSE);
235 } 235 }
236 } 236 }
237 237
238 if (!m_pFocusAnnot) 238 if (!m_pFocusAnnot)
239 return TRUE; 239 return TRUE;
240 } else { 240 } else {
241 m_pFocusAnnot = pFocusAnnot; 241 m_pFocusAnnot = pFocusAnnot;
242 } 242 }
243 } 243 }
244 return FALSE; 244 return FALSE;
245 } 245 }
246 246
247 void CPDFSDK_Document::OnCloseDocument() { 247 void CPDFSDK_Document::OnCloseDocument() {
248 KillFocusAnnot(); 248 KillFocusAnnot();
249 } 249 }
250 250
251 FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag) { 251 FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag) {
252 return GetPDFDocument()->GetUserPermissions() & nFlag; 252 return GetPDFDocument()->GetUserPermissions() & nFlag;
253 } 253 }
254 254
255 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() { 255 IJS_Runtime* CPDFSDK_Document::GetJsRuntime() {
256 return m_pEnv->GetJSRuntime(); 256 return m_pEnv->GetJSRuntime();
257 } 257 }
258 258
259 CFX_WideString CPDFSDK_Document::GetPath() { 259 CFX_WideString CPDFSDK_Document::GetPath() {
260 return m_pEnv->JS_docGetFilePath(); 260 return m_pEnv->JS_docGetFilePath();
261 } 261 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/cpdfsdk_environment.cpp » ('j') | fpdfsdk/cpdfsdk_environment.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698