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

Side by Side Diff: xfa/fxfa/app/xfa_ffwidgethandler.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 | « xfa/fxfa/app/xfa_ffwidgetacc.cpp ('k') | xfa/fxfa/include/fxfa.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 "xfa/fxfa/include/xfa_ffwidgethandler.h" 7 #include "xfa/fxfa/include/xfa_ffwidgethandler.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 CXFA_FFWidget* hBefore) { 257 CXFA_FFWidget* hBefore) {
258 CXFA_Node* pParentFormItem = 258 CXFA_Node* pParentFormItem =
259 hParent ? hParent->GetDataAcc()->GetNode() : nullptr; 259 hParent ? hParent->GetDataAcc()->GetNode() : nullptr;
260 CXFA_Node* pBeforeFormItem = 260 CXFA_Node* pBeforeFormItem =
261 hBefore ? hBefore->GetDataAcc()->GetNode() : nullptr; 261 hBefore ? hBefore->GetDataAcc()->GetNode() : nullptr;
262 CXFA_Node* pNewFormItem = 262 CXFA_Node* pNewFormItem =
263 CreateWidgetFormItem(eType, pParentFormItem, pBeforeFormItem); 263 CreateWidgetFormItem(eType, pParentFormItem, pBeforeFormItem);
264 if (!pNewFormItem) 264 if (!pNewFormItem)
265 return nullptr; 265 return nullptr;
266 266
267 pNewFormItem->GetTemplateNode()->SetFlag(XFA_NODEFLAG_Initialized); 267 pNewFormItem->GetTemplateNode()->SetFlag(XFA_NODEFLAG_Initialized, true);
268 pNewFormItem->SetFlag(XFA_NODEFLAG_Initialized); 268 pNewFormItem->SetFlag(XFA_NODEFLAG_Initialized, true);
269 m_pDocView->RunLayout(); 269 m_pDocView->RunLayout();
270 CXFA_LayoutItem* pLayout = 270 CXFA_LayoutItem* pLayout =
271 m_pDocView->GetXFALayout()->GetLayoutItem(pNewFormItem); 271 m_pDocView->GetXFALayout()->GetLayoutItem(pNewFormItem);
272 return (CXFA_FFWidget*)pLayout; 272 return (CXFA_FFWidget*)pLayout;
273 } 273 }
274 274
275 CXFA_Node* CXFA_FFWidgetHandler::CreateWidgetFormItem( 275 CXFA_Node* CXFA_FFWidgetHandler::CreateWidgetFormItem(
276 XFA_WIDGETTYPE eType, 276 XFA_WIDGETTYPE eType,
277 CXFA_Node* pParent, 277 CXFA_Node* pParent,
278 CXFA_Node* pBefore) const { 278 CXFA_Node* pBefore) const {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { 548 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const {
549 return GetXFADoc()->GetParser()->GetFactory(); 549 return GetXFADoc()->GetParser()->GetFactory();
550 } 550 }
551 551
552 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { 552 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const {
553 return ((CXFA_FFDoc*)(m_pDocView->GetDoc()))->GetXFADoc(); 553 return ((CXFA_FFDoc*)(m_pDocView->GetDoc()))->GetXFADoc();
554 } 554 }
555 555
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidgetacc.cpp ('k') | xfa/fxfa/include/fxfa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698