summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-02-25 17:16:18 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-02-25 17:16:18 -0500
commit9d8c29dbe9576a52b4f326fdce9d8ea669d26bff (patch)
tree6a5608c4fcc8ec3a44bca70265559cec5c262b83
parent27990e23f651cc3c06fe2952bb14731a34f6d7b1 (diff)
downloadpdfium-9d8c29dbe9576a52b4f326fdce9d8ea669d26bff.tar.xz
_XFA_VERIFY_Checksum is always defined.
Remove the define and the #ifdef checks. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1741543002 .
-rw-r--r--xfa/src/fxfa/src/parser/xfa_parser_imp.cpp19
-rw-r--r--xfa/src/fxfa/src/parser/xfa_parser_imp.h4
2 files changed, 5 insertions, 18 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
index 3baed96cba..35dca5d076 100644
--- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
@@ -135,9 +135,8 @@ int32_t CXFA_SimpleParser::ParseXMLData(const CFX_WideString& wsXML,
if (pParser == NULL) {
return XFA_PARSESTATUS_StatusErr;
}
-#ifdef _XFA_VERIFY_Checksum_
+
pParser->m_dwCheckStatus = 0x03;
-#endif
if (!m_pXMLDoc->LoadXML(pParser)) {
return XFA_PARSESTATUS_StatusErr;
}
@@ -579,7 +578,6 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm(
IFDE_XMLElement* pXMLDocumentElement = (IFDE_XMLElement*)pXMLDocumentNode;
CFX_WideString wsChecksum;
pXMLDocumentElement->GetString(L"checksum", wsChecksum);
-#ifdef _XFA_VERIFY_Checksum_
if (wsChecksum.GetLength() != 28 ||
m_pXMLParser->m_dwCheckStatus != 0x03) {
return NULL;
@@ -597,7 +595,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_TemplateForm(
if (bsCheck != wsChecksum.UTF8Encode()) {
return NULL;
}
-#endif
+
pNode = m_pFactory->CreateNode(XFA_XDPPACKET_Form, XFA_ELEMENT_Form);
if (!pNode) {
return NULL;
@@ -1448,11 +1446,9 @@ void CXFA_DocumentParser::CloseParser() {
}
CXFA_XMLParser::CXFA_XMLParser(IFDE_XMLNode* pRoot, IFX_Stream* pStream)
:
-#ifdef _XFA_VERIFY_Checksum_
m_nElementStart(0),
m_dwCheckStatus(0),
m_dwCurrentCheckStatus(0),
-#endif
m_pRoot(pRoot),
m_pStream(pStream),
m_pParser(nullptr),
@@ -1496,11 +1492,9 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
m_pChild = m_pParent;
break;
case FDE_XMLSYNTAXSTATUS_ElementOpen:
-#ifdef _XFA_VERIFY_Checksum_
if (m_dwCheckStatus != 0x03 && m_NodeStack.GetSize() == 2) {
m_nElementStart = m_pParser->GetCurrentPos() - 1;
}
-#endif
break;
case FDE_XMLSYNTAXSTATUS_ElementBreak:
break;
@@ -1519,15 +1513,13 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
if (m_NodeStack.GetSize() < 1) {
m_dwStatus = FDE_XMLSYNTAXSTATUS_Error;
break;
- }
-#ifdef _XFA_VERIFY_Checksum_
- else if (m_dwCurrentCheckStatus != 0 && m_NodeStack.GetSize() == 2) {
+ } else if (m_dwCurrentCheckStatus != 0 && m_NodeStack.GetSize() == 2) {
m_nSize[m_dwCurrentCheckStatus - 1] =
m_pParser->GetCurrentBinaryPos() -
m_nStart[m_dwCurrentCheckStatus - 1];
m_dwCurrentCheckStatus = 0;
}
-#endif
+
m_pParent = (IFDE_XMLNode*)*m_NodeStack.GetTopElement();
m_pChild = m_pParent;
iCount++;
@@ -1549,7 +1541,7 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
m_pParent->InsertChildNode(m_pChild);
m_NodeStack.Push(m_pChild);
m_pParent = m_pChild;
-#ifdef _XFA_VERIFY_Checksum_
+
if (m_dwCheckStatus != 0x03 && m_NodeStack.GetSize() == 3) {
CFX_WideString wsTag;
((IFDE_XMLElement*)m_pChild)->GetLocalTagName(wsTag);
@@ -1565,7 +1557,6 @@ int32_t CXFA_XMLParser::DoParser(IFX_Pause* pPause) {
(m_pParser->GetCurrentPos() - m_nElementStart);
}
}
-#endif
break;
case FDE_XMLSYNTAXSTATUS_AttriName:
m_pParser->GetAttributeName(m_ws1);
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.h b/xfa/src/fxfa/src/parser/xfa_parser_imp.h
index a9ce2e5eeb..f2a936907f 100644
--- a/xfa/src/fxfa/src/parser/xfa_parser_imp.h
+++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.h
@@ -9,8 +9,6 @@
#include "xfa/src/fxfa/src/common/xfa_parser.h"
-#define _XFA_VERIFY_Checksum_
-
class CXFA_XMLParser;
class CXFA_SimpleParser : public IXFA_Parser {
@@ -118,13 +116,11 @@ class CXFA_XMLParser : public IFDE_XMLParser {
virtual void Release() { delete this; }
virtual int32_t DoParser(IFX_Pause* pPause);
-#ifdef _XFA_VERIFY_Checksum_
FX_FILESIZE m_nStart[2];
size_t m_nSize[2];
FX_FILESIZE m_nElementStart;
FX_WORD m_dwCheckStatus;
FX_WORD m_dwCurrentCheckStatus;
-#endif
protected:
IFDE_XMLNode* m_pRoot;