summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-10 10:23:29 -0800
committerLei Zhang <thestig@chromium.org>2015-11-10 10:23:29 -0800
commite6e16954f0cdc324849fca9da883be8f131b3834 (patch)
treec1f29469c1cb4ff3811f9d9f9845d2fc2d7a2702 /core/src/fpdfapi/fpdf_edit
parentb27902b8995bb3e003daed6b0811ed746763c68d (diff)
downloadpdfium-e6e16954f0cdc324849fca9da883be8f131b3834.tar.xz
Cleanup CPDF_Stream:
- Remove CPDF_Stream::Create() and checks that it might fail. - Remove m_pCryptoHandler that's always a nullptr. - Remove m_FileOffset that's always 0. - Rename file version of InitStream() to InitStreamFromFile(). - Use IsMemoryBased() in more places. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1415163009 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 2ec5727444..3ffe482026 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -85,7 +85,7 @@ void CPDF_Image::SetJpegImage(IFX_FileRead* pFile) {
if (!pDict) {
return;
}
- m_pStream->InitStream(pFile, pDict);
+ m_pStream->InitStreamFromFile(pFile, pDict);
}
void _DCTEncodeBitmap(CPDF_Dictionary* pBitmapDict,
const CFX_DIBitmap* pBitmap,
@@ -178,8 +178,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap,
ptr[2] = (uint8_t)argb;
ptr += 3;
}
- CPDF_Stream* pCTS = CPDF_Stream::Create(pColorTable, iPalette * 3,
- CPDF_Dictionary::Create());
+ CPDF_Stream* pCTS =
+ new CPDF_Stream(pColorTable, iPalette * 3, new CPDF_Dictionary);
m_pDocument->AddIndirectObject(pCTS);
pCS->AddReference(m_pDocument, pCTS);
pDict->SetAtReference(FX_BSTRC("ColorSpace"), m_pDocument, pCS);
@@ -374,7 +374,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap,
m_pStream->InitStream(dest_buf, dest_size, pDict);
} else {
pFileWrite->Flush();
- m_pStream->InitStream(pFileRead, pDict);
+ m_pStream->InitStreamFromFile(pFileRead, pDict);
}
m_bIsMask = pBitmap->IsAlphaMask();
m_Width = BitmapWidth;