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

Unified Diff: fpdfsdk/src/fpdf_dataavail.cpp

Issue 1634123004: War on #defines - part 2 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Missing break Created 4 years, 11 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
Index: fpdfsdk/src/fpdf_dataavail.cpp
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index f4e235ccf56e276a6c54b427245f34182c055cce..baf8f9c924947a5c08c6a0dac9d5b7000b59e4e1 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -122,19 +122,20 @@ FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints) {
DLLEXPORT FPDF_DOCUMENT STDCALL
FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
- if (!avail)
+ CFPDF_DataAvail* pDataAvail = static_cast<CFPDF_DataAvail*>(avail);
+ if (!pDataAvail)
return NULL;
+
CPDF_Parser* pParser = new CPDF_Parser;
pParser->SetPassword(password);
-
- FX_DWORD err_code = pParser->StartAsynParse(
- ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead());
- if (err_code) {
+ CPDF_Parser::Error error =
+ pParser->StartAsynParse(pDataAvail->m_pDataAvail->GetFileRead());
+ if (error != CPDF_Parser::SUCCESS) {
delete pParser;
- ProcessParseError(err_code);
+ ProcessParseError(error);
return NULL;
}
- ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocument());
+ pDataAvail->m_pDataAvail->SetDocument(pParser->GetDocument());
CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS);
return FPDFDocumentFromCPDFDocument(pParser->GetDocument());
}

Powered by Google App Engine
This is Rietveld 408576698