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

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

Issue 1617043004: Fixed object references in CPDF_Object (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: style 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
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 56f5a2c4b4f489c8fd5497ada6862b7f8f70c3d0..681b6bae918551a03135f0945bcc7996fbba62f0 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -93,7 +93,7 @@ CFX_ByteStringC CPDF_Object::GetConstString() const {
FX_FLOAT CPDF_Object::GetNumber() const {
const CPDF_Object* obj = GetBasicObject();
if (obj && obj->GetType() == PDFOBJ_NUMBER)
- return AsNumber()->GetNumber();
+ return obj->AsNumber()->GetNumber();
return 0;
}
@@ -120,10 +120,10 @@ CPDF_Dictionary* CPDF_Object::GetDict() const {
if (type == PDFOBJ_DICTIONARY) {
// The method should be made non-const if we want to not be const.
// See bug #234.
- return const_cast<CPDF_Dictionary*>(AsDictionary());
+ return const_cast<CPDF_Dictionary*>(obj->AsDictionary());
}
if (type == PDFOBJ_STREAM)
- return AsStream()->GetDict();
+ return obj->AsStream()->GetDict();
}
return nullptr;
}
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698