From 48606843d54c5f870d69627afedd574b58d65b3e Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 17 Apr 2015 13:57:46 -0700 Subject: Replace FX_NEW with new, remove tests from fpdfsdk R=thestig@chromium.org Review URL: https://codereview.chromium.org/1089823004 --- fpdfsdk/include/javascript/JS_Define.h | 8 ++--- fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp | 14 ++++---- fpdfsdk/src/fpdf_dataavail.cpp | 4 +-- fpdfsdk/src/fpdf_ext.cpp | 12 +++---- fpdfsdk/src/fpdf_flatten.cpp | 54 +++++++++++++--------------- fpdfsdk/src/fpdf_progressive.cpp | 11 +++--- fpdfsdk/src/fpdf_sysfontinfo.cpp | 2 +- fpdfsdk/src/fpdf_transformpage.cpp | 58 ++++++++++++++---------------- fpdfsdk/src/fpdfdoc.cpp | 2 +- fpdfsdk/src/fpdfeditimg.cpp | 7 ++-- fpdfsdk/src/fpdfeditpage.cpp | 34 ++++++++---------- fpdfsdk/src/fpdfformfill.cpp | 28 +++------------ fpdfsdk/src/fpdfview.cpp | 53 +++++++++++++-------------- fpdfsdk/src/fsdk_baseannot.cpp | 32 +++++++---------- fpdfsdk/src/fsdk_baseform.cpp | 6 ++-- fpdfsdk/src/jsapi/fxjs_v8.cpp | 17 +++++---- fpdfsdk/src/pdfwindow/PWL_FontMap.cpp | 2 +- 17 files changed, 147 insertions(+), 197 deletions(-) diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index 3fa4264360..67f283b40e 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -169,8 +169,8 @@ void JSMethod(const char* method_name_string, const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\ void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global)\ {\ - CJS_Object* pObj = FX_NEW js_class_name(obj);\ - pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\ + CJS_Object* pObj = new js_class_name(obj);\ + pObj->SetEmbedObject(new class_alternate(pObj));\ JS_SetPrivate(NULL,obj,(void*)pObj); \ pObj->InitInstance(cc);\ }\ @@ -344,8 +344,8 @@ void js_class_name::delprop_##js_class_name##_static(v8::Local prope } \ void js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global)\ {\ - CJS_Object* pObj = FX_NEW js_class_name(obj);\ - pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\ + CJS_Object* pObj = new js_class_name(obj);\ + pObj->SetEmbedObject(new class_alternate(pObj));\ JS_SetPrivate(NULL,obj, (void*)pObj); \ pObj->InitInstance(cc);\ }\ diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index 8e10cc22e3..ad5a167f9a 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -172,9 +172,9 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP"); - if (pAPDict == NULL) + if (pAPDict == NULL) { - pAPDict = FX_NEW CPDF_Dictionary; + pAPDict = new CPDF_Dictionary; m_pAnnotDict->SetAt("AP", pAPDict); } @@ -184,9 +184,9 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl return; CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType); - if (pStream == NULL) + if (pStream == NULL) { - pStream = FX_NEW CPDF_Stream(NULL, 0, NULL); + pStream = new CPDF_Stream(NULL, 0, NULL); FX_INT32 objnum = m_pDocument->AddIndirectObject(pStream); pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum); } @@ -195,7 +195,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl if (!pStreamDict) { - pStreamDict = FX_NEW CPDF_Dictionary; + pStreamDict = new CPDF_Dictionary; pStream->InitStream(NULL, 0, pStreamDict); } @@ -204,7 +204,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources"); if (!pStreamResList) { - pStreamResList = FX_NEW CPDF_Dictionary(); + pStreamResList = new CPDF_Dictionary(); pStreamDict->SetAt("Resources", pStreamResList); } @@ -213,7 +213,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font"); if (!pStreamResFontList) { - pStreamResFontList = FX_NEW CPDF_Dictionary; + pStreamResFontList = new CPDF_Dictionary; FX_INT32 objnum = m_pDocument->AddIndirectObject(pStreamResFontList); pStreamResList->SetAtReference("Font", m_pDocument, objnum); } diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp index d6ed3c3a4b..0f9e9561e6 100644 --- a/fpdfsdk/src/fpdf_dataavail.cpp +++ b/fpdfsdk/src/fpdf_dataavail.cpp @@ -97,7 +97,7 @@ public: DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file) { - CFPDF_DataAvail* pAvail = FX_NEW CFPDF_DataAvail; + CFPDF_DataAvail* pAvail = new CFPDF_DataAvail; pAvail->m_FileAvail.Set(file_avail); pAvail->m_FileRead.Set(file); pAvail->m_pDataAvail = IPDF_DataAvail::Create(&pAvail->m_FileAvail, &pAvail->m_FileRead); @@ -122,7 +122,7 @@ extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code); DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { if (avail == NULL) return NULL; - CPDF_Parser* pParser = FX_NEW CPDF_Parser; + CPDF_Parser* pParser = new CPDF_Parser; pParser->SetPassword(password); FX_DWORD err_code = pParser->StartAsynParse(((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index 93f6e187da..c454756ce9 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -204,17 +204,13 @@ void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code) if(pElement) CheckSharedForm(pElement, "workflowType"); - // XFA Forms - CPDF_InterForm * pInterForm = FX_NEW CPDF_InterForm(pDoc,FALSE); - if (pInterForm) + CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,FALSE); + if (pInterForm->HasXFAForm()) { - if(pInterForm->HasXFAForm()) - { - FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); - } - delete pInterForm; + FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM); } + delete pInterForm; } DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index 6c2d05c771..26ea294617 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -40,7 +40,7 @@ FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage) FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray ) { - CPDF_Page* pPDFPage = FX_NEW CPDF_Page; + CPDF_Page* pPDFPage = new CPDF_Page; pPDFPage->Load( pDoc, pDict, FALSE ); pPDFPage->ParseContent(); @@ -215,10 +215,9 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* //Create a new contents dictionary if (!key.IsEmpty()) { - CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); - if (!pNewContents)return; + CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); pPage->SetAtReference("Contents", pDocument, pDocument->AddIndirectObject(pNewContents)); - + CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE); @@ -233,7 +232,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* { case PDFOBJ_STREAM: { - pContentsArray = FX_NEW CPDF_Array; + pContentsArray = new CPDF_Array; CPDF_Stream* pContents = (CPDF_Stream*)pContentsObj; FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContents); CPDF_StreamAcc acc; @@ -262,7 +261,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* if (!key.IsEmpty()) { - CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); + CPDF_Stream* pNewContents = new CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); dwObjNum = pDocument->AddIndirectObject(pNewContents); pContentsArray->AddReference(pDocument, dwObjNum); @@ -378,40 +377,37 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) if (!rcOriginalMB.IsEmpty()) { - CPDF_Array* pMediaBox = FX_NEW CPDF_Array(); - - pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.left)); - pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.bottom)); - pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.right)); - pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.top)); - + CPDF_Array* pMediaBox = new CPDF_Array(); + pMediaBox->Add(new CPDF_Number(rcOriginalMB.left)); + pMediaBox->Add(new CPDF_Number(rcOriginalMB.bottom)); + pMediaBox->Add(new CPDF_Number(rcOriginalMB.right)); + pMediaBox->Add(new CPDF_Number(rcOriginalMB.top)); pPageDict->SetAt("MediaBox",pMediaBox); } - + if (!rcOriginalCB.IsEmpty()) { - CPDF_Array* pCropBox = FX_NEW CPDF_Array(); - pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.left)); - pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.bottom)); - pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.right)); - pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.top)); + CPDF_Array* pCropBox = new CPDF_Array(); + pCropBox->Add(new CPDF_Number(rcOriginalCB.left)); + pCropBox->Add(new CPDF_Number(rcOriginalCB.bottom)); + pCropBox->Add(new CPDF_Number(rcOriginalCB.right)); + pCropBox->Add(new CPDF_Number(rcOriginalCB.top)); pPageDict->SetAt("ArtBox", pCropBox); } - CPDF_Dictionary* pRes = NULL; - pRes = pPageDict->GetDict("Resources"); + CPDF_Dictionary* pRes = pPageDict->GetDict("Resources"); if (!pRes) { - pRes = FX_NEW CPDF_Dictionary; - pPageDict->SetAt( "Resources", pRes ); + pRes = new CPDF_Dictionary; + pPageDict->SetAt("Resources", pRes); } - CPDF_Stream* pNewXObject = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); + CPDF_Stream* pNewXObject = new CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject); CPDF_Dictionary* pPageXObject = pRes->GetDict("XObject"); if (!pPageXObject) { - pPageXObject = FX_NEW CPDF_Dictionary; + pPageXObject = new CPDF_Dictionary; pRes->SetAt("XObject", pPageXObject); } @@ -439,16 +435,16 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) { pPageXObject->SetAtReference(key, pDocument, dwObjNum); CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict(); - pNewXORes = FX_NEW CPDF_Dictionary; + pNewXORes = new CPDF_Dictionary; pNewOXbjectDic->SetAt("Resources", pNewXORes); pNewOXbjectDic->SetAtName("Type", "XObject"); pNewOXbjectDic->SetAtName("Subtype", "Form"); pNewOXbjectDic->SetAtInteger("FormType", 1); pNewOXbjectDic->SetAtName("Name", "FRM"); - CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox"); + CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox"); pNewOXbjectDic->SetAtRect("BBox", rcBBox); } - + for (int i = 0; i < nStreams; i++) { CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i); @@ -520,7 +516,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) CPDF_Dictionary* pXObject = pNewXORes->GetDict("XObject"); if (!pXObject) { - pXObject = FX_NEW CPDF_Dictionary; + pXObject = new CPDF_Dictionary; pNewXORes->SetAt("XObject", pXObject); } diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp index 2490df8c2f..6b433a2a4f 100644 --- a/fpdfsdk/src/fpdf_progressive.cpp +++ b/fpdfsdk/src/fpdf_progressive.cpp @@ -29,19 +29,16 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE return FPDF_RENDER_FAILED; CPDF_Page* pPage = (CPDF_Page*)page; - -// FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - - CRenderContext* pContext = FX_NEW CRenderContext; - pPage->SetPrivateData((void*)1, pContext, DropContext ); + CRenderContext* pContext = new CRenderContext; + pPage->SetPrivateData((void*)1, pContext, DropContext); #ifdef _SKIA_SUPPORT_ - pContext->m_pDevice = FX_NEW CFX_SkiaDevice; + pContext->m_pDevice = new CFX_SkiaDevice; if (flags & FPDF_REVERSE_BYTE_ORDER) ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); else ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); #else - pContext->m_pDevice = FX_NEW CFX_FxgeDevice; + pContext->m_pDevice = new CFX_FxgeDevice; if (flags & FPDF_REVERSE_BYTE_ORDER) ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); else diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp index f60dc9723e..e916b12069 100644 --- a/fpdfsdk/src/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp @@ -89,7 +89,7 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) { if (pFontInfoExt->version != 1) return; - CSysFontInfo_Ext* pFontInfo = FX_NEW CSysFontInfo_Ext; + CSysFontInfo_Ext* pFontInfo = new CSysFontInfo_Ext; pFontInfo->m_pInfo = pFontInfoExt; CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo(pFontInfo); } diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp index a666666d55..cfe1688f68 100644 --- a/fpdfsdk/src/fpdf_transformpage.cpp +++ b/fpdfsdk/src/fpdf_transformpage.cpp @@ -11,14 +11,14 @@ DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo { if(!page) return; + CPDF_Page* pPage = (CPDF_Page*)page; CPDF_Dictionary* pPageDict = pPage->m_pFormDict; - CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array; - pMediaBoxArray->Add(FX_NEW CPDF_Number(left)); - pMediaBoxArray->Add(FX_NEW CPDF_Number(bottom)); - pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); - pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); - + CPDF_Array* pMediaBoxArray = new CPDF_Array; + pMediaBoxArray->Add(new CPDF_Number(left)); + pMediaBoxArray->Add(new CPDF_Number(bottom)); + pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(right))); + pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(top))); pPageDict->SetAt("MediaBox", pMediaBoxArray); } @@ -27,15 +27,14 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bot { if(!page) return; + CPDF_Page* pPage = (CPDF_Page*)page; CPDF_Dictionary* pPageDict = pPage->m_pFormDict; - CPDF_Array* pCropBoxArray = FX_NEW CPDF_Array; - pCropBoxArray->Add(FX_NEW CPDF_Number(left)); - pCropBoxArray->Add(FX_NEW CPDF_Number(bottom)); - pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); - pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); - - + CPDF_Array* pCropBoxArray = new CPDF_Array; + pCropBoxArray->Add(new CPDF_Number(left)); + pCropBoxArray->Add(new CPDF_Number(bottom)); + pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(right))); + pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(top))); pPageDict->SetAt("CropBox", pCropBoxArray); } @@ -102,16 +101,16 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX if(!pContentObj) return FALSE; - CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary; - CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic); + CPDF_Dictionary* pDic = new CPDF_Dictionary; + CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic); pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE); CPDF_Document* pDoc = pPage->m_pDocument; if(!pDoc) return FALSE; pDoc->AddIndirectObject(pStream); - pDic = FX_NEW CPDF_Dictionary; - CPDF_Stream* pEndStream = FX_NEW CPDF_Stream(NULL,0, pDic); + pDic = new CPDF_Dictionary; + CPDF_Stream* pEndStream = new CPDF_Stream(NULL,0, pDic); pEndStream->SetData((FX_LPCBYTE)" Q", 2, FALSE, FALSE); pDoc->AddIndirectObject(pEndStream); @@ -119,7 +118,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY) { pContentArray = (CPDF_Array*)pContentObj; - CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); + CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); pContentArray->AddReference(pDoc,pEndStream); @@ -133,21 +132,20 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX if(pDirectObj->GetType() == PDFOBJ_ARRAY) { pContentArray = (CPDF_Array*)pDirectObj; - CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); + CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); pContentArray->AddReference(pDoc,pEndStream); - } else if(pDirectObj->GetType() == PDFOBJ_STREAM) { - pContentArray = FX_NEW CPDF_Array(); + pContentArray = new CPDF_Array(); pContentArray->AddReference(pDoc,pStream->GetObjNum()); pContentArray->AddReference(pDoc,pDirectObj->GetObjNum()); pContentArray->AddReference(pDoc, pEndStream); pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray)); } } - } + } //Need to transform the patterns as well. CPDF_Dictionary* pRes = pPageDic->GetDict(FX_BSTRC("Resources")); @@ -202,7 +200,7 @@ DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top) { - CPDF_ClipPath* pNewClipPath = FX_NEW CPDF_ClipPath(); + CPDF_ClipPath* pNewClipPath = new CPDF_ClipPath(); pNewClipPath->GetModify(); CPDF_Path Path; Path.GetModify(); @@ -283,8 +281,8 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip strClip << "W* n\n"; } } - CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary; - CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic); + CPDF_Dictionary* pDic = new CPDF_Dictionary; + CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic); pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE); CPDF_Document* pDoc = pPage->m_pDocument; if(!pDoc) @@ -295,9 +293,8 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY) { pContentArray = (CPDF_Array*)pContentObj; - CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); + CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); - } else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE) { @@ -308,18 +305,17 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip if(pDirectObj->GetType() == PDFOBJ_ARRAY) { pContentArray = (CPDF_Array*)pDirectObj; - CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); + CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); - } else if(pDirectObj->GetType() == PDFOBJ_STREAM) { - pContentArray = FX_NEW CPDF_Array(); + pContentArray = new CPDF_Array(); pContentArray->AddReference(pDoc,pStream->GetObjNum()); pContentArray->AddReference(pDoc,pDirectObj->GetObjNum()); pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray)); } } - } + } } diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index d1f741bca9..6f36674e68 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -173,7 +173,7 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, do CPDF_Document* pDoc = pPage->m_pDocument; CPDF_LinkList* pLinkList = (CPDF_LinkList*)pDoc->GetPrivateData(&THISMODULE); if (!pLinkList) { - pLinkList = FX_NEW CPDF_LinkList(pDoc); + pLinkList = new CPDF_LinkList(pDoc); pDoc->SetPrivateData(&THISMODULE, pLinkList, ReleaseLinkList); } return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y).GetDict(); diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp index c29d2b74f8..6e7e1965b5 100644 --- a/fpdfsdk/src/fpdfeditimg.cpp +++ b/fpdfsdk/src/fpdfeditimg.cpp @@ -12,8 +12,8 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document) { if (!document) return NULL; - CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; - CPDF_Image* pImg = FX_NEW CPDF_Image((CPDF_Document *)document); + CPDF_ImageObject* pImageObj = new CPDF_ImageObject; + CPDF_Image* pImg = new CPDF_Image((CPDF_Document *)document); pImageObj->m_pImage = pImg; return pImageObj; } @@ -23,8 +23,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCou if (!image_object || !fileAccess) return FALSE; - IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess); - + IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess); CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object; pImgObj->m_GeneralState.GetModify(); for (int index=0;indexCreateNewDoc(); time_t currentTime; @@ -43,7 +41,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() { if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr)); - pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"PDFium")); + pInfoDict->SetAt("Creator", new CPDF_String(L"PDFium")); } return pDoc; @@ -77,17 +75,17 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, CPDF_Dictionary* pPageDict = pDoc->CreateNewPage(page_index); if(!pPageDict) return NULL; - CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array; - pMediaBoxArray->Add(FX_NEW CPDF_Number(0)); - pMediaBoxArray->Add(FX_NEW CPDF_Number(0)); - pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(width))); - pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(height))); + CPDF_Array* pMediaBoxArray = new CPDF_Array; + pMediaBoxArray->Add(new CPDF_Number(0)); + pMediaBoxArray->Add(new CPDF_Number(0)); + pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(width))); + pMediaBoxArray->Add(new CPDF_Number(FX_FLOAT(height))); pPageDict->SetAt("MediaBox", pMediaBoxArray); - pPageDict->SetAt("Rotate", FX_NEW CPDF_Number(0)); - pPageDict->SetAt("Resources", FX_NEW CPDF_Dictionary); + pPageDict->SetAt("Rotate", new CPDF_Number(0)); + pPageDict->SetAt("Resources", new CPDF_Dictionary); - CPDF_Page* pPage = FX_NEW CPDF_Page; + CPDF_Page* pPage = new CPDF_Page; pPage->Load(pDoc,pPageDict); pPage->ParseContent(); @@ -275,7 +273,6 @@ DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object; if(pPageObj == NULL) return; -//PDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject; CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f); pPageObj->Transform(matrix); } @@ -297,15 +294,14 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, CPDF_Array *pRectArray = NULL; pRectArray = pAnnot->m_pAnnotDict->GetArray("Rect"); if (!pRectArray) pRectArray=CPDF_Array::Create(); - pRectArray->SetAt(0,FX_NEW CPDF_Number(rect.left)); - pRectArray->SetAt(1,FX_NEW CPDF_Number(rect.bottom)); - pRectArray->SetAt(2,FX_NEW CPDF_Number(rect.right)); - pRectArray->SetAt(3,FX_NEW CPDF_Number(rect.top)); + pRectArray->SetAt(0, new CPDF_Number(rect.left)); + pRectArray->SetAt(1, new CPDF_Number(rect.bottom)); + pRectArray->SetAt(2, new CPDF_Number(rect.right)); + pRectArray->SetAt(3, new CPDF_Number(rect.top)); pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray); //Transform AP's rectangle //To Do - } } @@ -321,5 +317,5 @@ DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) CPDF_Dictionary* pDict = pPage->m_pFormDict; rotate %=4; - pDict->SetAt("Rotate", FX_NEW CPDF_Number(rotate * 90)); + pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); } diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index fc84d28dc9..0f94733347 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -206,13 +206,10 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, options.m_ForeColor = 0; options.m_BackColor = 0xffffff; } - - options.m_AddFlags = flags >> 8; - options.m_pOCContext = FX_NEW CPDF_OCContext(pPage->m_pDocument); + options.m_AddFlags = flags >> 8; + options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument); - //FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - CFX_AffineMatrix matrix; pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); @@ -223,30 +220,15 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, clip.bottom = start_y + size_y; #ifdef _SKIA_SUPPORT_ - CFX_SkiaDevice* pDevice = FX_NEW CFX_SkiaDevice; + CFX_SkiaDevice* pDevice = new CFX_SkiaDevice; #else - CFX_FxgeDevice* pDevice = NULL; - pDevice = FX_NEW CFX_FxgeDevice; + CFX_FxgeDevice* pDevice = new CFX_FxgeDevice; #endif - - if (!pDevice) - return; pDevice->Attach((CFX_DIBitmap*)bitmap); pDevice->SaveState(); pDevice->SetClip_Rect(&clip); - - - CPDF_RenderContext* pContext = NULL; - pContext = FX_NEW CPDF_RenderContext; - if (!pContext) - { - delete pDevice; - pDevice = NULL; - return; - } - -// CPDF_Document* pDoc = pPage->m_pDocument; + CPDF_RenderContext* pContext = new CPDF_RenderContext; CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc(); if(!pFXDoc) diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 11ef232a4f..5df563ffa4 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -184,7 +184,7 @@ DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password) { - CPDF_Parser* pParser = FX_NEW CPDF_Parser; + CPDF_Parser* pParser = new CPDF_Parser; pParser->SetPassword(password); FX_DWORD err_code = pParser->StartParse((FX_LPCSTR)file_path); @@ -224,9 +224,9 @@ private: }; DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password) { - CPDF_Parser* pParser = FX_NEW CPDF_Parser; + CPDF_Parser* pParser = new CPDF_Parser; pParser->SetPassword(password); - CMemFile* pMemFile = FX_NEW CMemFile((FX_BYTE*)data_buf, size); + CMemFile* pMemFile = new CMemFile((FX_BYTE*)data_buf, size); FX_DWORD err_code = pParser->StartParse(pMemFile); if (err_code) { delete pParser; @@ -241,9 +241,9 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, int s DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password) { - CPDF_Parser* pParser = FX_NEW CPDF_Parser; + CPDF_Parser* pParser = new CPDF_Parser; pParser->SetPassword(password); - CPDF_CustomAccess* pFile = FX_NEW CPDF_CustomAccess(pFileAccess); + CPDF_CustomAccess* pFile = new CPDF_CustomAccess(pFileAccess); FX_DWORD err_code = pParser->StartParse(pFile); if (err_code) { delete pParser; @@ -301,17 +301,14 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index { if (document == NULL) return NULL; if (page_index < 0 || page_index >= FPDF_GetPageCount(document)) return NULL; -// CPDF_Parser* pParser = (CPDF_Parser*)document; + CPDF_Document* pDoc = (CPDF_Document*)document; if (pDoc == NULL) return NULL; CPDF_Dictionary* pDict = pDoc->GetPage(page_index); if (pDict == NULL) return NULL; - CPDF_Page* pPage = FX_NEW CPDF_Page; + CPDF_Page* pPage = new CPDF_Page; pPage->Load(pDoc, pDict); pPage->ParseContent(); - -// CheckUnSupportError(pDoc, 0); - return pPage; } @@ -349,7 +346,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int if (page==NULL) return; CPDF_Page* pPage = (CPDF_Page*)page; - CRenderContext* pContext = FX_NEW CRenderContext; + CRenderContext* pContext = new CRenderContext; pPage->SetPrivateData((void*)1, pContext, DropContext); #ifndef _WIN32_WCE @@ -359,19 +356,19 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int if (bBackgroundAlphaNeeded) { - pBitmap = FX_NEW CFX_DIBitmap; + pBitmap = new CFX_DIBitmap; pBitmap->Create(size_x, size_y, FXDIB_Argb); pBitmap->Clear(0x00ffffff); #ifdef _SKIA_SUPPORT_ - pContext->m_pDevice = FX_NEW CFX_SkiaDevice; + pContext->m_pDevice = new CFX_SkiaDevice; ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap); #else - pContext->m_pDevice = FX_NEW CFX_FxgeDevice; + pContext->m_pDevice = new CFX_FxgeDevice; ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap); #endif } else - pContext->m_pDevice = FX_NEW CFX_WindowsDevice(dc); + pContext->m_pDevice = new CFX_WindowsDevice(dc); Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL); @@ -383,7 +380,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { - CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap; + CFX_DIBitmap* pDst = new CFX_DIBitmap; int pitch = pBitmap->GetPitch(); pDst->Create(size_x, size_y, FXDIB_Rgb32); FXSYS_memset(pDst->GetBuffer(), -1, pitch*size_y); @@ -446,11 +443,11 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int #endif // Create a device with this external buffer - pContext->m_pBitmap = FX_NEW CFX_DIBitmap; + pContext->m_pBitmap = new CFX_DIBitmap; pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (FX_LPBYTE)pBuffer); - pContext->m_pDevice = FX_NEW CPDF_FxgeDevice; + pContext->m_pDevice = new CPDF_FxgeDevice; ((CPDF_FxgeDevice*)pContext->m_pDevice)->Attach(pContext->m_pBitmap); - + #ifdef DEBUG_TRACE CPDF_ModuleMgr::Get()->ReportError(999, "Ready for PDF rendering"); #endif @@ -508,17 +505,17 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, CPDF_Page* pPage = (CPDF_Page*)page; - CRenderContext* pContext = FX_NEW CRenderContext; + CRenderContext* pContext = new CRenderContext; pPage->SetPrivateData((void*)1, pContext, DropContext); #ifdef _SKIA_SUPPORT_ - pContext->m_pDevice = FX_NEW CFX_SkiaDevice; + pContext->m_pDevice = new CFX_SkiaDevice; if (flags & FPDF_REVERSE_BYTE_ORDER) ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); else ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); #else - pContext->m_pDevice = FX_NEW CFX_FxgeDevice; + pContext->m_pDevice = new CFX_FxgeDevice; if (flags & FPDF_REVERSE_BYTE_ORDER) ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE); @@ -600,7 +597,7 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha) { - CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; + CFX_DIBitmap* pBitmap = new CFX_DIBitmap; pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32); return pBitmap; } @@ -624,7 +621,7 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int for default: return NULL; } - CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; + CFX_DIBitmap* pBitmap = new CFX_DIBitmap; pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride); return pBitmap; } @@ -717,24 +714,22 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_ pContext->m_pDevice->SaveState(); pContext->m_pDevice->SetClip_Rect(&clip); - pContext->m_pContext = FX_NEW CPDF_RenderContext; + pContext->m_pContext = new CPDF_RenderContext; pContext->m_pContext->Create(pPage); pContext->m_pContext->AppendObjectList(pPage, &matrix); if (flags & FPDF_ANNOT) { - pContext->m_pAnnots = FX_NEW CPDF_AnnotList(pPage); + pContext->m_pAnnots = new CPDF_AnnotList(pPage); FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY; pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, TRUE, NULL); } - pContext->m_pRenderer = FX_NEW CPDF_ProgressiveRenderer; + pContext->m_pRenderer = new CPDF_ProgressiveRenderer; pContext->m_pRenderer->Start(pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions, pause); if (bNeedToRestore) { pContext->m_pDevice->RestoreState(); } - -//#endif } DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height) diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 7848740510..2ac6d0d875 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -780,7 +780,7 @@ void CPDFSDK_Annot::SetBorderWidth(int nWidth) if (pBorder) { - pBorder->SetAt(2, FX_NEW CPDF_Number(nWidth)); + pBorder->SetAt(2, new CPDF_Number(nWidth)); } else { @@ -788,7 +788,7 @@ void CPDFSDK_Annot::SetBorderWidth(int nWidth) if (!pBSDict) { - pBSDict = FX_NEW CPDF_Dictionary; + pBSDict = new CPDF_Dictionary; m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); } @@ -827,7 +827,7 @@ void CPDFSDK_Annot::SetBorderStyle(int nStyle) CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); if (!pBSDict) { - pBSDict = FX_NEW CPDF_Dictionary; + pBSDict = new CPDF_Dictionary; m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); } @@ -889,11 +889,11 @@ void CPDFSDK_Annot::SetBorderDash(const CFX_IntArray& array) CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS"); if (!pBSDict) { - pBSDict = FX_NEW CPDF_Dictionary; + pBSDict = new CPDF_Dictionary; m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict); } - CPDF_Array* pArray = FX_NEW CPDF_Array; + CPDF_Array* pArray = new CPDF_Array; for (int i=0,sz=array.GetSize(); iAddInteger(array[i]); @@ -937,7 +937,7 @@ void CPDFSDK_Annot::SetColor(FX_COLORREF color) ASSERT(m_pAnnot != NULL); ASSERT(m_pAnnot->m_pAnnotDict != NULL); - CPDF_Array* pArray = FX_NEW CPDF_Array; + CPDF_Array* pArray = new CPDF_Array; pArray->AddNumber((FX_FLOAT)FXSYS_GetRValue(color) / 255.0f); pArray->AddNumber((FX_FLOAT)FXSYS_GetGValue(color) / 255.0f); pArray->AddNumber((FX_FLOAT)FXSYS_GetBValue(color) / 255.0f); @@ -1010,7 +1010,7 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re if (!pAPDict) { - pAPDict = FX_NEW CPDF_Dictionary; + pAPDict = new CPDF_Dictionary; m_pAnnot->m_pAnnotDict->SetAt("AP", pAPDict); } @@ -1027,7 +1027,7 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re CPDF_Dictionary* pAPTypeDict = pAPDict->GetDict(sAPType); if (!pAPTypeDict) { - pAPTypeDict = FX_NEW CPDF_Dictionary; + pAPTypeDict = new CPDF_Dictionary; pAPDict->SetAt(sAPType, pAPTypeDict); } @@ -1035,24 +1035,18 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re pStream = pAPTypeDict->GetStream(sAPState); } - if (!pStream) + if (!pStream) { - ASSERT(m_pPageView != NULL); CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); - ASSERT(pDoc != NULL); - - pStream = FX_NEW CPDF_Stream(NULL, 0, NULL); + pStream = new CPDF_Stream(NULL, 0, NULL); FX_INT32 objnum = pDoc->AddIndirectObject(pStream); - //pAPDict->SetAtReference(sAPType, pDoc, objnum); - ASSERT(pParentDict != NULL); pParentDict->SetAtReference(sAPType, pDoc, objnum); } - - CPDF_Dictionary * pStreamDict = pStream->GetDict(); - + + CPDF_Dictionary *pStreamDict = pStream->GetDict(); if (!pStreamDict) { - pStreamDict = FX_NEW CPDF_Dictionary; + pStreamDict = new CPDF_Dictionary; pStreamDict->SetAtName("Type", "XObject"); pStreamDict->SetAtName("Subtype", "Form"); pStreamDict->SetAtInteger("FormType", 1); diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index a53e914b5c..6c8069b92a 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -1564,13 +1564,13 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources"); if (!pStreamResList) { - pStreamResList = FX_NEW CPDF_Dictionary(); + pStreamResList = new CPDF_Dictionary(); pStreamDict->SetAt("Resources", pStreamResList); } - if (pStreamResList) + if (pStreamResList) { - CPDF_Dictionary* pXObject = FX_NEW CPDF_Dictionary; + CPDF_Dictionary* pXObject = new CPDF_Dictionary; pXObject->SetAtReference(sImageAlias, pDoc, pImage); pStreamResList->SetAt("XObject", pXObject); } diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index fdac40d470..5a77713fb4 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -80,12 +80,12 @@ int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE e v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); - if(!pArray) + if(!pArray) { - pArray = FX_NEW CFX_PtrArray(); + pArray = new CFX_PtrArray(); isolate->SetData(0, pArray); } - CJS_ObjDefintion* pObjDef = FX_NEW CJS_ObjDefintion(isolate, sObjName, eObjType, pConstructor, pDestructor, bApplyNew); + CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(isolate, sObjName, eObjType, pConstructor, pDestructor, bApplyNew); pArray->Add(pObjDef); return pArray->GetSize()-1; } @@ -263,7 +263,7 @@ void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_ if(ws.Equal(L"Document")) { - CJS_PrivateData* pPrivateData = FX_NEW CJS_PrivateData; + CJS_PrivateData* pPrivateData = new CJS_PrivateData; pPrivateData->ObjDefID = i; v8::Handle ptr = v8::External::New(isolate, pPrivateData); @@ -377,14 +377,13 @@ v8::Handle JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context v8::Local context = isolate->GetCurrentContext(); v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); - v8::Local obj = objTemp->NewInstance(); - - CJS_PrivateData* pPrivateData = FX_NEW CJS_PrivateData; + + CJS_PrivateData* pPrivateData = new CJS_PrivateData; pPrivateData->ObjDefID = nObjDefnID; - v8::Handle ptr = v8::External::New(isolate, pPrivateData); - obj->SetInternalField(0, ptr); + v8::Handle ptr = v8::External::New(isolate, pPrivateData); + obj->SetInternalField(0, ptr); if(pObjDef->m_pConstructor) pObjDef->m_pConstructor(pJSContext, obj, context->Global()->GetPrototype()->ToObject()); diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp index 10549d583e..578511359c 100644 --- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp @@ -41,7 +41,7 @@ CPDF_Document* CPWL_FontMap::GetDocument() { if (CPDF_ModuleMgr::Get()) { - m_pPDFDoc = FX_NEW CPDF_Document; + m_pPDFDoc = new CPDF_Document; m_pPDFDoc->CreateNewDoc(); } } -- cgit v1.2.3