summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmldoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cfx_xmldoc.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmldoc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcrt/xml/cfx_xmldoc.cpp b/core/fxcrt/xml/cfx_xmldoc.cpp
index 30e4a47e72..e29c09a08e 100644
--- a/core/fxcrt/xml/cfx_xmldoc.cpp
+++ b/core/fxcrt/xml/cfx_xmldoc.cpp
@@ -53,10 +53,9 @@ void CFX_XMLDoc::SaveXMLNode(
CFX_XMLNode* pNode = (CFX_XMLNode*)pINode;
switch (pNode->GetType()) {
case FX_XMLNODE_Instruction: {
- WideString ws;
CFX_XMLInstruction* pInstruction = (CFX_XMLInstruction*)pNode;
if (pInstruction->GetName().CompareNoCase(L"xml") == 0) {
- ws = L"<?xml version=\"1.0\" encoding=\"";
+ WideString ws = L"<?xml version=\"1.0\" encoding=\"";
uint16_t wCodePage = pXMLStream->GetCodePage();
if (wCodePage == FX_CODEPAGE_UTF16LE) {
ws += L"UTF-16";
@@ -68,7 +67,8 @@ void CFX_XMLDoc::SaveXMLNode(
ws += L"\"?>";
pXMLStream->WriteString(ws.AsStringView());
} else {
- ws.Format(L"<?%s", pInstruction->GetName().c_str());
+ WideString ws =
+ WideString::Format(L"<?%s", pInstruction->GetName().c_str());
pXMLStream->WriteString(ws.AsStringView());
for (auto it : pInstruction->GetAttributes()) {