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/fde/xml/fde_xml_imp.h" | 9 #include "xfa/fde/xml/fde_xml_imp.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, | 329 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, |
330 bSaveXML); | 330 bSaveXML); |
331 wsChildren += newBuf.AsStringC(); | 331 wsChildren += newBuf.AsStringC(); |
332 newBuf.Clear(); | 332 newBuf.Clear(); |
333 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 333 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
334 } | 334 } |
335 if (!bSaveXML && !wsChildren.IsEmpty() && | 335 if (!bSaveXML && !wsChildren.IsEmpty() && |
336 pNode->GetClassID() == XFA_ELEMENT_Items) { | 336 pNode->GetClassID() == XFA_ELEMENT_Items) { |
337 wsChildren.clear(); | 337 wsChildren.clear(); |
338 bSaveXML = TRUE; | 338 bSaveXML = TRUE; |
339 CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 339 CXFA_Node* pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
340 while (pChildNode) { | 340 while (pChild) { |
341 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, | 341 XFA_DataExporter_RegenerateFormFile_Changed(pChild, newBuf, bSaveXML); |
342 bSaveXML); | |
343 wsChildren += newBuf.AsStringC(); | 342 wsChildren += newBuf.AsStringC(); |
344 newBuf.Clear(); | 343 newBuf.Clear(); |
345 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 344 pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling); |
346 } | 345 } |
347 } | 346 } |
348 break; | 347 break; |
349 } | 348 } |
350 if (!wsChildren.IsEmpty() || !wsAttrs.IsEmpty() || | 349 if (!wsChildren.IsEmpty() || !wsAttrs.IsEmpty() || |
351 pNode->HasAttribute(XFA_ATTRIBUTE_Name)) { | 350 pNode->HasAttribute(XFA_ATTRIBUTE_Name)) { |
352 CFX_WideStringC wsElement; | 351 CFX_WideStringC wsElement; |
353 pNode->GetClassName(wsElement); | 352 pNode->GetClassName(wsElement); |
354 CFX_WideString wsName; | 353 CFX_WideString wsName; |
355 XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, | 354 XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 pXMLElement->RemoveAttribute(L"xfa:dataNode"); | 572 pXMLElement->RemoveAttribute(L"xfa:dataNode"); |
574 } | 573 } |
575 } else { | 574 } else { |
576 CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); | 575 CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); |
577 ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); | 576 ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); |
578 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"xfa:dataNode", | 577 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"xfa:dataNode", |
579 L"dataGroup"); | 578 L"dataGroup"); |
580 } | 579 } |
581 } | 580 } |
582 } | 581 } |
OLD | NEW |