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

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

Issue 1417033004: Merge to XFA: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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
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 036b293792868bdd29d971e275fcbfc5ffdb6d24..f6e1ee895a91c8946c29ec7d07fb997416defc6e 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -3813,8 +3813,9 @@ int32_t CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints,
return 0;
}
CPDF_Dictionary* pDict = pObj->GetDict();
- CPDF_Object* pName = pDict ? pDict->GetElement(FX_BSTRC("Type")) : NULL;
- if (pName && pName->GetType() == PDFOBJ_NAME) {
+ CPDF_Name* pName =
+ ToName(pDict ? pDict->GetElement(FX_BSTRC("Type")) : nullptr);
+ if (pName) {
if (pName->GetString() == FX_BSTRC("XRef")) {
m_Pos += m_parser.m_Syntax.SavePos();
xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev"));

Powered by Google App Engine
This is Rietveld 408576698