summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-05-06 14:48:28 -0700
committerLei Zhang <thestig@chromium.org>2015-05-06 14:48:28 -0700
commit5734d862cb22eca6e9644ea7d1c096d70123434f (patch)
tree896e80b1809d3961375e0cdca6b78fbe4ec7d8f5 /core/src/fpdfapi/fpdf_edit
parent903e03a03ad4526252874d8ba15258e7c2955739 (diff)
downloadpdfium-5734d862cb22eca6e9644ea7d1c096d70123434f.tar.xz
Merge to XFA: Replace FX_NEW with new, remove tests from fpdfapi
Very few places where a change is required, but remove FX_NEW to show they've been audited. Review URL: https://codereview.chromium.org/1075953004 (cherry picked from commit 5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1125183006
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp81
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp28
4 files changed, 62 insertions, 63 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index e8c051b434..b64151ad06 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -50,7 +50,7 @@ void CPDF_PageContentGenerate::GenerateContent()
if (pContent != NULL) {
pPageDict->RemoveAt("Contents");
}
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
@@ -58,13 +58,13 @@ void CPDF_PageContentGenerate::GenerateContent()
CFX_ByteString CPDF_PageContentGenerate::RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType)
{
if (m_pPage->m_pResources == NULL) {
- m_pPage->m_pResources = FX_NEW CPDF_Dictionary;
+ m_pPage->m_pResources = new CPDF_Dictionary;
int objnum = m_pDocument->AddIndirectObject(m_pPage->m_pResources);
m_pPage->m_pFormDict->SetAtReference("Resources", m_pDocument, objnum);
}
CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDict(szType);
if (pResList == NULL) {
- pResList = FX_NEW CPDF_Dictionary;
+ pResList = new CPDF_Dictionary;
m_pPage->m_pResources->SetAt(szType, pResList);
}
m_pDocument->AddIndirectObject(pResourceObj);
@@ -104,7 +104,7 @@ void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data
if (!data || !size) {
return;
}
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create();
pFormDict->SetAtName(FX_BSTR("Type"), FX_BSTR("XObject"));
pFormDict->SetAtName(FX_BSTR("Subtype"), FX_BSTR("Form"));
@@ -136,7 +136,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
if (!pContent || pContent->GetType() != PDFOBJ_STREAM) {
continue;
}
- CPDF_StreamAcc* pStream = FX_NEW CPDF_StreamAcc();
+ CPDF_StreamAcc* pStream = new CPDF_StreamAcc();
pStream->LoadAllData((CPDF_Stream*)pContent);
pContentArray[i] = pStream;
size += pContentArray[i]->GetSize() + 1;
@@ -157,7 +157,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
contentStream.LoadAllData((CPDF_Stream*)pContent);
ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
}
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 7795f1fe91..0886d3ff53 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -1485,7 +1485,7 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
CPDF_Dictionary* pDict = m_pDocument->GetRoot();
m_pMetadata = pDict ? pDict->GetElementValue(FX_BSTRC("Metadata")) : NULL;
if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
- m_pXRefStream = FX_NEW CPDF_XRefStream;
+ m_pXRefStream = new CPDF_XRefStream;
m_pXRefStream->Start();
if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser) {
FX_FILESIZE prev = m_pParser->GetLastXRefOffset();
@@ -2072,7 +2072,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault )
if (m_pCryptoHandler && m_bNewCrypto) {
delete m_pCryptoHandler;
}
- m_pCryptoHandler = FX_NEW CPDF_StandardCryptoHandler;
+ m_pCryptoHandler = new CPDF_StandardCryptoHandler;
m_pCryptoHandler->Init(m_pEncryptDict, &handler);
m_bNewCrypto = TRUE;
m_bSecurityChanged = TRUE;
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index b6c1dff84b..9d0967978c 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -21,16 +21,16 @@ CPDF_Document::CPDF_Document() : CPDF_IndirectObjects(NULL)
void CPDF_Document::CreateNewDoc()
{
ASSERT(m_pRootDict == NULL && m_pInfoDict == NULL);
- m_pRootDict = FX_NEW CPDF_Dictionary;
+ m_pRootDict = new CPDF_Dictionary;
m_pRootDict->SetAtName("Type", "Catalog");
int objnum = AddIndirectObject(m_pRootDict);
- CPDF_Dictionary* pPages = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pPages = new CPDF_Dictionary;
pPages->SetAtName("Type", "Pages");
pPages->SetAtNumber("Count", 0);
- pPages->SetAt("Kids", FX_NEW CPDF_Array);
+ pPages->SetAt("Kids", new CPDF_Array);
objnum = AddIndirectObject(pPages);
m_pRootDict->SetAtReference("Pages", this, objnum);
- m_pInfoDict = FX_NEW CPDF_Dictionary;
+ m_pInfoDict = new CPDF_Dictionary;
AddIndirectObject(m_pInfoDict);
}
static const FX_WCHAR g_FX_CP874Unicodes[128] = {
@@ -207,7 +207,7 @@ static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArr
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray1 = new CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
@@ -288,7 +288,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B
bbox[3] = ptm->otmrcFontBox.top;
FX_Free(tm_buf);
basefont.Replace(" ", "");
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pBaseDict = new CPDF_Dictionary;
pBaseDict->SetAtName("Type", "Font");
CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
@@ -308,9 +308,9 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B
break;
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pEncoding = new CPDF_Dictionary;
pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
@@ -339,18 +339,18 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B
pBaseDict->SetAtNumber("LastChar", 255);
int char_widths[224];
GetCharWidth(hDC, 32, 255, char_widths);
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ CPDF_Array* pWidths = new CPDF_Array;
for (int i = 0; i < 224; i ++) {
pWidths->AddInteger(char_widths[i]);
}
pBaseDict->SetAt("Widths", pWidths);
} else {
flags |= PDFFONT_NONSYMBOLIC;
- pFontDict = FX_NEW CPDF_Dictionary;
+ pFontDict = new CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray = new CPDF_Array;
switch (pLogFont->lfCharSet) {
case CHINESEBIG5_CHARSET:
cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
@@ -395,22 +395,22 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pCIDSysInfo = new CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pFontDesc = new CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ CPDF_Array* pBBox = new CPDF_Array;
for (int i = 0; i < 4; i ++) {
pBBox->AddInteger(bbox[i]);
}
@@ -590,7 +590,7 @@ static void _InsertWidthArray(CTFontRef font, int start, int end, CPDF_Array* pW
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray1 = new CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
@@ -666,9 +666,8 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr
CFRelease(fullName);
}
basefont.Replace(" ", "");
- CPDF_Dictionary* pFontDict = NULL;
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
- pFontDict = pBaseDict;
+ CPDF_Dictionary* pBaseDict = new CPDF_Dictionary;
+ CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
charSets.RemoveAll();
charSets.Add(FXFONT_ANSI_CHARSET);
@@ -694,9 +693,9 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr
}
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pEncoding = new CPDF_Dictionary;
pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
@@ -725,7 +724,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr
pBaseDict->SetAtNumber("LastChar", 255);
int char_widths[224];
FX_GetCharWidth(font, 32, 255, char_widths);
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ CPDF_Array* pWidths = new CPDF_Array;
for (int i = 0; i < 224; i ++) {
pWidths->AddInteger(char_widths[i]);
}
@@ -733,12 +732,12 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr
} else {
flags |= PDFFONT_NONSYMBOLIC;
CPDF_Array* pArray = NULL;
- pFontDict = FX_NEW CPDF_Dictionary;
+ pFontDict = new CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
FX_BOOL bFound = FALSE;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray = new CPDF_Array;
charSets.RemoveAll();
charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
if (IsHasCharSet(languages, charSets)) {
@@ -792,22 +791,22 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTr
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pCIDSysInfo = new CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- pArray = FX_NEW CPDF_Array;
+ pArray = new CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pFontDesc = new CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ CPDF_Array* pBBox = new CPDF_Array;
for (int i = 0; i < 4; i ++) {
pBBox->AddInteger(bbox[i]);
}
@@ -859,7 +858,7 @@ static void _InsertWidthArray1(CFX_Font* pFont, IFX_FontEncoding* pEncoding, FX_
pWidthArray->AddInteger(first + size - 1);
pWidthArray->AddInteger(*widths);
} else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray1 = new CPDF_Array;
pWidthArray->Add(pWidthArray1);
for (i = 0; i < size; i ++) {
pWidthArray1->AddInteger(widths[i]);
@@ -886,12 +885,12 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
if (pFont->IsFixedWidth()) {
flags |= PDFFONT_FIXEDPITCH;
}
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pBaseDict = new CPDF_Dictionary;
pBaseDict->SetAtName("Type", "Font");
IFX_FontEncoding* pEncoding = FXGE_CreateUnicodeEncoding(pFont);
CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ CPDF_Array* pWidths = new CPDF_Array;
int charcode;
for (charcode = 32; charcode < 128; charcode ++) {
int glyph_index = pEncoding->GlyphFromCharCode(charcode);
@@ -919,9 +918,9 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
break;
}
if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncodingDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pEncodingDict = new CPDF_Dictionary;
pEncodingDict->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(128);
const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
for (int j = 0; j < 128; j ++) {
@@ -954,11 +953,11 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
pBaseDict->SetAt("Widths", pWidths);
} else {
flags |= PDFFONT_NONSYMBOLIC;
- pFontDict = FX_NEW CPDF_Dictionary;
+ pFontDict = new CPDF_Dictionary;
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ CPDF_Array* pWidthArray = new CPDF_Array;
switch (charset) {
case FXFONT_CHINESEBIG5_CHARSET:
cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
@@ -1003,18 +1002,18 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
pFontDict->SetAtName("Type", "Font");
pFontDict->SetAtName("Subtype", "CIDFontType2");
pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pCIDSysInfo = new CPDF_Dictionary;
pCIDSysInfo->SetAtString("Registry", "Adobe");
pCIDSysInfo->SetAtString("Ordering", ordering);
pCIDSysInfo->SetAtInteger("Supplement", supplement);
pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pBaseDict->SetAt("DescendantFonts", pArray);
AddIndirectObject(pFontDict);
pArray->AddReference(this, pFontDict);
}
AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pFontDesc = new CPDF_Dictionary;
pFontDesc->SetAtName("Type", "FontDescriptor");
pFontDesc->SetAtName("FontName", basefont);
pFontDesc->SetAtInteger("Flags", flags);
@@ -1023,7 +1022,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
pFontDesc->SetAtInteger("Descent", pFont->GetDescent());
FX_RECT bbox;
pFont->GetBBox(bbox);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ CPDF_Array* pBBox = new CPDF_Array;
pBBox->AddInteger(bbox.left);
pBBox->AddInteger(bbox.bottom);
pBBox->AddInteger(bbox.right);
@@ -1114,7 +1113,7 @@ static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageD
if (iPage == nPages) {
CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
if (!pPagesList) {
- pPagesList = FX_NEW CPDF_Array;
+ pPagesList = new CPDF_Array;
pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
}
pPagesList->Add(pPageDict, pDoc);
@@ -1132,7 +1131,7 @@ static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageD
}
CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage)
{
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName("Type", "Page");
FX_DWORD dwObjNum = AddIndirectObject(pDict);
if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index d73d7614da..3a3756de5d 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -17,7 +17,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) {
return NULL;
}
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName("Type", "XObject");
pDict->SetAtName("Subtype", "Image");
pDict->SetAtInteger("Width", width);
@@ -40,7 +40,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
pDict->SetAtInteger("BitsPerComponent", bits);
pDict->SetAtName("Filter", "DCTDecode");
if (!color_trans) {
- CPDF_Dictionary* pParms = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pParms = new CPDF_Dictionary;
pDict->SetAt("DecodeParms", pParms);
pParms->SetAtInteger("ColorTransform", 0);
}
@@ -48,7 +48,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
m_Width = width;
m_Height = height;
if (m_pStream == NULL) {
- m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ m_pStream = new CPDF_Stream(NULL, 0, NULL);
}
return pDict;
}
@@ -108,7 +108,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
FX_INT32 src_pitch = pBitmap->GetPitch();
FX_INT32 bpp = pBitmap->GetBPP();
FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth);
@@ -123,15 +123,15 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
}
if (set_a == 0 || reset_a == 0) {
- pDict->SetAt(FX_BSTRC("ImageMask"), FX_NEW CPDF_Boolean(TRUE));
+ pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(TRUE));
if (reset_a == 0) {
- CPDF_Array* pArray = FX_NEW CPDF_Array;
+ CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(1);
pArray->AddInteger(0);
pDict->SetAt(FX_BSTRC("Decode"), pArray);
}
} else {
- CPDF_Array* pCS = FX_NEW CPDF_Array;
+ CPDF_Array* pCS = new CPDF_Array;
pCS->AddName(FX_BSTRC("Indexed"));
pCS->AddName(FX_BSTRC("DeviceRGB"));
pCS->AddInteger(1);
@@ -157,7 +157,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
} else if (bpp == 8) {
FX_INT32 iPalette = pBitmap->GetPaletteSize();
if (iPalette > 0) {
- CPDF_Array* pCS = FX_NEW CPDF_Array;
+ CPDF_Array* pCS = new CPDF_Array;
m_pDocument->AddIndirectObject(pCS);
pCS->AddName(FX_BSTRC("Indexed"));
pCS->AddName(FX_BSTRC("DeviceRGB"));
@@ -211,7 +211,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
FX_LPBYTE mask_buf = NULL;
FX_STRSIZE mask_size;
FX_BOOL bDeleteMask = TRUE;
- CPDF_Dictionary* pMaskDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pMaskDict = new CPDF_Dictionary;
pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
pMaskDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
pMaskDict->SetAtInteger(FX_BSTRC("Width"), maskWidth);
@@ -235,13 +235,13 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
if (bUseMatte) {
int a, r, g, b;
ArgbDecode(*(pParam->pMatteColor), a, r, g, b);
- CPDF_Array* pMatte = FX_NEW CPDF_Array;
+ CPDF_Array* pMatte = new CPDF_Array;
pMatte->AddInteger(r);
pMatte->AddInteger(g);
pMatte->AddInteger(b);
pMaskDict->SetAt(FX_BSTRC("Matte"), pMatte);
}
- pMaskStream = FX_NEW CPDF_Stream(mask_buf, mask_size, pMaskDict);
+ pMaskStream = new CPDF_Stream(mask_buf, mask_size, pMaskDict);
m_pDocument->AddIndirectObject(pMaskStream);
bDeleteMask = FALSE;
pDict->SetAtReference(FX_BSTRC("SMask"), m_pDocument, pMaskStream);
@@ -260,7 +260,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
if (pBitmap->GetBPP() == 1) {
_JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, FALSE);
} else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL) {
- CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
+ CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap();
pNewBitmap->Copy(pBitmap);
pNewBitmap->ConvertFormat(FXDIB_Rgb);
SetImage(pNewBitmap, iCompress, pFileWrite, pFileRead);
@@ -277,7 +277,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
return;
} else {
if (bUseMatte) {
- CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
+ CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap();
pNewBitmap->Create(BitmapWidth, BitmapHeight, FXDIB_Argb);
FX_LPBYTE dst_buf = pNewBitmap->GetBuffer();
FX_INT32 src_offset = 0;
@@ -353,7 +353,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_F
}
}
if (m_pStream == NULL) {
- m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ m_pStream = new CPDF_Stream(NULL, 0, NULL);
}
if (!bStream) {
m_pStream->InitStream(dest_buf, dest_size, pDict);