summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-27 17:14:31 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-27 21:15:17 +0000
commit8e052a65b3072ab83d4472d7ec3657afc14f4008 (patch)
treefac54cc549b6131deb5619ab1b2896e045b674da /fpdfsdk/fpdf_transformpage.cpp
parentd39443e8a5ae8e189e272accc23c5e66d9f0bd8d (diff)
downloadpdfium-8e052a65b3072ab83d4472d7ec3657afc14f4008.tar.xz
Converting CFX_ByteTextBuf to ostringstream in fpdf_transformpage.cpp.
Bug: pdfium:731 Change-Id: I52165fda5f94a4d29e707ea1619b1ad80423b436 Reviewed-on: https://pdfium-review.googlesource.com/7036 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_transformpage.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 9cf5a0b729..b419ad1fb2 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -7,6 +7,7 @@
#include "public/fpdf_transformpage.h"
#include <memory>
+#include <sstream>
#include <vector>
#include "core/fpdfapi/page/cpdf_clippath.h"
@@ -104,7 +105,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
if (!pPage)
return false;
- CFX_ByteTextBuf textBuf;
+ std::ostringstream textBuf;
textBuf << "q ";
CFX_FloatRect rect(clipRect->left, clipRect->bottom, clipRect->right,
clipRect->top);
@@ -134,7 +135,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(
nullptr, 0,
pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()));
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize());
+ pStream->SetData(&textBuf);
CPDF_Stream* pEndStream = pDoc->NewIndirect<CPDF_Stream>(
nullptr, 0,
@@ -233,7 +234,7 @@ DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath) {
std::unique_ptr<CPDF_ClipPath>(static_cast<CPDF_ClipPath*>(clipPath));
}
-void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) {
+void OutputPath(std::ostringstream& buf, CPDF_Path path) {
const CFX_PathData* pPathData = path.GetObject();
if (!pPathData)
return;
@@ -284,7 +285,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
if (!pContentObj)
return;
- CFX_ByteTextBuf strClip;
+ std::ostringstream strClip;
CPDF_ClipPath* pClipPath = (CPDF_ClipPath*)clipPath;
uint32_t i;
for (i = 0; i < pClipPath->GetPathCount(); i++) {
@@ -308,7 +309,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(
nullptr, 0,
pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()));
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize());
+ pStream->SetData(&strClip);
CPDF_Array* pArray = ToArray(pContentObj);
if (pArray) {