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

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

Issue 1090303003: Add missing operators for CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: use size_t Created 5 years, 8 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_parser.h" 7 #include "../../../include/fpdfapi/fpdf_parser.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_page.h" 9 #include "../../../include/fpdfapi/fpdf_page.h"
10 #include "../../../src/fxcrt/fx_safe_types.h" 10 #include "../../../src/fxcrt/fx_safe_types.h"
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 { 2551 {
2552 FX_INT32 taglen = tag.GetLength(); 2552 FX_INT32 taglen = tag.GetLength();
2553 if (taglen == 0) { 2553 if (taglen == 0) {
2554 return FALSE; 2554 return FALSE;
2555 } 2555 }
2556 FX_FILESIZE pos = m_Pos; 2556 FX_FILESIZE pos = m_Pos;
2557 FX_INT32 offset = 0; 2557 FX_INT32 offset = 0;
2558 if (!bForward) { 2558 if (!bForward) {
2559 offset = taglen - 1; 2559 offset = taglen - 1;
2560 } 2560 }
2561 FX_LPCBYTE tag_data = tag; 2561 FX_LPCBYTE tag_data = tag.GetPtr();
2562 FX_BYTE byte; 2562 FX_BYTE byte;
2563 while (1) { 2563 while (1) {
2564 if (bForward) { 2564 if (bForward) {
2565 if (limit) { 2565 if (limit) {
2566 if (pos >= m_Pos + limit) { 2566 if (pos >= m_Pos + limit) {
2567 return FALSE; 2567 return FALSE;
2568 } 2568 }
2569 } 2569 }
2570 if (!GetCharAt(pos, byte)) { 2570 if (!GetCharAt(pos, byte)) {
2571 return FALSE; 2571 return FALSE;
(...skipping 16 matching lines...) Expand all
2588 continue; 2588 continue;
2589 } 2589 }
2590 } else { 2590 } else {
2591 offset --; 2591 offset --;
2592 if (offset >= 0) { 2592 if (offset >= 0) {
2593 pos --; 2593 pos --;
2594 continue; 2594 continue;
2595 } 2595 }
2596 } 2596 }
2597 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos; 2597 FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos;
2598 if (!bWholeWord || IsWholeWord(startpos, limit, tag, taglen)) { 2598 if (!bWholeWord || IsWholeWord(startpos, limit, tag.GetPtr(), taglen )) {
2599 m_Pos = startpos; 2599 m_Pos = startpos;
2600 return TRUE; 2600 return TRUE;
2601 } 2601 }
2602 } 2602 }
2603 if (bForward) { 2603 if (bForward) {
2604 offset = byte == tag_data[0] ? 1 : 0; 2604 offset = byte == tag_data[0] ? 1 : 0;
2605 pos ++; 2605 pos ++;
2606 } else { 2606 } else {
2607 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1; 2607 offset = byte == tag_data[taglen - 1] ? taglen - 2 : taglen - 1;
2608 pos --; 2608 pos --;
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
4642 { 4642 {
4643 FX_INT32 iSize = m_childNode.GetSize(); 4643 FX_INT32 iSize = m_childNode.GetSize();
4644 for (FX_INT32 i = 0; i < iSize; ++i) { 4644 for (FX_INT32 i = 0; i < iSize; ++i) {
4645 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4645 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4646 if (pNode) { 4646 if (pNode) {
4647 delete pNode; 4647 delete pNode;
4648 } 4648 }
4649 } 4649 }
4650 m_childNode.RemoveAll(); 4650 m_childNode.RemoveAll();
4651 } 4651 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698