summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_imagedata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-16 14:17:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-16 14:17:17 +0000
commit9d608ff14177cd665f6b2ead639415bda935fbe2 (patch)
treed538fbf435ed55cf07ff37c24bc835507c12466d /xfa/fxfa/parser/cxfa_imagedata.cpp
parent9d47de6b27b167db46b6aba38352fc42a8b6adae (diff)
downloadpdfium-9d608ff14177cd665f6b2ead639415bda935fbe2.tar.xz
Cleanup CJX_Node::GetAttribute
This CL renames GetAttribute to TryAttribute and changes to return a pdfium::Optional instead of a boolean with an out parameter. GetAttribute is then added to call TryAttribute to mirror the other methods in the file. Change-Id: I875dac120776af7c53fe069e4dd36e5486838447 Reviewed-on: https://pdfium-review.googlesource.com/18514 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_imagedata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_imagedata.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/cxfa_imagedata.cpp b/xfa/fxfa/parser/cxfa_imagedata.cpp
index 2ad891d7ec..7888c34205 100644
--- a/xfa/fxfa/parser/cxfa_imagedata.cpp
+++ b/xfa/fxfa/parser/cxfa_imagedata.cpp
@@ -35,7 +35,13 @@ bool CXFA_ImageData::GetHref(WideString& wsHref) {
wsHref = *ret;
return true;
}
- return m_pNode->JSNode()->GetAttribute(XFA_Attribute::Href, wsHref, true);
+ pdfium::Optional<WideString> ret =
+ m_pNode->JSNode()->TryAttribute(XFA_Attribute::Href, true);
+ if (!ret)
+ return false;
+
+ wsHref = *ret;
+ return true;
}
XFA_ATTRIBUTEENUM CXFA_ImageData::GetTransferEncoding() {