OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h" | 5 #include "core/fpdfapi/fpdf_parser/cpdf_boolean.h" |
6 #include "core/fpdfapi/fpdf_parser/cpdf_null.h" | 6 #include "core/fpdfapi/fpdf_parser/cpdf_null.h" |
7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
8 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_number.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 return true; | 129 return true; |
130 } | 130 } |
131 case CPDF_Object::DICTIONARY: { | 131 case CPDF_Object::DICTIONARY: { |
132 const CPDF_Dictionary* dict1 = obj1->AsDictionary(); | 132 const CPDF_Dictionary* dict1 = obj1->AsDictionary(); |
133 const CPDF_Dictionary* dict2 = obj2->AsDictionary(); | 133 const CPDF_Dictionary* dict2 = obj2->AsDictionary(); |
134 if (dict1->GetCount() != dict2->GetCount()) | 134 if (dict1->GetCount() != dict2->GetCount()) |
135 return false; | 135 return false; |
136 for (CPDF_Dictionary::const_iterator it = dict1->begin(); | 136 for (CPDF_Dictionary::const_iterator it = dict1->begin(); |
137 it != dict1->end(); ++it) { | 137 it != dict1->end(); ++it) { |
138 if (!Equal(it->second, dict2->GetObjectBy(it->first.AsByteStringC()))) | 138 if (!Equal(it->second, dict2->GetObjectBy(it->first.AsStringC()))) |
139 return false; | 139 return false; |
140 } | 140 } |
141 return true; | 141 return true; |
142 } | 142 } |
143 case CPDF_Object::NULLOBJ: | 143 case CPDF_Object::NULLOBJ: |
144 return true; | 144 return true; |
145 case CPDF_Object::STREAM: { | 145 case CPDF_Object::STREAM: { |
146 const CPDF_Stream* stream1 = obj1->AsStream(); | 146 const CPDF_Stream* stream1 = obj1->AsStream(); |
147 const CPDF_Stream* stream2 = obj2->AsStream(); | 147 const CPDF_Stream* stream2 = obj2->AsStream(); |
148 if (!stream1->GetDict() && !stream2->GetDict()) | 148 if (!stream1->GetDict() && !stream2->GetDict()) |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 EXPECT_EQ(arr->GetCount(), arr1->GetCount()); | 767 EXPECT_EQ(arr->GetCount(), arr1->GetCount()); |
768 for (size_t i = 0; i < arr->GetCount(); ++i) { | 768 for (size_t i = 0; i < arr->GetCount(); ++i) { |
769 EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType()); | 769 EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType()); |
770 EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect()); | 770 EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect()); |
771 EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i)); | 771 EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i)); |
772 EXPECT_EQ(CPDF_Object::REFERENCE, arr1->GetObjectAt(i)->GetType()); | 772 EXPECT_EQ(CPDF_Object::REFERENCE, arr1->GetObjectAt(i)->GetType()); |
773 EXPECT_EQ(indirect_objs[i], arr1->GetObjectAt(i)->GetDirect()); | 773 EXPECT_EQ(indirect_objs[i], arr1->GetObjectAt(i)->GetDirect()); |
774 EXPECT_EQ(indirect_objs[i], arr1->GetDirectObjectAt(i)); | 774 EXPECT_EQ(indirect_objs[i], arr1->GetDirectObjectAt(i)); |
775 } | 775 } |
776 } | 776 } |
OLD | NEW |