| 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_parser_imp.h" | 7 #include "xfa/fxfa/parser/xfa_parser_imp.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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1241                    static_cast<CFDE_XMLElement*>(pXMLChild))) { | 1241                    static_cast<CFDE_XMLElement*>(pXMLChild))) { | 
| 1242       XFA_GetPlainTextFromRichText(static_cast<CFDE_XMLElement*>(pXMLChild), | 1242       XFA_GetPlainTextFromRichText(static_cast<CFDE_XMLElement*>(pXMLChild), | 
| 1243                                    wsText); | 1243                                    wsText); | 
| 1244       if (!pXMLCurValueNode) | 1244       if (!pXMLCurValueNode) | 
| 1245         pXMLCurValueNode = pXMLChild; | 1245         pXMLCurValueNode = pXMLChild; | 
| 1246 | 1246 | 
| 1247       wsCurValueTextBuf << wsText; | 1247       wsCurValueTextBuf << wsText; | 
| 1248     } else { | 1248     } else { | 
| 1249       bMarkAsCompound = TRUE; | 1249       bMarkAsCompound = TRUE; | 
| 1250       if (pXMLCurValueNode) { | 1250       if (pXMLCurValueNode) { | 
| 1251         CFX_WideStringC wsCurValue = wsCurValueTextBuf.GetWideString(); | 1251         CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); | 
| 1252         if (!wsCurValue.IsEmpty()) { | 1252         if (!wsCurValue.IsEmpty()) { | 
| 1253           CXFA_Node* pXFAChild = | 1253           CXFA_Node* pXFAChild = | 
| 1254               m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); | 1254               m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); | 
| 1255           if (!pXFAChild) | 1255           if (!pXFAChild) | 
| 1256             return; | 1256             return; | 
| 1257 | 1257 | 
| 1258           pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); | 1258           pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); | 
| 1259           pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); | 1259           pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); | 
| 1260           pXFANode->InsertChild(pXFAChild); | 1260           pXFANode->InsertChild(pXFAChild); | 
| 1261           pXFAChild->SetXMLMappingNode(pXMLCurValueNode); | 1261           pXFAChild->SetXMLMappingNode(pXMLCurValueNode); | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 1275       pXFAChild->SetCData(XFA_ATTRIBUTE_Name, wsNodeStr); | 1275       pXFAChild->SetCData(XFA_ATTRIBUTE_Name, wsNodeStr); | 
| 1276       ParseDataValue(pXFAChild, pXMLChild, ePacketID); | 1276       ParseDataValue(pXFAChild, pXMLChild, ePacketID); | 
| 1277       pXFANode->InsertChild(pXFAChild); | 1277       pXFANode->InsertChild(pXFAChild); | 
| 1278       pXFAChild->SetXMLMappingNode(pXMLChild); | 1278       pXFAChild->SetXMLMappingNode(pXMLChild); | 
| 1279       pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 1279       pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 
| 1280       CFX_WideStringC wsCurValue = pXFAChild->GetCData(XFA_ATTRIBUTE_Value); | 1280       CFX_WideStringC wsCurValue = pXFAChild->GetCData(XFA_ATTRIBUTE_Value); | 
| 1281       wsValueTextBuf << wsCurValue; | 1281       wsValueTextBuf << wsCurValue; | 
| 1282     } | 1282     } | 
| 1283   } | 1283   } | 
| 1284   if (pXMLCurValueNode) { | 1284   if (pXMLCurValueNode) { | 
| 1285     CFX_WideStringC wsCurValue = wsCurValueTextBuf.GetWideString(); | 1285     CFX_WideStringC wsCurValue = wsCurValueTextBuf.AsStringC(); | 
| 1286     if (!wsCurValue.IsEmpty()) { | 1286     if (!wsCurValue.IsEmpty()) { | 
| 1287       if (bMarkAsCompound) { | 1287       if (bMarkAsCompound) { | 
| 1288         CXFA_Node* pXFAChild = | 1288         CXFA_Node* pXFAChild = | 
| 1289             m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); | 1289             m_pFactory->CreateNode(ePacketID, XFA_ELEMENT_DataValue); | 
| 1290         if (!pXFAChild) | 1290         if (!pXFAChild) | 
| 1291           return; | 1291           return; | 
| 1292 | 1292 | 
| 1293         pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); | 1293         pXFAChild->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"")); | 
| 1294         pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); | 1294         pXFAChild->SetCData(XFA_ATTRIBUTE_Value, wsCurValue); | 
| 1295         pXFANode->InsertChild(pXFAChild); | 1295         pXFANode->InsertChild(pXFAChild); | 
| 1296         pXFAChild->SetXMLMappingNode(pXMLCurValueNode); | 1296         pXFAChild->SetXMLMappingNode(pXMLCurValueNode); | 
| 1297         pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 1297         pXFAChild->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 
| 1298       } | 1298       } | 
| 1299       wsValueTextBuf << wsCurValue; | 1299       wsValueTextBuf << wsCurValue; | 
| 1300       wsCurValueTextBuf.Clear(); | 1300       wsCurValueTextBuf.Clear(); | 
| 1301     } | 1301     } | 
| 1302     pXMLCurValueNode = nullptr; | 1302     pXMLCurValueNode = nullptr; | 
| 1303   } | 1303   } | 
| 1304   CFX_WideStringC wsNodeValue = wsValueTextBuf.GetWideString(); | 1304   CFX_WideStringC wsNodeValue = wsValueTextBuf.AsStringC(); | 
| 1305   pXFANode->SetCData(XFA_ATTRIBUTE_Value, wsNodeValue); | 1305   pXFANode->SetCData(XFA_ATTRIBUTE_Value, wsNodeValue); | 
| 1306 } | 1306 } | 
| 1307 | 1307 | 
| 1308 void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, | 1308 void CXFA_SimpleParser::ParseInstruction(CXFA_Node* pXFANode, | 
| 1309                                          CFDE_XMLInstruction* pXMLInstruction, | 1309                                          CFDE_XMLInstruction* pXMLInstruction, | 
| 1310                                          XFA_XDPPACKET ePacketID) { | 1310                                          XFA_XDPPACKET ePacketID) { | 
| 1311   if (!m_bDocumentParser) { | 1311   if (!m_bDocumentParser) { | 
| 1312     return; | 1312     return; | 
| 1313   } | 1313   } | 
| 1314   CFX_WideString wsTargetName; | 1314   CFX_WideString wsTargetName; | 
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1557     } | 1557     } | 
| 1558     if (pPause && iCount > 500 && pPause->NeedToPauseNow()) { | 1558     if (pPause && iCount > 500 && pPause->NeedToPauseNow()) { | 
| 1559       break; | 1559       break; | 
| 1560     } | 1560     } | 
| 1561   } | 1561   } | 
| 1562   return (m_syntaxParserResult == FDE_XmlSyntaxResult::Error || | 1562   return (m_syntaxParserResult == FDE_XmlSyntaxResult::Error || | 
| 1563           m_NodeStack.GetSize() != 1) | 1563           m_NodeStack.GetSize() != 1) | 
| 1564              ? -1 | 1564              ? -1 | 
| 1565              : m_pParser->GetStatus(); | 1565              : m_pParser->GetStatus(); | 
| 1566 } | 1566 } | 
| OLD | NEW | 
|---|