diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-04 16:20:05 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 21:37:32 +0000 |
commit | 0545d2a5d759dbbb6ac3cce6d82bc0f2188cc4aa (patch) | |
tree | c24e050f4130fc280ab1d118275a047191f5e004 | |
parent | b7e315c203c2af29ae56c2a6287547bc702c4cd3 (diff) | |
download | pdfium-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>
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.cpp | 17 |
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"; |