diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-16 14:23:07 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-16 14:23:07 +0000 |
commit | 3f9549e7f00b649471c4d658bbfb6bf031b8f53e (patch) | |
tree | da0ec4380365c2b3a42b53c1ba291d7529646bd7 /xfa/fxfa/parser/cxfa_document.cpp | |
parent | ce7ccd5f638eff42c6c79da682061fa2c39b028f (diff) | |
download | pdfium-3f9549e7f00b649471c4d658bbfb6bf031b8f53e.tar.xz |
Convert TryNamespace to optional
This CL changes CJX_Node::TryNamespace to return a pdfium::Optional
instead of a bool with an out parameter.
Change-Id: I50ccb3544179108d156d763c25e03abab4306c19
Reviewed-on: https://pdfium-review.googlesource.com/18551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp index 82a71dea28..44fc9089c1 100644 --- a/xfa/fxfa/parser/cxfa_document.cpp +++ b/xfa/fxfa/parser/cxfa_document.cpp @@ -151,14 +151,16 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) { if (pDatasetsChild->GetNameHash() != XFA_HASHCODE_Data) continue; - WideString wsNamespaceURI; - if (!pDatasetsChild->JSNode()->TryNamespace(wsNamespaceURI)) + pdfium::Optional<WideString> namespaceURI = + pDatasetsChild->JSNode()->TryNamespace(); + if (!namespaceURI) continue; - WideString wsDatasetsURI; - if (!pDatasetsNode->JSNode()->TryNamespace(wsDatasetsURI)) + pdfium::Optional<WideString> datasetsURI = + pDatasetsNode->JSNode()->TryNamespace(); + if (!datasetsURI) continue; - if (wsNamespaceURI == wsDatasetsURI) + if (*namespaceURI == *datasetsURI) return pDatasetsChild; } return nullptr; |