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

Side by Side Diff: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp

Issue 1890563003: Simplify XFA event handling. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments Created 4 years, 8 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/fpdfxfa/include/fpdfxfa_doc.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 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/fpdfxfa/include/fpdfxfa_doc.h" 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.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_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 : FXFA_PAGEVIEWEVENT_POSTADDED; 514 : FXFA_PAGEVIEWEVENT_POSTADDED;
515 int count = FXSYS_abs(nNewCount - m_nPageCount); 515 int count = FXSYS_abs(nNewCount - m_nPageCount);
516 m_nPageCount = nNewCount; 516 m_nPageCount = nNewCount;
517 m_XFAPageList.SetSize(nNewCount); 517 m_XFAPageList.SetSize(nNewCount);
518 pEnv->FFI_PageEvent(count, flag); 518 pEnv->FFI_PageEvent(count, flag);
519 } 519 }
520 } 520 }
521 521
522 void CPDFXFA_Document::WidgetEvent(CXFA_FFWidget* hWidget, 522 void CPDFXFA_Document::WidgetEvent(CXFA_FFWidget* hWidget,
523 CXFA_WidgetAcc* pWidgetData, 523 CXFA_WidgetAcc* pWidgetData,
524 uint32_t dwEvent, 524 uint32_t dwEvent) {
525 void* pParam,
526 void* pAdditional) {
527 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget) 525 if (m_iDocType != DOCTYPE_DYNAMIC_XFA || !hWidget)
528 return; 526 return;
529 527
530 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 528 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
531 if (!pEnv) 529 if (!pEnv)
532 return; 530 return;
533 531
534 CXFA_FFPageView* pPageView = hWidget->GetPageView(); 532 CXFA_FFPageView* pPageView = hWidget->GetPageView();
535 if (!pPageView) 533 if (!pPageView)
536 return; 534 return;
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 } 1268 }
1271 1269
1272 return _GetHValueByName(szPropName, hValue, 1270 return _GetHValueByName(szPropName, hValue,
1273 m_pSDKDoc->GetEnv()->GetJSRuntime()); 1271 m_pSDKDoc->GetEnv()->GetJSRuntime());
1274 } 1272 }
1275 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, 1273 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name,
1276 FXJSE_HVALUE hValue, 1274 FXJSE_HVALUE hValue,
1277 IJS_Runtime* runTime) { 1275 IJS_Runtime* runTime) {
1278 return runTime->GetHValueByName(utf8Name, hValue); 1276 return runTime->GetHValueByName(utf8Name, hValue);
1279 } 1277 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698