summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/xfa_utils.cpp')
-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";