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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 1417893003: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
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 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 "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_serial.h" 9 #include "../../../include/fpdfapi/fpdf_serial.h"
10 #include "pageint.h" 10 #include "pageint.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (!fullname.IsEmpty()) { 507 if (!fullname.IsEmpty()) {
508 pDict->SetAtName(key, fullname); 508 pDict->SetAtName(key, fullname);
509 } 509 }
510 } else { 510 } else {
511 _PDF_ReplaceAbbr(value); 511 _PDF_ReplaceAbbr(value);
512 } 512 }
513 } 513 }
514 break; 514 break;
515 } 515 }
516 case PDFOBJ_ARRAY: { 516 case PDFOBJ_ARRAY: {
517 CPDF_Array* pArray = (CPDF_Array*)pObj; 517 CPDF_Array* pArray = pObj->AsArray();
518 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { 518 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
519 CPDF_Object* pElement = pArray->GetElement(i); 519 CPDF_Object* pElement = pArray->GetElement(i);
520 if (pElement->IsName()) { 520 if (pElement->IsName()) {
521 CFX_ByteString name = pElement->GetString(); 521 CFX_ByteString name = pElement->GetString();
522 CFX_ByteStringC fullname = _PDF_FindFullName( 522 CFX_ByteStringC fullname = _PDF_FindFullName(
523 _PDF_InlineValueAbbr, 523 _PDF_InlineValueAbbr,
524 sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name); 524 sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
525 if (!fullname.IsEmpty()) { 525 if (!fullname.IsEmpty()) {
526 pArray->SetAt(i, CPDF_Name::Create(fullname)); 526 pArray->SetAt(i, CPDF_Name::Create(fullname));
527 } 527 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 if (!abbrName.IsEmpty()) { 570 if (!abbrName.IsEmpty()) {
571 pDict->SetAtName(key, abbrName); 571 pDict->SetAtName(key, abbrName);
572 } 572 }
573 } else { 573 } else {
574 _PDF_ReplaceFull(value); 574 _PDF_ReplaceFull(value);
575 } 575 }
576 } 576 }
577 break; 577 break;
578 } 578 }
579 case PDFOBJ_ARRAY: { 579 case PDFOBJ_ARRAY: {
580 CPDF_Array* pArray = (CPDF_Array*)pObj; 580 CPDF_Array* pArray = pObj->AsArray();
581 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { 581 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
582 CPDF_Object* pElement = pArray->GetElement(i); 582 CPDF_Object* pElement = pArray->GetElement(i);
583 if (pElement->IsName()) { 583 if (pElement->IsName()) {
584 CFX_ByteString name = pElement->GetString(); 584 CFX_ByteString name = pElement->GetString();
585 CFX_ByteStringC abbrName = _PDF_FindAbbrName( 585 CFX_ByteStringC abbrName = _PDF_FindAbbrName(
586 _PDF_InlineValueAbbr, 586 _PDF_InlineValueAbbr,
587 sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name); 587 sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
588 if (!abbrName.IsEmpty()) { 588 if (!abbrName.IsEmpty()) {
589 pArray->SetAt(i, CPDF_Name::Create(abbrName)); 589 pArray->SetAt(i, CPDF_Name::Create(abbrName));
590 } 590 }
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 buf.AppendChar((char)code); 1587 buf.AppendChar((char)code);
1588 } 1588 }
1589 bFirst = !bFirst; 1589 bFirst = !bFirst;
1590 } 1590 }
1591 } 1591 }
1592 if (!bFirst) { 1592 if (!bFirst) {
1593 buf.AppendChar((char)code); 1593 buf.AppendChar((char)code);
1594 } 1594 }
1595 return buf.GetByteString(); 1595 return buf.GetByteString();
1596 } 1596 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698