summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-18 17:05:11 -0800
committerLei Zhang <thestig@chromium.org>2015-12-18 17:05:11 -0800
commit4880d1a168729d42be736293fb93b514802e4f12 (patch)
tree9cfe5aa73113301487dce8bcef5139fb7295536a /core/src/fpdfapi/fpdf_edit
parentaedd4555ec1a80121f176586cb72180337e4ccd8 (diff)
downloadpdfium-4880d1a168729d42be736293fb93b514802e4f12.tar.xz
Merge to XFA: Get rid of a few CPDF_Object Create() methods and just use new instead.
R=ochang@chromium.org Review URL: https://codereview.chromium.org/1540693002 . (cherry picked from commit d866ab0b44a571c884fdd8ba5a5319adaf607559) Review URL: https://codereview.chromium.org/1541563002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 5810da572b..f00cf5f8f5 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -106,7 +106,7 @@ void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf,
return;
}
CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
- CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create();
+ CPDF_Dictionary* pFormDict = new CPDF_Dictionary;
pFormDict->SetAtName("Type", "XObject");
pFormDict->SetAtName("Subtype", "Form");
CFX_FloatRect bbox = m_pPage->GetPageBBox();
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index b200b8d37d..328728ef24 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -2010,7 +2010,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) {
FX_BOOL bNewId = !m_pIDArray;
if (!m_pIDArray) {
FX_DWORD* pBuffer = NULL;
- m_pIDArray = CPDF_Array::Create();
+ m_pIDArray = new CPDF_Array;
CPDF_Object* pID1 = pOldIDArray ? pOldIDArray->GetElement(0) : NULL;
if (pID1) {
m_pIDArray->Add(pID1->Clone());
@@ -2018,7 +2018,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) {
pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t) this, m_dwLastObjNum, pBuffer);
CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
+ m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument);
}
FX_Free(pBuffer);
}
@@ -2034,7 +2034,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) {
FX_DWORD* pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t) this, m_dwLastObjNum, pBuffer);
CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
+ m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument);
FX_Free(pBuffer);
return;
}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 10b0272b52..2b68a0403f 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -33,7 +33,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) {
csname = "DeviceRGB";
} else if (num_comps == 4) {
csname = "DeviceCMYK";
- CPDF_Array* pDecode = CPDF_Array::Create();
+ CPDF_Array* pDecode = new CPDF_Array;
for (int n = 0; n < 4; n++) {
pDecode->AddInteger(1);
pDecode->AddInteger(0);
@@ -151,7 +151,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap,
pBuf[4] = (FX_CHAR)set_g;
pBuf[5] = (FX_CHAR)set_b;
ct.ReleaseBuffer(6);
- pCS->Add(CPDF_String::Create(ct, TRUE));
+ pCS->Add(new CPDF_String(ct, TRUE));
pDict->SetAt("ColorSpace", pCS);
}
pDict->SetAtInteger("BitsPerComponent", 1);