summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp9
-rw-r--r--xfa/fxfa/parser/cxfa_xmllocale.cpp3
4 files changed, 9 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index 7852d30036..44c1b7912b 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -215,8 +215,8 @@ RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
pAcc->LoadAllDataFiltered();
- auto pImageFileRead = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
- pAcc->GetData(), pAcc->GetSize());
+ auto pImageFileRead =
+ pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(pAcc->GetSpan());
RetainPtr<CFX_DIBitmap> pDibSource = XFA_LoadImageFromBuffer(
pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi);
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index 5cb08863c8..d0f137da7c 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -332,8 +332,8 @@ bool CXFA_DocumentParser::Parse(
}
CFX_XMLNode* CXFA_DocumentParser::ParseXMLData(const ByteString& wsXML) {
- auto pStream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
- wsXML.raw_str(), wsXML.GetLength());
+ auto pStream =
+ pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(wsXML.AsRawSpan());
xml_doc_ = LoadXML(pStream);
if (!xml_doc_)
return nullptr;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 06bbb0936a..a60e66584b 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -29,6 +29,7 @@
#include "third_party/base/compiler_specific.h"
#include "third_party/base/logging.h"
#include "third_party/base/ptr_util.h"
+#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
@@ -199,7 +200,6 @@ RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc,
return nullptr;
FXCODEC_IMAGE_TYPE type = XFA_GetImageType(pImage->GetContentType());
- ByteString bsContent;
std::vector<uint8_t> buffer;
RetainPtr<IFX_SeekableReadStream> pImageFileRead;
if (wsImage.GetLength() > 0) {
@@ -209,13 +209,12 @@ RetainPtr<CFX_DIBitmap> XFA_LoadImageData(CXFA_FFDoc* pDoc,
buffer.resize(bsData.GetLength());
int32_t iRead = XFA_Base64Decode(bsData.c_str(), buffer.data());
if (iRead > 0) {
- pImageFileRead =
- pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(buffer.data(), iRead);
+ pImageFileRead = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
+ pdfium::make_span(buffer.data(), iRead));
}
} else {
- bsContent = wsImage.ToDefANSI();
pImageFileRead = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
- bsContent.raw_str(), bsContent.GetLength());
+ wsImage.ToDefANSI().AsRawSpan());
}
} else {
WideString wsURL = wsHref;
diff --git a/xfa/fxfa/parser/cxfa_xmllocale.cpp b/xfa/fxfa/parser/cxfa_xmllocale.cpp
index 2806a084d6..20557dd59c 100644
--- a/xfa/fxfa/parser/cxfa_xmllocale.cpp
+++ b/xfa/fxfa/parser/cxfa_xmllocale.cpp
@@ -31,8 +31,7 @@ constexpr wchar_t kCurrencySymbol[] = L"currencySymbol";
// static
std::unique_ptr<CXFA_XMLLocale> CXFA_XMLLocale::Create(
pdfium::span<uint8_t> data) {
- auto stream =
- pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(data.data(), data.size());
+ auto stream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(data);
CFX_XMLParser parser(stream);
auto doc = parser.Parse();
if (!doc)