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

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

Issue 1783023002: Re-enable MSVC warning 4800 for compiling with chromium_code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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 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 // 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/cpdf_parser.h" 7 #include "core/include/fpdfapi/cpdf_parser.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 while (it != m_ObjectInfo.end()) { 117 while (it != m_ObjectInfo.end()) {
118 auto saved_it = it++; 118 auto saved_it = it++;
119 m_ObjectInfo.erase(saved_it); 119 m_ObjectInfo.erase(saved_it);
120 } 120 }
121 121
122 if (!pdfium::ContainsKey(m_ObjectInfo, objnum - 1)) 122 if (!pdfium::ContainsKey(m_ObjectInfo, objnum - 1))
123 m_ObjectInfo[objnum - 1].pos = 0; 123 m_ObjectInfo[objnum - 1].pos = 0;
124 } 124 }
125 125
126 void CPDF_Parser::CloseParser() { 126 void CPDF_Parser::CloseParser() {
127 m_bVersionUpdated = FALSE; 127 m_bVersionUpdated = false;
128 delete m_pDocument; 128 delete m_pDocument;
129 m_pDocument = nullptr; 129 m_pDocument = nullptr;
130 130
131 if (m_pTrailer) { 131 if (m_pTrailer) {
132 m_pTrailer->Release(); 132 m_pTrailer->Release();
133 m_pTrailer = nullptr; 133 m_pTrailer = nullptr;
134 } 134 }
135 ReleaseEncryptHandler(); 135 ReleaseEncryptHandler();
136 SetEncryptDictionary(nullptr); 136 SetEncryptDictionary(nullptr);
137 137
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (offset == 0) { 459 if (offset == 0) {
460 for (int32_t c = 0; c < 10; c++) { 460 for (int32_t c = 0; c < 10; c++) {
461 if (!std::isdigit(pEntry[c])) 461 if (!std::isdigit(pEntry[c]))
462 return FALSE; 462 return FALSE;
463 } 463 }
464 } 464 }
465 465
466 m_ObjectInfo[objnum].pos = offset; 466 m_ObjectInfo[objnum].pos = offset;
467 int32_t version = FXSYS_atoi(pEntry + 11); 467 int32_t version = FXSYS_atoi(pEntry + 11);
468 if (version >= 1) 468 if (version >= 1)
469 m_bVersionUpdated = TRUE; 469 m_bVersionUpdated = true;
470 470
471 m_ObjectInfo[objnum].gennum = version; 471 m_ObjectInfo[objnum].gennum = version;
472 if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen) 472 if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen)
473 m_SortedOffset.insert(m_ObjectInfo[objnum].pos); 473 m_SortedOffset.insert(m_ObjectInfo[objnum].pos);
474 474
475 m_ObjectInfo[objnum].type = 1; 475 m_ObjectInfo[objnum].type = 1;
476 } 476 }
477 } 477 }
478 } 478 }
479 m_pSyntax->RestorePos(SavedPos + count * recordsize); 479 m_pSyntax->RestorePos(SavedPos + count * recordsize);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (offset == 0) { 534 if (offset == 0) {
535 for (int32_t c = 0; c < 10; c++) { 535 for (int32_t c = 0; c < 10; c++) {
536 if (!std::isdigit(pEntry[c])) 536 if (!std::isdigit(pEntry[c]))
537 return false; 537 return false;
538 } 538 }
539 } 539 }
540 540
541 m_ObjectInfo[objnum].pos = offset; 541 m_ObjectInfo[objnum].pos = offset;
542 int32_t version = FXSYS_atoi(pEntry + 11); 542 int32_t version = FXSYS_atoi(pEntry + 11);
543 if (version >= 1) 543 if (version >= 1)
544 m_bVersionUpdated = TRUE; 544 m_bVersionUpdated = true;
545 545
546 m_ObjectInfo[objnum].gennum = version; 546 m_ObjectInfo[objnum].gennum = version;
547 if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen) 547 if (m_ObjectInfo[objnum].pos < m_pSyntax->m_FileLen)
548 m_SortedOffset.insert(m_ObjectInfo[objnum].pos); 548 m_SortedOffset.insert(m_ObjectInfo[objnum].pos);
549 549
550 m_ObjectInfo[objnum].type = 1; 550 m_ObjectInfo[objnum].type = 1;
551 } 551 }
552 } 552 }
553 } 553 }
554 } 554 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 i += (FX_DWORD)nLen; 768 i += (FX_DWORD)nLen;
769 } 769 }
770 770
771 if (!m_ObjectInfo.empty() && IsValidObjectNumber(objnum) && 771 if (!m_ObjectInfo.empty() && IsValidObjectNumber(objnum) &&
772 m_ObjectInfo[objnum].pos) { 772 m_ObjectInfo[objnum].pos) {
773 if (pObject) { 773 if (pObject) {
774 FX_DWORD oldgen = GetObjectGenNum(objnum); 774 FX_DWORD oldgen = GetObjectGenNum(objnum);
775 m_ObjectInfo[objnum].pos = obj_pos; 775 m_ObjectInfo[objnum].pos = obj_pos;
776 m_ObjectInfo[objnum].gennum = gennum; 776 m_ObjectInfo[objnum].gennum = gennum;
777 if (oldgen != gennum) 777 if (oldgen != gennum)
778 m_bVersionUpdated = TRUE; 778 m_bVersionUpdated = true;
779 } 779 }
780 } else { 780 } else {
781 m_ObjectInfo[objnum].pos = obj_pos; 781 m_ObjectInfo[objnum].pos = obj_pos;
782 m_ObjectInfo[objnum].type = 1; 782 m_ObjectInfo[objnum].type = 1;
783 m_ObjectInfo[objnum].gennum = gennum; 783 m_ObjectInfo[objnum].gennum = gennum;
784 } 784 }
785 785
786 if (pObject) 786 if (pObject)
787 pObject->Release(); 787 pObject->Release();
788 } 788 }
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && 1642 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) &&
1643 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { 1643 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) {
1644 m_LastXRefOffset = 0; 1644 m_LastXRefOffset = 0;
1645 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1645 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1646 return FORMAT_ERROR; 1646 return FORMAT_ERROR;
1647 } 1647 }
1648 1648
1649 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; 1649 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum;
1650 return SUCCESS; 1650 return SUCCESS;
1651 } 1651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698