diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_metadata_unittest.cpp | 16 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfdoc/cpdf_metadata_unittest.cpp b/core/fpdfdoc/cpdf_metadata_unittest.cpp index 1a39948461..ed97b4f5bf 100644 --- a/core/fpdfdoc/cpdf_metadata_unittest.cpp +++ b/core/fpdfdoc/cpdf_metadata_unittest.cpp @@ -17,7 +17,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormEmailAtTopLevel) { "</node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -34,7 +34,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormAcrobatAtTopLevel) { "</node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -51,7 +51,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormFilesystemAtTopLevel) { "</node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -68,7 +68,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormWithoutWorkflow) { "</node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -86,7 +86,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormAsChild) { "</parent></grandparent>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -100,7 +100,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormAsNoAdhoc) { "<node></node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -116,7 +116,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormWrongNamespace) { "</node>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); @@ -146,7 +146,7 @@ TEST(CPDF_MetadataTest, CheckSharedFormMultipleErrors) { "</grandparent>"; CPDF_Stream stream; - stream.SetData(reinterpret_cast<const uint8_t*>(data), strlen(data)); + stream.SetData(ByteStringView(data).span()); CPDF_Metadata metadata(&stream); auto results = metadata.CheckForSharedForm(); diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 7faa4bfeca..dc2f22d0e6 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -504,7 +504,7 @@ void GenerateAndSetAPDict(CPDF_Document* pDoc, std::unique_ptr<CPDF_Dictionary> pResourceDict, bool bIsTextMarkupAnnotation) { CPDF_Stream* pNormalStream = pDoc->NewIndirect<CPDF_Stream>(); - pNormalStream->SetData(psAppStream); + pNormalStream->SetDataFromStringstream(psAppStream); CPDF_Dictionary* pAPDict = pAnnotDict->GetDictFor("AP"); if (!pAPDict) @@ -1300,7 +1300,7 @@ void CPVT_GenerateAP::GenerateFormAP(Type type, } if (pNormalStream) { - pNormalStream->SetDataAndRemoveFilter(&sAppStream); + pNormalStream->SetDataFromStringstreamAndRemoveFilter(&sAppStream); pStreamDict = pNormalStream->GetDict(); if (pStreamDict) { pStreamDict->SetMatrixFor("Matrix", matrix); |