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

Unified Diff: core/fpdfapi/parser/cpdf_dictionary.cpp

Issue 2498223005: Make CPDF_Array take unique_ptrs (Closed)
Patch Set: nits Created 4 years, 1 month 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 | « core/fpdfapi/parser/cpdf_data_avail.cpp ('k') | core/fpdfapi/parser/cpdf_document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_dictionary.cpp
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 02cdfa37daa511abd6cb58ef4b333e58be157a2a..f28507e2e466a9348c57cbefd9c5ad522db9a7d6 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -270,22 +270,22 @@ void CPDF_Dictionary::SetBooleanFor(const CFX_ByteString& key, bool bValue) {
void CPDF_Dictionary::SetRectFor(const CFX_ByteString& key,
const CFX_FloatRect& rect) {
CPDF_Array* pArray = new CPDF_Array;
- pArray->AddNumber(rect.left);
- pArray->AddNumber(rect.bottom);
- pArray->AddNumber(rect.right);
- pArray->AddNumber(rect.top);
+ pArray->AddNew<CPDF_Number>(rect.left);
+ pArray->AddNew<CPDF_Number>(rect.bottom);
+ pArray->AddNew<CPDF_Number>(rect.right);
+ pArray->AddNew<CPDF_Number>(rect.top);
SetFor(key, pArray);
}
void CPDF_Dictionary::SetMatrixFor(const CFX_ByteString& key,
const CFX_Matrix& matrix) {
CPDF_Array* pArray = new CPDF_Array;
- pArray->AddNumber(matrix.a);
- pArray->AddNumber(matrix.b);
- pArray->AddNumber(matrix.c);
- pArray->AddNumber(matrix.d);
- pArray->AddNumber(matrix.e);
- pArray->AddNumber(matrix.f);
+ pArray->AddNew<CPDF_Number>(matrix.a);
+ pArray->AddNew<CPDF_Number>(matrix.b);
+ pArray->AddNew<CPDF_Number>(matrix.c);
+ pArray->AddNew<CPDF_Number>(matrix.d);
+ pArray->AddNew<CPDF_Number>(matrix.e);
+ pArray->AddNew<CPDF_Number>(matrix.f);
SetFor(key, pArray);
}
« no previous file with comments | « core/fpdfapi/parser/cpdf_data_avail.cpp ('k') | core/fpdfapi/parser/cpdf_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698