OLD | NEW |
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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 474 } |
475 | 475 |
476 CXFA_Node* CXFA_FFWidgetHandler::CreateSubform(CXFA_Node* pParent, | 476 CXFA_Node* CXFA_FFWidgetHandler::CreateSubform(CXFA_Node* pParent, |
477 CXFA_Node* pBefore) const { | 477 CXFA_Node* pBefore) const { |
478 return CreateFormItem(XFA_Element::Subform, pParent, pBefore); | 478 return CreateFormItem(XFA_Element::Subform, pParent, pBefore); |
479 } | 479 } |
480 | 480 |
481 CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement, | 481 CXFA_Node* CXFA_FFWidgetHandler::CreateFormItem(XFA_Element eElement, |
482 CXFA_Node* pParent, | 482 CXFA_Node* pParent, |
483 CXFA_Node* pBefore) const { | 483 CXFA_Node* pBefore) const { |
484 CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : NULL; | 484 CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr; |
485 CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(FALSE); | 485 CXFA_Node* pNewFormItem = pTemplateParent->CloneTemplateToForm(FALSE); |
486 if (pParent) | 486 if (pParent) |
487 pParent->InsertChild(pNewFormItem, pBefore); | 487 pParent->InsertChild(pNewFormItem, pBefore); |
488 return pNewFormItem; | 488 return pNewFormItem; |
489 } | 489 } |
490 | 490 |
491 CXFA_Node* CXFA_FFWidgetHandler::CreateCopyNode(XFA_Element eElement, | 491 CXFA_Node* CXFA_FFWidgetHandler::CreateCopyNode(XFA_Element eElement, |
492 CXFA_Node* pParent, | 492 CXFA_Node* pParent, |
493 CXFA_Node* pBefore) const { | 493 CXFA_Node* pBefore) const { |
494 CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : NULL; | 494 CXFA_Node* pTemplateParent = pParent ? pParent->GetTemplateNode() : nullptr; |
495 CXFA_Node* pNewNode = | 495 CXFA_Node* pNewNode = |
496 CreateTemplateNode(eElement, pTemplateParent, | 496 CreateTemplateNode(eElement, pTemplateParent, |
497 pBefore ? pBefore->GetTemplateNode() : NULL) | 497 pBefore ? pBefore->GetTemplateNode() : nullptr) |
498 ->Clone(FALSE); | 498 ->Clone(FALSE); |
499 if (pParent) | 499 if (pParent) |
500 pParent->InsertChild(pNewNode, pBefore); | 500 pParent->InsertChild(pNewNode, pBefore); |
501 return pNewNode; | 501 return pNewNode; |
502 } | 502 } |
503 | 503 |
504 CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_Element eElement, | 504 CXFA_Node* CXFA_FFWidgetHandler::CreateTemplateNode(XFA_Element eElement, |
505 CXFA_Node* pParent, | 505 CXFA_Node* pParent, |
506 CXFA_Node* pBefore) const { | 506 CXFA_Node* pBefore) const { |
507 CXFA_Document* pXFADoc = GetXFADoc(); | 507 CXFA_Document* pXFADoc = GetXFADoc(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 545 } |
546 | 546 |
547 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { | 547 CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { |
548 return GetXFADoc()->GetParser()->GetFactory(); | 548 return GetXFADoc()->GetParser()->GetFactory(); |
549 } | 549 } |
550 | 550 |
551 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { | 551 CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { |
552 return m_pDocView->GetDoc()->GetXFADoc(); | 552 return m_pDocView->GetDoc()->GetXFADoc(); |
553 } | 553 } |
554 | 554 |
OLD | NEW |