From 3f9549e7f00b649471c4d658bbfb6bf031b8f53e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Nov 2017 14:23:07 +0000 Subject: 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 Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_dataexporter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_dataexporter.cpp') diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index f7715dc374..c86a7f7d51 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -152,12 +152,13 @@ void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot, if (!pTemplateRoot) return; - WideString wsTemplateNS; - if (!pTemplateRoot->JSNode()->TryNamespace(wsTemplateNS)) + pdfium::Optional templateNS = + pTemplateRoot->JSNode()->TryNamespace(); + if (!templateNS) return; XFA_VERSION eVersion = - pTemplateRoot->GetDocument()->RecognizeXFAVersionNumber(wsTemplateNS); + pTemplateRoot->GetDocument()->RecognizeXFAVersionNumber(*templateNS); if (eVersion == XFA_VERSION_UNKNOWN) eVersion = XFA_VERSION_DEFAULT; -- cgit v1.2.3