summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_image.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
committerTom Sepez <tsepez@chromium.org>2016-10-14 17:45:56 -0700
commitc25a4219431c90a95233a08f25eecc921abbf3ed (patch)
treebd2ad923d527440785c19623fe2d19cc1a70a92d /core/fpdfapi/page/cpdf_image.cpp
parent62f367348ff8ff1e64c6f52c1ee5f77c3a89edc1 (diff)
downloadpdfium-c25a4219431c90a95233a08f25eecc921abbf3ed.tar.xz
Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 2755381de4..50768c5058 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -204,7 +204,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
} else if (bpp == 8) {
int32_t iPalette = pBitmap->GetPaletteSize();
if (iPalette > 0) {
- UniqueArray pCS(new CPDF_Array);
+ CPDF_Array* pCS = new CPDF_Array;
pCS->AddName("Indexed");
pCS->AddName("DeviceRGB");
pCS->AddInteger(iPalette - 1);
@@ -217,12 +217,12 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
ptr[2] = (uint8_t)argb;
ptr += 3;
}
- CPDF_Stream* pCTS = m_pDocument->AddIndirectStream(
+ CPDF_Stream* pCTS = new CPDF_Stream(
pColorTable, iPalette * 3,
new CPDF_Dictionary(m_pDocument->GetByteStringPool()));
- pCS->AddReference(m_pDocument, pCTS->GetObjNum());
+ pCS->AddReference(m_pDocument, m_pDocument->AddIndirectObject(pCTS));
pDict->SetReferenceFor("ColorSpace", m_pDocument,
- m_pDocument->AddIndirectObject(std::move(pCS)));
+ m_pDocument->AddIndirectObject(pCS));
} else {
pDict->SetNameFor("ColorSpace", "DeviceGray");
}
@@ -274,9 +274,9 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
}
}
pMaskDict->SetIntegerFor("Length", mask_size);
- pDict->SetReferenceFor(
- "SMask", m_pDocument,
- m_pDocument->AddIndirectStream(mask_buf, mask_size, pMaskDict));
+ pDict->SetReferenceFor("SMask", m_pDocument,
+ m_pDocument->AddIndirectObject(new CPDF_Stream(
+ mask_buf, mask_size, pMaskDict)));
if (bDeleteMask)
delete pMaskBitmap;
}