Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1620)

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 1383933003: XFA: Remove checks for new returning NULL in fpdfsdk. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfeditpage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 414ade70705ea7b80f31d6687a278e1288c4f152..47da1f49de4867aaea49768d5178b618ec1055f1 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;
« no previous file with comments | « fpdfsdk/src/fpdfeditpage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698