diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-07-26 19:34:26 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-26 19:34:26 +0000 |
commit | c9171e16d9d4477501d326d8d456fdc03e0f832e (patch) | |
tree | 89a91af4803e820b2e7f8c6e9901915c3415d72c /xfa/fxfa/parser/cxfa_document.cpp | |
parent | ea360af9048e7083107f9e27f8967351df241f70 (diff) | |
download | pdfium-c9171e16d9d4477501d326d8d456fdc03e0f832e.tar.xz |
Use moar ToXMLElement() in place of static_cast<>.
Introduces checks in a few new places, but mainly just consolidates
checking/casting logic.
Change-Id: I634a03060d254db099972c6978249992367e146c
Reviewed-on: https://pdfium-review.googlesource.com/38900
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index 3e8046677a..3b086faf69 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -510,9 +510,8 @@ void CreateDataBinding(CXFA_Node* pFormNode, wsHref = image->GetHref(); } CFX_XMLElement* pXMLDataElement = - static_cast<CFX_XMLElement*>(pDataNode->GetXMLMappingNode()); + ToXMLElement(pDataNode->GetXMLMappingNode()); ASSERT(pXMLDataElement); - pDataNode->JSObject()->SetAttributeValue( wsValue, pFormNode->GetFormatDataValue(wsValue), false, false); pDataNode->JSObject()->SetCData(XFA_Attribute::ContentType, @@ -656,9 +655,7 @@ void CreateDataBinding(CXFA_Node* pFormNode, CXFA_Image* image = defValue ? defValue->GetImageIfExists() : nullptr; if (image) { CFX_XMLElement* pXMLDataElement = - static_cast<CFX_XMLElement*>(pDataNode->GetXMLMappingNode()); - ASSERT(pXMLDataElement); - + ToXMLElement(pDataNode->GetXMLMappingNode()); WideString wsContentType = pXMLDataElement->GetAttribute(L"xfa:contentType"); if (!wsContentType.IsEmpty()) { |