summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_calculatedata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-16 14:07:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-16 14:07:17 +0000
commit9d47de6b27b167db46b6aba38352fc42a8b6adae (patch)
tree5e29b94aa126a890cf9c2741b505c4dce9dae42e /xfa/fxfa/parser/cxfa_calculatedata.cpp
parent0bf9aef229ae2c4f2f16ab753d6d2e9e6d718a44 (diff)
downloadpdfium-9d47de6b27b167db46b6aba38352fc42a8b6adae.tar.xz
Convert TryEnum to return an optional
This CL converts CJX_Node::TryEnum to return a pdfium::Optional instead of a bool with an out parameter. Change-Id: Icc1b063ce51656cc5e467aba358eb9e7d6754fea Reviewed-on: https://pdfium-review.googlesource.com/18512 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_calculatedata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_calculatedata.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_calculatedata.cpp b/xfa/fxfa/parser/cxfa_calculatedata.cpp
index ef152f48d7..b468be77db 100644
--- a/xfa/fxfa/parser/cxfa_calculatedata.cpp
+++ b/xfa/fxfa/parser/cxfa_calculatedata.cpp
@@ -13,9 +13,9 @@ CXFA_CalculateData::CXFA_CalculateData(CXFA_Node* pNode)
: CXFA_DataData(pNode) {}
int32_t CXFA_CalculateData::GetOverride() {
- XFA_ATTRIBUTEENUM eAtt = XFA_ATTRIBUTEENUM_Error;
- m_pNode->JSNode()->TryEnum(XFA_Attribute::Override, eAtt, false);
- return eAtt;
+ return m_pNode->JSNode()
+ ->TryEnum(XFA_Attribute::Override, false)
+ .value_or(XFA_ATTRIBUTEENUM_Error);
}
CXFA_ScriptData CXFA_CalculateData::GetScriptData() {