summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten.cpp
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-07-28 19:41:59 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-07-28 18:22:46 +0000
commit90555e06b0c03777bca17ca423b765b3cb517f56 (patch)
tree8223800b230be79d0af7dc04454e85a2fcee7713 /fpdfsdk/fpdf_flatten.cpp
parente7a99de4f711302d57fe22682a9a8c3cfddb458c (diff)
downloadpdfium-90555e06b0c03777bca17ca423b765b3cb517f56.tar.xz
Add CPDF_Stream::ReplaceData method.chromium/3170
Change-Id: I94b2e8f6fd522b97c917037e32fb3bcbeea0cbeb Reviewed-on: https://pdfium-review.googlesource.com/8911 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index e530553f5a..16528c2ee3 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -203,7 +203,8 @@ void SetPageContents(const CFX_ByteString& key,
CFX_ByteString sBody =
CFX_ByteString((const char*)pAcc->GetData(), pAcc->GetSize());
sStream = sStream + sBody + "\nQ";
- pContentsStream->SetData(sStream.raw_str(), sStream.GetLength());
+ pContentsStream->SetDataAndRemoveFilter(sStream.raw_str(),
+ sStream.GetLength());
pContentsArray->AddNew<CPDF_Reference>(pDocument,
pContentsStream->GetObjNum());
pPage->SetNewFor<CPDF_Reference>("Contents", pDocument,
@@ -405,7 +406,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f,
sFormName.c_str());
sStream += sTemp;
- pNewXObject->SetData(sStream.raw_str(), sStream.GetLength());
+ pNewXObject->SetDataAndRemoveFilter(sStream.raw_str(), sStream.GetLength());
}
pPageDict->RemoveFor("Annots");
return FLATTEN_SUCCESS;