diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-02 10:10:49 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-02 10:10:49 -0700 |
commit | cb78ef507c272488fd7e4fd6862014333d8a9de5 (patch) | |
tree | fc5ef896bc830bebd4aca2902685dfb097365115 /fpdfsdk/src/fpdfview.cpp | |
parent | 6ac0d2f03c8a00fd770d2beddf57da7755d950a6 (diff) | |
download | pdfium-cb78ef507c272488fd7e4fd6862014333d8a9de5.tar.xz |
XFA: Remove checks for new returning NULL in fpdfsdk.
Based on parts of https://codereview.chromium.org/1089823004
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1383933003 .
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 414ade7070..47da1f49de 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -265,8 +265,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, return NULL; CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); - CPDFXFA_Document* pDocument = new CPDFXFA_Document(pPDFDoc, pProvider); - return pDocument; + return new CPDFXFA_Document(pPDFDoc, pProvider); } DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, @@ -351,8 +350,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, return NULL; CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); - CPDFXFA_Document* pDocument = new CPDFXFA_Document(pPDFDoc, pProvider); - return pDocument; + return new CPDFXFA_Document(pPDFDoc, pProvider); } DLLEXPORT FPDF_DOCUMENT STDCALL @@ -375,8 +373,7 @@ FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, return NULL; CPDFXFA_App* pProvider = CPDFXFA_App::GetInstance(); - CPDFXFA_Document* pDocument = new CPDFXFA_Document(pPDFDoc, pProvider); - return pDocument; + return new CPDFXFA_Document(pPDFDoc, pProvider); } DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, @@ -885,18 +882,6 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height) { - // CPDF_Document* pDoc = (CPDF_Document*)document; - // if(pDoc == NULL) - // return FALSE; - // - // CPDF_Dictionary* pDict = pDoc->GetPage(page_index); - // if (pDict == NULL) return FALSE; - // - // CPDF_Page page; - // page.Load(pDoc, pDict); - // *width = page.GetPageWidth(); - // *height = page.GetPageHeight(); - CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; if (pDoc == NULL) return FALSE; |