summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-16 14:37:47 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-16 14:37:47 -0700
commit5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e (patch)
tree05e79b45a3e8387414c10fda267d6abc381a4dcd /core/src/fpdfapi/fpdf_page
parent7f6b6677665588a27b9d14babc6358840454ce17 (diff)
downloadpdfium-5c357a5d3d873be6b0ab01d7bec82f79d0a09f0e.tar.xz
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. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1075953004
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp70
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp20
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp2
9 files changed, 57 insertions, 93 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index ccdfb9fcbb..998bc274b0 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -15,15 +15,15 @@ CPDF_PageObject* CPDF_PageObject::Create(int type)
{
switch (type) {
case PDFPAGE_TEXT:
- return FX_NEW CPDF_TextObject;
+ return new CPDF_TextObject;
case PDFPAGE_IMAGE:
- return FX_NEW CPDF_ImageObject;
+ return new CPDF_ImageObject;
case PDFPAGE_PATH:
- return FX_NEW CPDF_PathObject;
+ return new CPDF_PathObject;
case PDFPAGE_SHADING:
- return FX_NEW CPDF_ShadingObject;
+ return new CPDF_ShadingObject;
case PDFPAGE_FORM:
- return FX_NEW CPDF_FormObject;
+ return new CPDF_FormObject;
}
return NULL;
}
@@ -896,7 +896,7 @@ void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
return;
}
- m_pParser = FX_NEW CPDF_ContentParser;
+ m_pParser = new CPDF_ContentParser;
m_pParser->Start(this, pOptions);
m_ParseState = PDF_CONTENT_PARSING;
}
@@ -960,7 +960,7 @@ void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pPa
if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
return;
}
- m_pParser = FX_NEW CPDF_ContentParser;
+ m_pParser = new CPDF_ContentParser;
m_pParser->Start(this, pGraphicStates, pParentMatrix, pType3Char, pOptions, level);
m_ParseState = PDF_CONTENT_PARSING;
}
@@ -972,7 +972,7 @@ void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* p
}
CPDF_Form* CPDF_Form::Clone() const
{
- CPDF_Form* pClone = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources);
+ CPDF_Form* pClone = new CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources);
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 86db177ad7..fc4e282f10 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -1142,21 +1142,21 @@ CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj)
CPDF_ColorSpace* pCS = NULL;
FX_DWORD id = familyname.GetID();
if (id == FXBSTR_ID('C', 'a', 'l', 'G')) {
- pCS = FX_NEW CPDF_CalGray();
+ pCS = new CPDF_CalGray();
} else if (id == FXBSTR_ID('C', 'a', 'l', 'R')) {
- pCS = FX_NEW CPDF_CalRGB();
+ pCS = new CPDF_CalRGB();
} else if (id == FXBSTR_ID('L', 'a', 'b', 0)) {
- pCS = FX_NEW CPDF_LabCS();
+ pCS = new CPDF_LabCS();
} else if (id == FXBSTR_ID('I', 'C', 'C', 'B')) {
- pCS = FX_NEW CPDF_ICCBasedCS();
+ pCS = new CPDF_ICCBasedCS();
} else if (id == FXBSTR_ID('I', 'n', 'd', 'e') || id == FXBSTR_ID('I', 0, 0, 0)) {
- pCS = FX_NEW CPDF_IndexedCS();
+ pCS = new CPDF_IndexedCS();
} else if (id == FXBSTR_ID('S', 'e', 'p', 'a')) {
- pCS = FX_NEW CPDF_SeparationCS();
+ pCS = new CPDF_SeparationCS();
} else if (id == FXBSTR_ID('D', 'e', 'v', 'i')) {
- pCS = FX_NEW CPDF_DeviceNCS();
+ pCS = new CPDF_DeviceNCS();
} else if (id == FXBSTR_ID('P', 'a', 't', 't')) {
- pCS = FX_NEW CPDF_PatternCS();
+ pCS = new CPDF_PatternCS();
} else {
return NULL;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 5df664312c..241b5895c5 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -21,7 +21,7 @@ public:
}
virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
{
- return FX_NEW CPDF_DocPageData(pDoc);
+ return new CPDF_DocPageData(pDoc);
}
virtual void ReleaseDoc(CPDF_Document* pDoc);
virtual void ClearDoc(CPDF_Document* pDoc);
@@ -59,11 +59,8 @@ CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family)
}
void CPDF_ModuleMgr::InitPageModule()
{
- if (m_pPageModule) {
- delete m_pPageModule;
- }
- CPDF_PageModule* pPageModule = FX_NEW CPDF_PageModule;
- m_pPageModule = pPageModule;
+ delete m_pPageModule;
+ m_pPageModule = new CPDF_PageModule;
}
void CPDF_PageModule::ReleaseDoc(CPDF_Document* pDoc)
{
@@ -298,11 +295,8 @@ CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnl
}
FX_BOOL bNew = FALSE;
if (!fontData) {
- fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
+ fontData = new CPDF_CountedObject<CPDF_Font*>;
bNew = TRUE;
- if (!fontData) {
- return NULL;
- }
}
CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pFontDict);
if (!pFont) {
@@ -349,7 +343,7 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding
fontData->m_nCount ++;
return pFont;
}
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
pDict->SetAtName(FX_BSTRC("BaseFont"), fontName);
@@ -357,10 +351,7 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding
pDict->SetAt(FX_BSTRC("Encoding"), pEncoding->Realize());
}
m_pPDFDoc->AddIndirectObject(pDict);
- CPDF_CountedObject<CPDF_Font*>* fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
- if (!fontData) {
- return NULL;
- }
+ CPDF_CountedObject<CPDF_Font*>* fontData = new CPDF_CountedObject<CPDF_Font*>;
CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pDict);
if (!pFont) {
delete fontData;
@@ -443,10 +434,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(CPDF_Object* pCSObj, CPDF_Dicti
}
FX_BOOL bNew = FALSE;
if (!csData) {
- csData = FX_NEW CPDF_CountedObject<CPDF_ColorSpace*>;
- if (!csData) {
- return NULL;
- }
+ csData = new CPDF_CountedObject<CPDF_ColorSpace*>;
bNew = TRUE;
}
CPDF_ColorSpace* pCS = CPDF_ColorSpace::Load(m_pPDFDoc, pArray);
@@ -504,23 +492,20 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, FX_BOOL bSh
}
FX_BOOL bNew = FALSE;
if (!ptData) {
- ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>;
+ ptData = new CPDF_CountedObject<CPDF_Pattern*>;
bNew = TRUE;
- if (!ptData) {
- return NULL;
- }
}
CPDF_Pattern* pPattern = NULL;
if (bShading) {
- pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix);
+ pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix);
} else {
CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : NULL;
if (pDict) {
int type = pDict->GetInteger(FX_BSTRC("PatternType"));
if (type == 1) {
- pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
+ pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
} else if (type == 2) {
- pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
+ pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
}
}
}
@@ -560,15 +545,8 @@ CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream)
imageData->m_nCount ++;
return imageData->m_Obj;
}
- imageData = FX_NEW CPDF_CountedObject<CPDF_Image*>;
- if (!imageData) {
- return NULL;
- }
- CPDF_Image* pImage = FX_NEW CPDF_Image(m_pPDFDoc);
- if (!pImage) {
- delete imageData;
- return NULL;
- }
+ imageData = new CPDF_CountedObject<CPDF_Image*>;
+ CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc);
pImage->LoadImageF((CPDF_Stream*)pImageStream, FALSE);
imageData->m_nCount = 2;
imageData->m_Obj = pImage;
@@ -602,15 +580,8 @@ CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream)
ipData->m_nCount++;
return ipData->m_Obj;
}
- CPDF_IccProfile* pProfile = FX_NEW CPDF_IccProfile(stream.GetData(), stream.GetSize());
- if (!pProfile) {
- return NULL;
- }
- ipData = FX_NEW CPDF_CountedObject<CPDF_IccProfile*>;
- if (!ipData) {
- delete pProfile;
- return NULL;
- }
+ CPDF_IccProfile* pProfile = new CPDF_IccProfile(stream.GetData(), stream.GetSize());
+ ipData = new CPDF_CountedObject<CPDF_IccProfile*>;
ipData->m_nCount = 2;
ipData->m_Obj = pProfile;
m_IccProfileMap.SetAt(pIccProfileStream, ipData);
@@ -647,15 +618,8 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
ftData->m_nCount ++;
return ftData->m_Obj;
}
- ftData = FX_NEW CPDF_CountedObject<CPDF_StreamAcc*>;
- if (!ftData) {
- return NULL;
- }
- CPDF_StreamAcc* pFontFile = FX_NEW CPDF_StreamAcc;
- if (!pFontFile) {
- delete ftData;
- return NULL;
- }
+ ftData = new CPDF_CountedObject<CPDF_StreamAcc*>;
+ CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc;
CPDF_Dictionary* pFontDict = pFontStream->GetDict();
FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
if (org_size < 0) {
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index c786df5a5b..bd1cdb6434 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -167,7 +167,7 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
return TRUE;
}
if (word == FX_BSTRC("{")) {
- CPDF_PSProc* pProc = FX_NEW CPDF_PSProc;
+ CPDF_PSProc* pProc = new CPDF_PSProc;
m_Operators.Add((FX_LPVOID)PSOP_PROC);
m_Operators.Add(pProc);
if (!pProc->Parse(parser)) {
@@ -484,7 +484,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
- m_pSampleStream = FX_NEW CPDF_StreamAcc;
+ m_pSampleStream = new CPDF_StreamAcc;
m_pSampleStream->LoadAllData(pStream, FALSE);
m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
int i;
@@ -809,13 +809,13 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj)
return NULL;
}
if (type == 0) {
- pFunc = FX_NEW CPDF_SampledFunc;
+ pFunc = new CPDF_SampledFunc;
} else if (type == 2) {
- pFunc = FX_NEW CPDF_ExpIntFunc;
+ pFunc = new CPDF_ExpIntFunc;
} else if (type == 3) {
- pFunc = FX_NEW CPDF_StitchFunc;
+ pFunc = new CPDF_StitchFunc;
} else if (type == 4) {
- pFunc = FX_NEW CPDF_PSFunc;
+ pFunc = new CPDF_PSFunc;
} else {
return NULL;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index 559d8500b1..40ec13ea6e 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -73,7 +73,7 @@ CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src)
m_pTextList = FX_Alloc(CPDF_TextObject*, m_TextCount);
for (int i = 0; i < m_TextCount; i ++) {
if (src.m_pTextList[i]) {
- m_pTextList[i] = FX_NEW CPDF_TextObject;
+ m_pTextList[i] = new CPDF_TextObject;
m_pTextList[i]->Copy(src.m_pTextList[i]);
} else {
m_pTextList[i] = NULL;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index 5d24ab742a..2b11aefd7d 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -54,7 +54,7 @@ CPDF_Image* CPDF_Image::Clone()
if (m_pStream->GetObjNum()) {
return m_pDocument->GetPageData()->GetImage(m_pStream);
}
- CPDF_Image* pImage = FX_NEW CPDF_Image(m_pDocument);
+ CPDF_Image* pImage = new CPDF_Image(m_pDocument);
pImage->LoadImageF((CPDF_Stream*)((CPDF_Object*)m_pStream)->Clone(), m_bInline);
if (m_bInline) {
CPDF_Dictionary *pInlineDict = (CPDF_Dictionary*)m_pInlineDict->Clone(TRUE);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index deb7127bbe..b306c66dcb 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -83,7 +83,7 @@ void CPDF_StreamContentParser::PrepareParse(CPDF_Document* pDocument,
m_BBox = *pBBox;
}
m_Level = level;
- m_pCurStates = FX_NEW CPDF_AllStates;
+ m_pCurStates = new CPDF_AllStates;
if (pStates) {
m_pCurStates->Copy(*pStates);
} else {
@@ -731,8 +731,8 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream)
parser.Parse(stream.GetData(), stream.GetSize(), 0);
return;
}
- CPDF_FormObject* pFormObj = FX_NEW CPDF_FormObject;
- pFormObj->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources);
+ CPDF_FormObject* pFormObj = new CPDF_FormObject;
+ pFormObj->m_pForm = new CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources);
pFormObj->m_FormMatrix = m_pCurStates->m_CTM;
pFormObj->m_FormMatrix.Concat(m_mtContentToUser);
CPDF_AllStates status;
@@ -756,13 +756,13 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_
CFX_AffineMatrix ImageMatrix;
ImageMatrix.Copy(m_pCurStates->m_CTM);
ImageMatrix.Concat(m_mtContentToUser);
- CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
+ CPDF_ImageObject* pImageObj = new CPDF_ImageObject;
if (pImage) {
pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pImage->GetStream());
} else if (pStream->GetObjNum()) {
pImageObj->m_pImage = m_pDocument->LoadImageF(pStream);
} else {
- pImageObj->m_pImage = FX_NEW CPDF_Image(m_pDocument);
+ pImageObj->m_pImage = new CPDF_Image(m_pDocument);
pImageObj->m_pImage->LoadImageF(pStream, bInline);
}
SetGraphicStates(pImageObj, pImageObj->m_pImage->IsMask(), FALSE, FALSE);
@@ -942,7 +942,7 @@ void CPDF_StreamContentParser::Handle_EndPath()
}
void CPDF_StreamContentParser::Handle_SaveGraphState()
{
- CPDF_AllStates* pStates = FX_NEW CPDF_AllStates;
+ CPDF_AllStates* pStates = new CPDF_AllStates;
pStates->Copy(*m_pCurStates);
m_StateStack.Add(pStates);
}
@@ -1129,7 +1129,7 @@ void CPDF_StreamContentParser::Handle_ShadeFill()
if (!pShading->Load()) {
return;
}
- CPDF_ShadingObject* pObj = FX_NEW CPDF_ShadingObject;
+ CPDF_ShadingObject* pObj = new CPDF_ShadingObject;
pObj->m_pShading = pShading;
SetGraphicStates(pObj, FALSE, FALSE, FALSE);
pObj->m_Matrix = m_pCurStates->m_CTM;
@@ -1289,7 +1289,7 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fIn
} else {
textmode = m_pCurStates->m_TextState.GetObject()->m_TextMode;
}
- CPDF_TextObject* pText = FX_NEW CPDF_TextObject;
+ CPDF_TextObject* pText = new CPDF_TextObject;
m_pLastTextObject = pText;
SetGraphicStates(pText, TRUE, TRUE, TRUE);
if (textmode && textmode != 3 && textmode != 4 && textmode != 7) {
@@ -1308,7 +1308,7 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fIn
m_pCurStates->m_TextX += x_advance;
m_pCurStates->m_TextY += y_advance;
if (textmode > 3) {
- CPDF_TextObject* pCopy = FX_NEW CPDF_TextObject;
+ CPDF_TextObject* pCopy = new CPDF_TextObject;
pCopy->Copy(pText);
m_ClipTextList.Add(pCopy);
}
@@ -1529,7 +1529,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke)
CFX_AffineMatrix matrix = m_pCurStates->m_CTM;
matrix.Concat(m_mtContentToUser);
if (bStroke || FillType) {
- CPDF_PathObject* pPathObj = FX_NEW CPDF_PathObject;
+ CPDF_PathObject* pPathObj = new CPDF_PathObject;
pPathObj->m_bStroke = bStroke;
pPathObj->m_FillType = FillType;
pPathObj->m_Path = Path;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 9177c3e1d4..952fe1d9a9 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -961,7 +961,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
}
if (pContent->GetType() == PDFOBJ_STREAM) {
m_nStreams = 0;
- m_pSingleStream = FX_NEW CPDF_StreamAcc;
+ m_pSingleStream = new CPDF_StreamAcc;
m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
} else if (pContent->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pContent;
@@ -1003,7 +1003,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
}
}
CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser = new CPDF_StreamContentParser;
m_pParser->Initialize();
m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
pResources, &form_bbox, pOptions, pGraphicStates, level);
@@ -1020,7 +1020,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
pData->m_pSoftMask = NULL;
}
m_nStreams = 0;
- m_pSingleStream = FX_NEW CPDF_StreamAcc;
+ m_pSingleStream = new CPDF_StreamAcc;
if (pForm->m_pDocument) {
m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
} else {
@@ -1071,7 +1071,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
m_CurrentOffset = 0;
} else {
CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
- m_pStreamArray[m_CurrentOffset] = FX_NEW CPDF_StreamAcc;
+ m_pStreamArray[m_CurrentOffset] = new CPDF_StreamAcc;
CPDF_Stream* pStreamObj = (CPDF_Stream*)(pContent ? pContent->GetElementValue(m_CurrentOffset) : NULL);
m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
m_CurrentOffset ++;
@@ -1079,7 +1079,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
}
if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
if (m_pParser == NULL) {
- m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser = new CPDF_StreamContentParser;
m_pParser->Initialize();
m_pParser->PrepareParse(m_pObjects->m_pDocument, m_pObjects->m_pPageResources, NULL, NULL, m_pObjects,
m_pObjects->m_pResources, &m_pObjects->m_BBox, &m_Options, NULL, 0);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 9e61ce2f0b..d23d75a25d 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -55,7 +55,7 @@ FX_BOOL CPDF_TilingPattern::Load()
return FALSE;
}
CPDF_Stream* pStream = (CPDF_Stream*)m_pPatternObj;
- m_pForm = FX_NEW CPDF_Form(m_pDocument, NULL, pStream);
+ m_pForm = new CPDF_Form(m_pDocument, NULL, pStream);
m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
m_BBox = pDict->GetRect(FX_BSTRC("BBox"));
return TRUE;