summaryrefslogtreecommitdiff
path: root/fxjs/cjx_node.h
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 /fxjs/cjx_node.h
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 'fxjs/cjx_node.h')
-rw-r--r--fxjs/cjx_node.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index fca3c9f8a7..81af0dfe73 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -47,10 +47,13 @@ class CJX_Node : public CJX_Object {
bool SetAttribute(const WideStringView& wsAttr,
const WideStringView& wsValue,
bool bNotify);
- bool GetAttribute(const WideStringView& wsAttr,
- WideString& wsValue,
- bool bUseDefault);
- bool GetAttribute(XFA_Attribute eAttr, WideString& wsValue, bool bUseDefault);
+ WideString GetAttribute(const WideStringView& attr);
+ WideString GetAttribute(XFA_Attribute attr);
+ pdfium::Optional<WideString> TryAttribute(const WideStringView& wsAttr,
+ bool bUseDefault);
+ pdfium::Optional<WideString> TryAttribute(XFA_Attribute eAttr,
+ bool bUseDefault);
+
bool SetAttributeValue(const WideString& wsValue,
const WideString& wsXMLValue,
bool bNotify,