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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp

Issue 1667873002: Merge to XFA: Complete unit tests for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/include/fpdfapi/fpdf_objects.h" 7 #include "core/include/fpdfapi/fpdf_objects.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 pArray->AddNumber(rect.left); 447 pArray->AddNumber(rect.left);
448 pArray->AddNumber(rect.bottom); 448 pArray->AddNumber(rect.bottom);
449 pArray->AddNumber(rect.right); 449 pArray->AddNumber(rect.right);
450 pArray->AddNumber(rect.top); 450 pArray->AddNumber(rect.top);
451 SetAt(key, pArray); 451 SetAt(key, pArray);
452 } 452 }
453 453
454 void CPDF_Dictionary::SetAtMatrix(const CFX_ByteStringC& key, 454 void CPDF_Dictionary::SetAtMatrix(const CFX_ByteStringC& key,
455 const CFX_Matrix& matrix) { 455 const CFX_Matrix& matrix) {
456 CPDF_Array* pArray = new CPDF_Array; 456 CPDF_Array* pArray = new CPDF_Array;
457 pArray->AddNumber16(matrix.a); 457 pArray->AddNumber(matrix.a);
458 pArray->AddNumber16(matrix.b); 458 pArray->AddNumber(matrix.b);
459 pArray->AddNumber16(matrix.c); 459 pArray->AddNumber(matrix.c);
460 pArray->AddNumber16(matrix.d); 460 pArray->AddNumber(matrix.d);
461 pArray->AddNumber(matrix.e); 461 pArray->AddNumber(matrix.e);
462 pArray->AddNumber(matrix.f); 462 pArray->AddNumber(matrix.f);
463 SetAt(key, pArray); 463 SetAt(key, pArray);
464 } 464 }
465 465
466 CPDF_Stream::CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict) 466 CPDF_Stream::CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict)
467 : m_pDict(pDict), 467 : m_pDict(pDict),
468 m_dwSize(size), 468 m_dwSize(size),
469 m_GenNum(kMemoryBasedGenNum), 469 m_GenNum(kMemoryBasedGenNum),
470 m_pDataBuf(pData) {} 470 m_pDataBuf(pData) {}
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 pObj->Destroy(); 746 pObj->Destroy();
747 return FALSE; 747 return FALSE;
748 } 748 }
749 it->second->Destroy(); 749 it->second->Destroy();
750 } 750 }
751 pObj->m_ObjNum = objnum; 751 pObj->m_ObjNum = objnum;
752 m_IndirectObjs[objnum] = pObj; 752 m_IndirectObjs[objnum] = pObj;
753 m_LastObjNum = std::max(m_LastObjNum, objnum); 753 m_LastObjNum = std::max(m_LastObjNum, objnum);
754 return TRUE; 754 return TRUE;
755 } 755 }
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_objects.h ('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