diff options
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataexporter.cpp | 24 | ||||
-rw-r--r-- | xfa/fxfa/parser/xfa_utils.cpp | 6 |
2 files changed, 11 insertions, 19 deletions
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index 389b9dbacb..1bd81e820a 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -18,30 +18,23 @@ CXFA_DataExporter::CXFA_DataExporter() = default; CXFA_DataExporter::~CXFA_DataExporter() = default; -bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pWrite, +bool CXFA_DataExporter::Export(const RetainPtr<IFX_SeekableStream>& pStream, CXFA_Node* pNode) { - ASSERT(pWrite); - if (!pWrite) - return false; + ASSERT(pStream); - auto pStream = pdfium::MakeRetain<CFX_SeekableStreamProxy>(pWrite, true); - pStream->SetCodePage(FX_CODEPAGE_UTF8); - return Export(pStream, pNode); -} + if (!pStream) + return false; -bool CXFA_DataExporter::Export( - const RetainPtr<CFX_SeekableStreamProxy>& pStream, - CXFA_Node* pNode) { if (pNode->IsModelNode()) { switch (pNode->GetPacketType()) { case XFA_PacketType::Xdp: { pStream->WriteString( - L"<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">"); + "<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">"); for (CXFA_Node* pChild = pNode->GetFirstChild(); pChild; pChild = pChild->GetNextSibling()) { Export(pStream, pChild); } - pStream->WriteString(L"</xdp:xdp\n>"); + pStream->WriteString("</xdp:xdp\n>"); break; } case XFA_PacketType::Datasets: { @@ -57,7 +50,10 @@ bool CXFA_DataExporter::Export( break; } case XFA_PacketType::Form: { - XFA_DataExporter_RegenerateFormFile(pNode, pStream, false); + auto proxy = + pdfium::MakeRetain<CFX_SeekableStreamProxy>(pStream, false); + proxy->SetCodePage(FX_CODEPAGE_UTF8); + XFA_DataExporter_RegenerateFormFile(pNode, proxy, false); break; } case XFA_PacketType::Template: diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index ebe087aa64..55baf10229 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -216,11 +216,7 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, break; auto pMemStream = pdfium::MakeRetain<CFX_MemoryStream>(true); - auto pTempStream = - pdfium::MakeRetain<CFX_SeekableStreamProxy>(pMemStream, true); - - pTempStream->SetCodePage(FX_CODEPAGE_UTF8); - pRichTextXML->Save(pTempStream); + pRichTextXML->Save(pMemStream); wsChildren += WideString::FromUTF8( ByteStringView(pMemStream->GetBuffer(), pMemStream->GetSize())); } else if (pRawValueNode->GetElementType() == XFA_Element::Sharpxml && |