summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-04 16:20:05 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-04 21:37:32 +0000
commit0545d2a5d759dbbb6ac3cce6d82bc0f2188cc4aa (patch)
treec24e050f4130fc280ab1d118275a047191f5e004 /xfa/fxfa/parser
parentb7e315c203c2af29ae56c2a6287547bc702c4cd3 (diff)
downloadpdfium-0545d2a5d759dbbb6ac3cce6d82bc0f2188cc4aa.tar.xz
Convert RecognizeXFAVersionNumber to us a retval instead of a out param
Change-Id: Iefca0b9cb00a7ba9f37fc4eae618831e4e209ac4 Reviewed-on: https://pdfium-review.googlesource.com/22261 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/xfa_utils.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index 0105752937..c41835f19c 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -391,23 +391,20 @@ void RegenerateFormFile_Container(
}
}
-void RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot,
- WideString& wsVersionNumber) {
- wsVersionNumber.clear();
+WideString RecognizeXFAVersionNumber(CXFA_Node* pTemplateRoot) {
if (!pTemplateRoot)
- return;
+ return WideString();
Optional<WideString> templateNS = pTemplateRoot->JSObject()->TryNamespace();
if (!templateNS)
- return;
+ return WideString();
XFA_VERSION eVersion =
pTemplateRoot->GetDocument()->RecognizeXFAVersionNumber(*templateNS);
if (eVersion == XFA_VERSION_UNKNOWN)
eVersion = XFA_VERSION_DEFAULT;
- wsVersionNumber =
- WideString::Format(L"%i.%i", eVersion / 100, eVersion % 100);
+ return WideString::Format(L"%i.%i", eVersion / 100, eVersion % 100);
}
} // namespace
@@ -541,10 +538,8 @@ void XFA_DataExporter_RegenerateFormFile(
pStream->WriteString(L" xmlns=\"");
pStream->WriteString(WideStringView(kFormNS));
- WideString wsVersionNumber;
- RecognizeXFAVersionNumber(
- ToNode(pNode->GetDocument()->GetXFAObject(XFA_HASHCODE_Template)),
- wsVersionNumber);
+ WideString wsVersionNumber = RecognizeXFAVersionNumber(
+ ToNode(pNode->GetDocument()->GetXFAObject(XFA_HASHCODE_Template)));
if (wsVersionNumber.IsEmpty())
wsVersionNumber = L"2.8";