From 5ae87922cb96810a05b2262c66b55b7e8f00e46d Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 18 Apr 2017 11:54:04 -0400 Subject: Update IFGAS_Stream::WriteString to take a string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This Cl updates the WriteString method to accept a CFX_WideString. Change-Id: I9f480abf32f4132f8ca33799e673a9e8540285f6 Reviewed-on: https://pdfium-review.googlesource.com/4151 Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fde/xml/cfde_xmldoc.cpp | 22 +++++++++++----------- xfa/fde/xml/cfde_xmlnode.cpp | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'xfa/fde/xml') diff --git a/xfa/fde/xml/cfde_xmldoc.cpp b/xfa/fde/xml/cfde_xmldoc.cpp index 7032700578..209ce9c68f 100644 --- a/xfa/fde/xml/cfde_xmldoc.cpp +++ b/xfa/fde/xml/cfde_xmldoc.cpp @@ -65,10 +65,10 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, ws += L"UTF-8"; } ws += L"\"?>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } else { ws.Format(L"GetName().c_str()); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); for (auto it : pInstruction->GetAttributes()) { CFX_WideString wsValue = it.second; @@ -83,17 +83,17 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, ws += L"=\""; ws += wsValue; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } for (auto target : pInstruction->GetTargetData()) { ws = L" \""; ws += target; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } ws = L"?>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } break; } @@ -101,7 +101,7 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, CFX_WideString ws; ws = L"<"; ws += static_cast(pNode)->GetName(); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); for (auto it : static_cast(pNode)->GetAttributes()) { CFX_WideString wsValue = it.second; @@ -116,11 +116,11 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, ws += L"=\""; ws += wsValue; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } if (pNode->m_pChild) { ws = L"\n>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); CFDE_XMLNode* pChild = pNode->m_pChild; while (pChild) { SaveXMLNode(pXMLStream, static_cast(pChild)); @@ -132,7 +132,7 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, } else { ws = L"\n/>"; } - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_Text: { @@ -142,14 +142,14 @@ void CFDE_XMLDoc::SaveXMLNode(const CFX_RetainPtr& pXMLStream, ws.Replace(L">", L">"); ws.Replace(L"\'", L"'"); ws.Replace(L"\"", L"""); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_CharData: { CFX_WideString ws = L"(pNode)->GetText(); ws += L"]]>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_Unknown: diff --git a/xfa/fde/xml/cfde_xmlnode.cpp b/xfa/fde/xml/cfde_xmlnode.cpp index 82db939a23..e4d7880cac 100644 --- a/xfa/fde/xml/cfde_xmlnode.cpp +++ b/xfa/fde/xml/cfde_xmlnode.cpp @@ -346,10 +346,10 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { ws += L"UTF-8"; } ws += L"\"?>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } else { ws.Format(L"GetName().c_str()); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); for (auto it : pInstruction->GetAttributes()) { CFX_WideString wsValue = it.second; @@ -364,17 +364,17 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { ws += L"=\""; ws += wsValue; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } for (auto target : pInstruction->GetTargetData()) { ws = L" \""; ws += target; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } ws = L"?>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } break; } @@ -382,7 +382,7 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { CFX_WideString ws; ws = L"<"; ws += static_cast(pNode)->GetName(); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); for (auto it : static_cast(pNode)->GetAttributes()) { CFX_WideString wsValue = it.second; @@ -397,11 +397,11 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { ws += L"=\""; ws += wsValue; ws += L"\""; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); } if (pNode->m_pChild) { ws = L"\n>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); CFDE_XMLNode* pChild = pNode->m_pChild; while (pChild) { pChild->SaveXMLNode(pXMLStream); @@ -413,7 +413,7 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { } else { ws = L"\n/>"; } - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_Text: { @@ -423,14 +423,14 @@ void CFDE_XMLNode::SaveXMLNode(const CFX_RetainPtr& pXMLStream) { ws.Replace(L">", L">"); ws.Replace(L"\'", L"'"); ws.Replace(L"\"", L"""); - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_CharData: { CFX_WideString ws = L"(pNode)->GetText(); ws += L"]]>"; - pXMLStream->WriteString(ws.c_str(), ws.GetLength()); + pXMLStream->WriteString(ws.AsStringC()); break; } case FDE_XMLNODE_Unknown: -- cgit v1.2.3