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_ffdocview.h" | 7 #include "xfa/fxfa/include/xfa_ffdocview.h" |
8 | 8 |
9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
10 #include "xfa/fxfa/app/xfa_ffbarcode.h" | 10 #include "xfa/fxfa/app/xfa_ffbarcode.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 CXFA_Node* pRootItem = | 714 CXFA_Node* pRootItem = |
715 ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form)); | 715 ToNode(m_pDoc->GetXFADoc()->GetXFAObject(XFA_HASHCODE_Form)); |
716 if (!pRootItem) { | 716 if (!pRootItem) { |
717 return FALSE; | 717 return FALSE; |
718 } | 718 } |
719 ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready); | 719 ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_Ready); |
720 RunLayout(); | 720 RunLayout(); |
721 return TRUE; | 721 return TRUE; |
722 } | 722 } |
723 void CXFA_FFDocView::RunBindItems() { | 723 void CXFA_FFDocView::RunBindItems() { |
724 int32_t iCount = m_BindItems.GetSize(); | 724 for (int32_t i = 0; i < m_BindItems.GetSize(); i++) { |
725 for (int32_t i = 0; i < iCount; i++) { | |
726 if (m_BindItems[i]->HasFlag(XFA_NODEFLAG_HasRemoved)) | 725 if (m_BindItems[i]->HasFlag(XFA_NODEFLAG_HasRemoved)) |
727 continue; | 726 continue; |
728 | 727 |
729 CXFA_Node* pWidgetNode = m_BindItems[i]->GetNodeItem(XFA_NODEITEM_Parent); | 728 CXFA_Node* pWidgetNode = m_BindItems[i]->GetNodeItem(XFA_NODEITEM_Parent); |
730 CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pWidgetNode->GetWidgetData(); | 729 CXFA_WidgetAcc* pAcc = (CXFA_WidgetAcc*)pWidgetNode->GetWidgetData(); |
731 if (!pAcc) | 730 if (!pAcc) |
732 continue; | 731 continue; |
733 | 732 |
734 CXFA_BindItems binditems(m_BindItems[i]); | 733 CXFA_BindItems binditems(m_BindItems[i]); |
735 CXFA_ScriptContext* pScriptContext = | 734 CXFA_ScriptContext* pScriptContext = |
(...skipping 14 matching lines...) Expand all Loading... |
750 binditems.GetValueRef(wsValueRef); | 749 binditems.GetValueRef(wsValueRef); |
751 binditems.GetLabelRef(wsLabelRef); | 750 binditems.GetLabelRef(wsLabelRef); |
752 const bool bUseValue = wsLabelRef.IsEmpty() || wsLabelRef == wsValueRef; | 751 const bool bUseValue = wsLabelRef.IsEmpty() || wsLabelRef == wsValueRef; |
753 const bool bLabelUseContent = | 752 const bool bLabelUseContent = |
754 wsLabelRef.IsEmpty() || wsLabelRef == FX_WSTRC(L"$"); | 753 wsLabelRef.IsEmpty() || wsLabelRef == FX_WSTRC(L"$"); |
755 const bool bValueUseContent = | 754 const bool bValueUseContent = |
756 wsValueRef.IsEmpty() || wsValueRef == FX_WSTRC(L"$"); | 755 wsValueRef.IsEmpty() || wsValueRef == FX_WSTRC(L"$"); |
757 CFX_WideString wsValue; | 756 CFX_WideString wsValue; |
758 CFX_WideString wsLabel; | 757 CFX_WideString wsLabel; |
759 uint32_t uValueHash = FX_HashCode_GetW(wsValueRef, false); | 758 uint32_t uValueHash = FX_HashCode_GetW(wsValueRef, false); |
760 for (int32_t i = 0; i < iCount; i++) { | 759 for (int32_t j = 0; j < iCount; j++) { |
761 CXFA_Object* refObj = rs.nodes[i]; | 760 CXFA_Object* refObj = rs.nodes[j]; |
762 if (!refObj->IsNode()) { | 761 if (!refObj->IsNode()) { |
763 continue; | 762 continue; |
764 } | 763 } |
765 CXFA_Node* refNode = refObj->AsNode(); | 764 CXFA_Node* refNode = refObj->AsNode(); |
766 if (bValueUseContent) { | 765 if (bValueUseContent) { |
767 wsValue = refNode->GetContent(); | 766 wsValue = refNode->GetContent(); |
768 } else { | 767 } else { |
769 CXFA_Node* nodeValue = refNode->GetFirstChildByName(uValueHash); | 768 CXFA_Node* nodeValue = refNode->GetFirstChildByName(uValueHash); |
770 if (nodeValue == NULL) { | 769 if (nodeValue == NULL) { |
771 wsValue = refNode->GetContent(); | 770 wsValue = refNode->GetContent(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { | 837 CXFA_WidgetAcc* CXFA_WidgetAccIterator::GetCurrentWidgetAcc() { |
839 return NULL; | 838 return NULL; |
840 } | 839 } |
841 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { | 840 FX_BOOL CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { |
842 return FALSE; | 841 return FALSE; |
843 } | 842 } |
844 void CXFA_WidgetAccIterator::SkipTree() { | 843 void CXFA_WidgetAccIterator::SkipTree() { |
845 m_ContentIterator.SkipChildrenAndMoveToNext(); | 844 m_ContentIterator.SkipChildrenAndMoveToNext(); |
846 m_pCurWidgetAcc = NULL; | 845 m_pCurWidgetAcc = NULL; |
847 } | 846 } |
OLD | NEW |