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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1323263006: Merge to XFA: Remove unneeded checks for CPDF_Object::GetDict() return values. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index a101de76c07486f4489e5324de7871d882dd2dea..4c2bb346a11f51b243694c0579073946a6f6a707 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -4118,13 +4118,11 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints) {
return FALSE;
}
CPDF_Dictionary* pTrailerDict = pTrailer->GetDict();
- if (pTrailerDict) {
- CPDF_Object* pEncrypt = pTrailerDict->GetElement("Encrypt");
- if (pEncrypt && pEncrypt->GetType() == PDFOBJ_REFERENCE) {
- m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- pTrailer->Release();
- return TRUE;
- }
+ CPDF_Object* pEncrypt = pTrailerDict->GetElement("Encrypt");
+ if (pEncrypt && pEncrypt->GetType() == PDFOBJ_REFERENCE) {
+ m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
+ pTrailer->Release();
+ return TRUE;
}
FX_DWORD xrefpos = GetDirectInteger(pTrailer->GetDict(), FX_BSTRC("Prev"));
if (xrefpos) {
@@ -4241,8 +4239,7 @@ FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo,
}
pPageNode->m_dwPageNo = dwPageNo;
CPDF_Dictionary* pDict = pPage->GetDict();
- CFX_ByteString type =
- pDict ? pDict->GetString(FX_BSTRC("Type")) : CFX_ByteString();
+ CFX_ByteString type = pDict->GetString(FX_BSTRC("Type"));
if (type == FX_BSTRC("Pages")) {
pPageNode->m_type = PDF_PAGENODE_PAGES;
CPDF_Object* pKids = pDict->GetElement(FX_BSTRC("Kids"));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698