diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-16 14:13:14 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-16 14:13:14 -0700 |
commit | 357d16f8453c2cf0c0afd00eec9e86d03d55fe69 (patch) | |
tree | 7a8fe29a921ae4a9dfc6063fd126c6c62181686f /core/src/fpdfdoc/doc_tagged.cpp | |
parent | 269aaa26f33891f42934fa4f3e4ca3e320018a21 (diff) | |
download | pdfium-357d16f8453c2cf0c0afd00eec9e86d03d55fe69.tar.xz |
Replace FX_NEW with new, remove tests in fpdfdoc.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1090693002
Diffstat (limited to 'core/src/fpdfdoc/doc_tagged.cpp')
-rw-r--r-- | core/src/fpdfdoc/doc_tagged.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp index c5fe39b6ee..e3cd744c61 100644 --- a/core/src/fpdfdoc/doc_tagged.cpp +++ b/core/src/fpdfdoc/doc_tagged.cpp @@ -20,10 +20,7 @@ CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, const CPDF if (!IsTagged(pDoc)) { return NULL; } - CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc); - if (pTree == NULL) { - return NULL; - } + CPDF_StructTreeImpl* pTree = new CPDF_StructTreeImpl(pDoc); pTree->LoadPageTree(pPageDict); return pTree; } @@ -32,10 +29,7 @@ CPDF_StructTree* CPDF_StructTree::LoadDoc(const CPDF_Document* pDoc) if (!IsTagged(pDoc)) { return NULL; } - CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc); - if (pTree == NULL) { - return NULL; - } + CPDF_StructTreeImpl* pTree = new CPDF_StructTreeImpl(pDoc); pTree->LoadDocTree(); return pTree; } @@ -66,10 +60,7 @@ void CPDF_StructTreeImpl::LoadDocTree() return; } if (pKids->GetType() == PDFOBJ_DICTIONARY) { - CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, (CPDF_Dictionary*)pKids); - if (pStructElementImpl == NULL) { - return; - } + CPDF_StructElementImpl* pStructElementImpl = new CPDF_StructElementImpl(this, NULL, (CPDF_Dictionary*)pKids); m_Kids.Add(pStructElementImpl); return; } @@ -79,10 +70,7 @@ void CPDF_StructTreeImpl::LoadDocTree() CPDF_Array* pArray = (CPDF_Array*)pKids; for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) { CPDF_Dictionary* pKid = pArray->GetDict(i); - CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, pKid); - if (pStructElementImpl == NULL) { - return; - } + CPDF_StructElementImpl* pStructElementImpl = new CPDF_StructElementImpl(this, NULL, pKid); m_Kids.Add(pStructElementImpl); } } @@ -140,10 +128,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, if (map.Lookup(pDict, (FX_LPVOID&)pElement)) { return pElement; } - pElement = FX_NEW CPDF_StructElementImpl(this, NULL, pDict); - if (pElement == NULL) { - return NULL; - } + pElement = new CPDF_StructElementImpl(this, NULL, pDict); map.SetAt(pDict, pElement); CPDF_Dictionary* pParent = pDict->GetDict(FX_BSTRC("P")); if (pParent == NULL || pParent->GetString(FX_BSTRC("Type")) == FX_BSTRC("StructTreeRoot")) { @@ -321,7 +306,7 @@ void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum, CPDF_Object* pKidObj, pKid->m_Type = CPDF_StructKid::Element; pKid->m_Element.m_pDict = pKidDict; if (m_pTree->m_pPage == NULL) { - pKid->m_Element.m_pElement = FX_NEW CPDF_StructElementImpl(m_pTree, this, pKidDict); + pKid->m_Element.m_pElement = new CPDF_StructElementImpl(m_pTree, this, pKidDict); } else { pKid->m_Element.m_pElement = NULL; } |