summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfsave.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-20 14:11:21 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-20 18:38:55 +0000
commit283a0433b081f88275b2f7e8c04d3c41b9187ca6 (patch)
tree4f6ff921e8a7de9b7922369c97731e54f647ea33 /fpdfsdk/fpdfsave.cpp
parent03f5bab415cda066855e2672154358056649c584 (diff)
downloadpdfium-283a0433b081f88275b2f7e8c04d3c41b9187ca6.tar.xz
Convert IFX_MemoryStream to CFX_MemoryStream
The CFX_MemoryStream is the only implementation of IFX_MemoryStream. This CL removes the interfaces and uses CFX_MemoryStream directly. Change-Id: I2f43fa39e82dafa7673517d214ae15fd2d0df331 Reviewed-on: https://pdfium-review.googlesource.com/4391 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfsave.cpp')
-rw-r--r--fpdfsdk/fpdfsave.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index a8b0d05c61..8e92579518 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/parser/cpdf_string.h"
+#include "core/fxcrt/cfx_memorystream.h"
#include "core/fxcrt/fx_extension.h"
#include "fpdfsdk/fsdk_define.h"
#include "public/fpdf_edit.h"
@@ -139,8 +140,9 @@ bool SaveXFADocumentData(
CPDF_Stream* pTemplateStream = pArray->GetStreamAt(iTemplate);
auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pTemplateStream);
pAcc->LoadAllData();
- CFX_RetainPtr<IFX_SeekableStream> pTemplate = IFX_MemoryStream::Create(
- const_cast<uint8_t*>(pAcc->GetData()), pAcc->GetSize());
+ CFX_RetainPtr<IFX_SeekableStream> pTemplate =
+ pdfium::MakeRetain<CFX_MemoryStream>(
+ const_cast<uint8_t*>(pAcc->GetData()), pAcc->GetSize(), false);
pChecksum->UpdateChecksum(pTemplate);
}
CPDF_Stream* pFormStream = nullptr;
@@ -173,7 +175,8 @@ bool SaveXFADocumentData(
}
// L"datasets"
{
- CFX_RetainPtr<IFX_SeekableStream> pDsfileWrite = IFX_MemoryStream::Create();
+ CFX_RetainPtr<IFX_SeekableStream> pDsfileWrite =
+ pdfium::MakeRetain<CFX_MemoryStream>(false);
if (pXFADocView->GetDoc()->SavePackage(XFA_HASHCODE_Datasets, pDsfileWrite,
nullptr) &&
pDsfileWrite->GetSize() > 0) {
@@ -200,7 +203,8 @@ bool SaveXFADocumentData(
}
// L"form"
{
- CFX_RetainPtr<IFX_SeekableStream> pfileWrite = IFX_MemoryStream::Create();
+ CFX_RetainPtr<IFX_SeekableStream> pfileWrite =
+ pdfium::MakeRetain<CFX_MemoryStream>(false);
if (pXFADocView->GetDoc()->SavePackage(XFA_HASHCODE_Form, pfileWrite,
pChecksum.get()) &&
pfileWrite->GetSize() > 0) {