Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1284)

Unified Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp

Issue 1418493006: Merge to XFA: Cleanup CPDF_Stream: (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: fix build Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfapi/fpdf_objects.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 2ec572744494a12d07846b4155049209b2a49ee9..3ffe482026985b72d5ad5b5982d852e4d1fcf442 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;
« no previous file with comments | « core/include/fpdfapi/fpdf_objects.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698