| 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/parser/xfa_document_datamerger_imp.h" | 7 #include "xfa/fxfa/parser/xfa_document_datamerger_imp.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/include/fx_ext.h" | 9 #include "core/fxcrt/include/fx_ext.h" |
| 10 #include "xfa/fde/xml/fde_xml_imp.h" | 10 #include "xfa/fde/xml/fde_xml_imp.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CXFA_Node* pDataNode, | 105 CXFA_Node* pDataNode, |
| 106 FX_BOOL bDataToForm = TRUE) { | 106 FX_BOOL bDataToForm = TRUE) { |
| 107 pFormNode->SetObject(XFA_ATTRIBUTE_BindingNode, pDataNode); | 107 pFormNode->SetObject(XFA_ATTRIBUTE_BindingNode, pDataNode); |
| 108 pDataNode->AddBindItem(pFormNode); | 108 pDataNode->AddBindItem(pFormNode); |
| 109 XFA_ELEMENT eClass = pFormNode->GetClassID(); | 109 XFA_ELEMENT eClass = pFormNode->GetClassID(); |
| 110 if (eClass != XFA_ELEMENT_Field && eClass != XFA_ELEMENT_ExclGroup) { | 110 if (eClass != XFA_ELEMENT_Field && eClass != XFA_ELEMENT_ExclGroup) { |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 CXFA_WidgetData* pWidgetData = pFormNode->GetWidgetData(); | 113 CXFA_WidgetData* pWidgetData = pFormNode->GetWidgetData(); |
| 114 ASSERT(pWidgetData); | 114 ASSERT(pWidgetData); |
| 115 FX_BOOL bNotify = FALSE; | |
| 116 XFA_ELEMENT eUIType = pWidgetData->GetUIType(); | 115 XFA_ELEMENT eUIType = pWidgetData->GetUIType(); |
| 117 CXFA_Value defValue(pFormNode->GetProperty(0, XFA_ELEMENT_Value)); | 116 CXFA_Value defValue(pFormNode->GetProperty(0, XFA_ELEMENT_Value)); |
| 118 if (!bDataToForm) { | 117 if (!bDataToForm) { |
| 119 CFX_WideString wsValue; | 118 CFX_WideString wsValue; |
| 120 CFX_WideString wsFormatedValue; | 119 CFX_WideString wsFormatedValue; |
| 121 switch (eUIType) { | 120 switch (eUIType) { |
| 122 case XFA_ELEMENT_ImageEdit: { | 121 case XFA_ELEMENT_ImageEdit: { |
| 123 CXFA_Image image = defValue.GetImage(); | 122 CXFA_Image image = defValue.GetImage(); |
| 124 CFX_WideString wsContentType; | 123 CFX_WideString wsContentType; |
| 125 CFX_WideString wsHref; | 124 CFX_WideString wsHref; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 XFA_DataMerge_FormValueNode_SetChildContent( | 304 XFA_DataMerge_FormValueNode_SetChildContent( |
| 306 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_Text); | 305 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_Text); |
| 307 } | 306 } |
| 308 break; | 307 break; |
| 309 case XFA_ELEMENT_CheckButton: | 308 case XFA_ELEMENT_CheckButton: |
| 310 XFA_DataMerge_FormValueNode_SetChildContent( | 309 XFA_DataMerge_FormValueNode_SetChildContent( |
| 311 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_Text); | 310 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_Text); |
| 312 break; | 311 break; |
| 313 case XFA_ELEMENT_ExclGroup: { | 312 case XFA_ELEMENT_ExclGroup: { |
| 314 pWidgetData->SetSelectedMemberByValue(wsNormailizeValue.AsStringC(), | 313 pWidgetData->SetSelectedMemberByValue(wsNormailizeValue.AsStringC(), |
| 315 bNotify, FALSE, FALSE); | 314 false, FALSE, FALSE); |
| 316 } break; | 315 } break; |
| 317 case XFA_ELEMENT_DateTimeEdit: | 316 case XFA_ELEMENT_DateTimeEdit: |
| 318 XFA_DataMerge_FormValueNode_SetChildContent( | 317 XFA_DataMerge_FormValueNode_SetChildContent( |
| 319 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_DateTime); | 318 defValue.GetNode(), wsNormailizeValue, XFA_ELEMENT_DateTime); |
| 320 break; | 319 break; |
| 321 case XFA_ELEMENT_NumericEdit: { | 320 case XFA_ELEMENT_NumericEdit: { |
| 322 CFX_WideString wsPicture; | 321 CFX_WideString wsPicture; |
| 323 pWidgetData->GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind); | 322 pWidgetData->GetPictureContent(wsPicture, XFA_VALUEPICTURE_DataBind); |
| 324 if (wsPicture.IsEmpty()) { | 323 if (wsPicture.IsEmpty()) { |
| 325 CFX_WideString wsOutput; | 324 CFX_WideString wsOutput; |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 } | 1412 } |
| 1414 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); | 1413 pFormRoot->SetObject(XFA_ATTRIBUTE_BindingNode, NULL); |
| 1415 } | 1414 } |
| 1416 XFA_DataMerge_ClearGlobalBinding(this); | 1415 XFA_DataMerge_ClearGlobalBinding(this); |
| 1417 if (bDoDataMerge) { | 1416 if (bDoDataMerge) { |
| 1418 DoDataMerge(); | 1417 DoDataMerge(); |
| 1419 } | 1418 } |
| 1420 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); | 1419 CXFA_LayoutProcessor* pLayoutProcessor = GetLayoutProcessor(); |
| 1421 pLayoutProcessor->SetForceReLayout(TRUE); | 1420 pLayoutProcessor->SetForceReLayout(TRUE); |
| 1422 } | 1421 } |
| OLD | NEW |