| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 CXFA_WidgetData* pWidgetData = pGrandParentNode->GetWidgetData(); | 182 CXFA_WidgetData* pWidgetData = pGrandParentNode->GetWidgetData(); |
| 183 XFA_ELEMENT eUIType = pWidgetData->GetUIType(); | 183 XFA_ELEMENT eUIType = pWidgetData->GetUIType(); |
| 184 if (eUIType == XFA_ELEMENT_PasswordEdit) { | 184 if (eUIType == XFA_ELEMENT_PasswordEdit) { |
| 185 return FALSE; | 185 return FALSE; |
| 186 } | 186 } |
| 187 return TRUE; | 187 return TRUE; |
| 188 } | 188 } |
| 189 static void XFA_DataExporter_RecognizeXFAVersionNumber( | 189 static void XFA_DataExporter_RecognizeXFAVersionNumber( |
| 190 CXFA_Node* pTemplateRoot, | 190 CXFA_Node* pTemplateRoot, |
| 191 CFX_WideString& wsVersionNumber) { | 191 CFX_WideString& wsVersionNumber) { |
| 192 wsVersionNumber.Empty(); | 192 wsVersionNumber.clear(); |
| 193 if (!pTemplateRoot) { | 193 if (!pTemplateRoot) { |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 CFX_WideString wsTemplateNS; | 196 CFX_WideString wsTemplateNS; |
| 197 if (!pTemplateRoot->TryNamespace(wsTemplateNS)) { | 197 if (!pTemplateRoot->TryNamespace(wsTemplateNS)) { |
| 198 return; | 198 return; |
| 199 } | 199 } |
| 200 XFA_VERSION eVersion = | 200 XFA_VERSION eVersion = |
| 201 pTemplateRoot->GetDocument()->RecognizeXFAVersionNumber(wsTemplateNS); | 201 pTemplateRoot->GetDocument()->RecognizeXFAVersionNumber(wsTemplateNS); |
| 202 if (eVersion == XFA_VERSION_UNKNOWN) { | 202 if (eVersion == XFA_VERSION_UNKNOWN) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 329 CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 330 while (pChildNode) { | 330 while (pChildNode) { |
| 331 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, | 331 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, |
| 332 bSaveXML); | 332 bSaveXML); |
| 333 wsChildren += newBuf.GetWideString(); | 333 wsChildren += newBuf.GetWideString(); |
| 334 newBuf.Clear(); | 334 newBuf.Clear(); |
| 335 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 335 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
| 336 } | 336 } |
| 337 if (!bSaveXML && !wsChildren.IsEmpty() && | 337 if (!bSaveXML && !wsChildren.IsEmpty() && |
| 338 pNode->GetClassID() == XFA_ELEMENT_Items) { | 338 pNode->GetClassID() == XFA_ELEMENT_Items) { |
| 339 wsChildren.Empty(); | 339 wsChildren.clear(); |
| 340 bSaveXML = TRUE; | 340 bSaveXML = TRUE; |
| 341 CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 341 CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
| 342 while (pChildNode) { | 342 while (pChildNode) { |
| 343 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, | 343 XFA_DataExporter_RegenerateFormFile_Changed(pChildNode, newBuf, |
| 344 bSaveXML); | 344 bSaveXML); |
| 345 wsChildren += newBuf.GetWideString(); | 345 wsChildren += newBuf.GetWideString(); |
| 346 newBuf.Clear(); | 346 newBuf.Clear(); |
| 347 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 347 pChildNode = pChildNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
| 348 } | 348 } |
| 349 } | 349 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 pXMLElement->RemoveAttribute(L"xfa:dataNode"); | 575 pXMLElement->RemoveAttribute(L"xfa:dataNode"); |
| 576 } | 576 } |
| 577 } else { | 577 } else { |
| 578 CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); | 578 CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); |
| 579 FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); | 579 FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); |
| 580 static_cast<CFDE_XMLElement*>(pXMLNode) | 580 static_cast<CFDE_XMLElement*>(pXMLNode) |
| 581 ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); | 581 ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); |
| 582 } | 582 } |
| 583 } | 583 } |
| 584 } | 584 } |
| OLD | NEW |