diff options
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r-- | core/fxcrt/xml/cfx_xmldoc.cpp | 6 | ||||
-rw-r--r-- | core/fxcrt/xml/cfx_xmlnode.cpp | 2 |
2 files changed, 4 insertions, 4 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()) { diff --git a/core/fxcrt/xml/cfx_xmlnode.cpp b/core/fxcrt/xml/cfx_xmlnode.cpp index 4550d5b4ae..f2b9006ebf 100644 --- a/core/fxcrt/xml/cfx_xmlnode.cpp +++ b/core/fxcrt/xml/cfx_xmlnode.cpp @@ -349,7 +349,7 @@ void CFX_XMLNode::SaveXMLNode( ws += L"\"?>"; pXMLStream->WriteString(ws.AsStringView()); } else { - ws.Format(L"<?%s", pInstruction->GetName().c_str()); + ws = WideString::Format(L"<?%s", pInstruction->GetName().c_str()); pXMLStream->WriteString(ws.AsStringView()); for (auto it : pInstruction->GetAttributes()) { |