summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_creator.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index ff8d4bb82f..f8beccbad3 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -214,10 +214,7 @@ bool CPDF_Creator::WriteDirectObj(uint32_t objnum,
return false;
break;
}
- CPDF_Encryptor encryptor(
- GetCryptoHandler(), objnum,
- pdfium::make_span(reinterpret_cast<const uint8_t*>(str.c_str()),
- str.GetLength()));
+ CPDF_Encryptor encryptor(GetCryptoHandler(), objnum, str.AsRawSpan());
ByteString content = PDF_EncodeString(
ByteString(encryptor.GetSpan().data(), encryptor.GetSpan().size()),
bHex);
@@ -506,12 +503,12 @@ int32_t CPDF_Creator::WriteDoc_Stage3() {
else
str = ByteString::Format("%d %d\r\n", i, j - i);
- if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
+ if (!m_Archive->WriteString(str.AsStringView()))
return -1;
while (i < j) {
str = ByteString::Format("%010d 00000 n\r\n", m_ObjectOffsets[i++]);
- if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
+ if (!m_Archive->WriteString(str.AsStringView()))
return -1;
}
if (i > dwLastObjNum)
@@ -540,13 +537,13 @@ int32_t CPDF_Creator::WriteDoc_Stage3() {
else
str = ByteString::Format("%d %d\r\n", objnum, j - i);
- if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
+ if (!m_Archive->WriteString(str.AsStringView()))
return -1;
while (i < j) {
objnum = m_NewObjNumArray[i++];
str = ByteString::Format("%010d 00000 n\r\n", m_ObjectOffsets[objnum]);
- if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
+ if (!m_Archive->WriteString(str.AsStringView()))
return -1;
}
}