| 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_serialize.h" | 7 #include "xfa/fxfa/parser/xfa_document_serialize.h" |
| 8 | 8 |
| 9 #include "xfa/fgas/crt/fgas_codepage.h" | 9 #include "xfa/fgas/crt/fgas_codepage.h" |
| 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 eVersion = XFA_VERSION_DEFAULT; | 204 eVersion = XFA_VERSION_DEFAULT; |
| 205 } | 205 } |
| 206 wsVersionNumber.Format(L"%i.%i", eVersion / 100, eVersion % 100); | 206 wsVersionNumber.Format(L"%i.%i", eVersion / 100, eVersion % 100); |
| 207 } | 207 } |
| 208 static void XFA_DataExporter_RegenerateFormFile_Changed( | 208 static void XFA_DataExporter_RegenerateFormFile_Changed( |
| 209 CXFA_Node* pNode, | 209 CXFA_Node* pNode, |
| 210 CFX_WideTextBuf& buf, | 210 CFX_WideTextBuf& buf, |
| 211 FX_BOOL bSaveXML = FALSE) { | 211 FX_BOOL bSaveXML = FALSE) { |
| 212 CFX_WideString wsAttrs; | 212 CFX_WideString wsAttrs; |
| 213 int32_t iAttrs = 0; | 213 int32_t iAttrs = 0; |
| 214 const uint8_t* pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs); | 214 const uint8_t* pAttrs = |
| 215 XFA_GetObjectByAttributes(pNode->GetClassID(), iAttrs); |
| 215 while (iAttrs--) { | 216 while (iAttrs--) { |
| 216 const XFA_ATTRIBUTEINFO* pAttr = | 217 const XFA_ATTRIBUTEINFO* pAttr = |
| 217 XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); | 218 XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); |
| 218 if (pAttr->eName == XFA_ATTRIBUTE_Name || | 219 if (pAttr->eName == XFA_ATTRIBUTE_Name || |
| 219 (XFA_DataExporter_AttributeSaveInDataModel(pNode, pAttr->eName) && | 220 (XFA_DataExporter_AttributeSaveInDataModel(pNode, pAttr->eName) && |
| 220 !bSaveXML)) { | 221 !bSaveXML)) { |
| 221 continue; | 222 continue; |
| 222 } | 223 } |
| 223 CFX_WideString wsAttr; | 224 CFX_WideString wsAttr; |
| 224 XFA_SaveAttribute(pNode, pAttr->eName, pAttr->pName, bSaveXML, wsAttr); | 225 XFA_SaveAttribute(pNode, pAttr->eName, pAttr->pName, bSaveXML, wsAttr); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 390 } |
| 390 CFX_WideStringC wsElement; | 391 CFX_WideStringC wsElement; |
| 391 pNode->GetClassName(wsElement); | 392 pNode->GetClassName(wsElement); |
| 392 pStream->WriteString(L"<", 1); | 393 pStream->WriteString(L"<", 1); |
| 393 pStream->WriteString(wsElement.GetPtr(), wsElement.GetLength()); | 394 pStream->WriteString(wsElement.GetPtr(), wsElement.GetLength()); |
| 394 CFX_WideString wsOutput; | 395 CFX_WideString wsOutput; |
| 395 XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, | 396 XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, |
| 396 wsOutput); | 397 wsOutput); |
| 397 CFX_WideString wsAttrs; | 398 CFX_WideString wsAttrs; |
| 398 int32_t iAttrs = 0; | 399 int32_t iAttrs = 0; |
| 399 const uint8_t* pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs); | 400 const uint8_t* pAttrs = |
| 401 XFA_GetObjectByAttributes(pNode->GetClassID(), iAttrs); |
| 400 while (iAttrs--) { | 402 while (iAttrs--) { |
| 401 const XFA_ATTRIBUTEINFO* pAttr = | 403 const XFA_ATTRIBUTEINFO* pAttr = |
| 402 XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); | 404 XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]); |
| 403 if (pAttr->eName == XFA_ATTRIBUTE_Name) { | 405 if (pAttr->eName == XFA_ATTRIBUTE_Name) { |
| 404 continue; | 406 continue; |
| 405 } | 407 } |
| 406 CFX_WideString wsAttr; | 408 CFX_WideString wsAttr; |
| 407 XFA_SaveAttribute(pNode, pAttr->eName, pAttr->pName, FALSE, wsAttr); | 409 XFA_SaveAttribute(pNode, pAttr->eName, pAttr->pName, FALSE, wsAttr); |
| 408 wsOutput += wsAttr; | 410 wsOutput += wsAttr; |
| 409 } | 411 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 pXMLElement->RemoveAttribute(L"xfa:dataNode"); | 583 pXMLElement->RemoveAttribute(L"xfa:dataNode"); |
| 582 } | 584 } |
| 583 } else { | 585 } else { |
| 584 IFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); | 586 IFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); |
| 585 FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); | 587 FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); |
| 586 ((IFDE_XMLElement*)pXMLNode) | 588 ((IFDE_XMLElement*)pXMLNode) |
| 587 ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); | 589 ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); |
| 588 } | 590 } |
| 589 } | 591 } |
| 590 } | 592 } |
| OLD | NEW |