diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-27 12:26:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 12:26:01 -0700 |
commit | 43854a5073602a4613131aa6dbac5f7b9a095bcd (patch) | |
tree | 653ebf0cd690e13d1ca9e315ffeb34f8ac85cfbb /xfa/fxfa/parser/xfa_document_serialize.cpp | |
parent | b2f6f9158f54cee1825830c7ed57fe9d89cff26e (diff) | |
download | pdfium-43854a5073602a4613131aa6dbac5f7b9a095bcd.tar.xz |
Standardize on ASSERT.
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and
assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can
be overridden if the platform requies and we can pickup the Chromium version
if it has already been defined in the build.
This does change behaviour. Currently FXSYS_assert is always defined but ASSERT
is only defined in debug builds. So, the FXSYS_assert's would fire in Release
builds. That will no longer happen.
BUG=pdfium:219
Review-Url: https://codereview.chromium.org/1914303003
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_serialize.cpp')
-rw-r--r-- | xfa/fxfa/parser/xfa_document_serialize.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 09b51914ca..fce951420d 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -165,7 +165,7 @@ FX_BOOL XFA_DataExporter_ContentNodeNeedtoExport(CXFA_Node* pContentNode) { if (!pContentNode->TryContent(wsContent, FALSE, FALSE)) { return FALSE; } - FXSYS_assert(pContentNode->GetObjectType() == XFA_OBJECTTYPE_ContentNode); + ASSERT(pContentNode->GetObjectType() == XFA_OBJECTTYPE_ContentNode); CXFA_Node* pParentNode = pContentNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pParentNode || pParentNode->GetClassID() != XFA_ELEMENT_Value) { return TRUE; @@ -282,10 +282,10 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( iEnd = wsRawValue.Find(L'\n', iStart); } CXFA_Node* pParentNode = pNode->GetNodeItem(XFA_NODEITEM_Parent); - FXSYS_assert(pParentNode); + ASSERT(pParentNode); CXFA_Node* pGrandparentNode = pParentNode->GetNodeItem(XFA_NODEITEM_Parent); - FXSYS_assert(pGrandparentNode); + ASSERT(pGrandparentNode); CFX_WideString bodyTagName; bodyTagName = pGrandparentNode->GetCData(XFA_ATTRIBUTE_Name); if (bodyTagName.IsEmpty()) { @@ -512,7 +512,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, return FALSE; } CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); - FXSYS_assert(pDataNode); + ASSERT(pDataNode); XFA_DataExporter_DealWithDataGroupNode(pDataNode); pXMLDoc->SaveXMLNode(pStream, pElement); } break; @@ -568,14 +568,14 @@ void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode) { if (pDataNode->GetClassID() == XFA_ELEMENT_DataGroup) { if (iChildNum > 0) { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); - FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode); if (pXMLElement->HasAttribute(L"xfa:dataNode")) { pXMLElement->RemoveAttribute(L"xfa:dataNode"); } } else { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); - FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); static_cast<CFDE_XMLElement*>(pXMLNode) ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); } |